This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.models import Sequential | |
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense | |
# parameters for architecture | |
input_shape = (224, 224, 3) | |
num_classes = 6 | |
conv_size = 32 | |
# parameters for training | |
batch_size = 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import library --------------------------------------------------------------- | |
import pygame.midi | |
import time | |
# define all the constant values ----------------------------------------------- | |
device = 0 # device number in win10 laptop | |
instrument = 9 # http://www.ccarh.org/courses/253/handout/gminstruments/ | |
note_Do = 48 # http://www.electronics.dit.ie/staff/tscarff/Music_technology/midi/midi_note_numbers_for_octaves.htm | |
note_Re = 50 | |
note_Me = 52 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file_name one_hot_encoding ordered_labels ordered_categories | |
---------------------------------------------------------------------------------------------------- | |
0.png [0, 1, 1, 1, 0, 0, 1, 0, 0, 0] [6, 3, 2, 1] [Shirt, Dress, Pullover, Trouser] | |
1.png [1, 0, 0, 0, 1, 1, 1, 0, 0, 0] [5, 4, 0, 6] [Sandal, Coat, T-shirt/top, Shirt] | |
2.png [1, 1, 0, 1, 0, 0, 0, 0, 0, 0] [1, 3, 0, 3] [Trouser, Dress, T-shirt/top, Dress] | |
3.png [0, 0, 0, 0, 0, 1, 1, 1, 0, 0] [5, 5, 7, 6] [Sandal, Sandal, Sneaker, Shirt] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import library from Scikit-Learn --------------------------------------------- | |
from sklearn.metrics import accuracy_score | |
from sklearn.metrics import confusion_matrix | |
# algorithm 1 ------------------------------------------------------------------ | |
print(" Naive Bayes ... ") | |
start = timeit.default_timer() | |
from sklearn import naive_bayes | |
classifier = naive_bayes.GaussianNB() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D | |
from keras.models import Model | |
input_img = Input(shape=(28, 28, 1)) | |
x = Conv2D(32, (3, 3), activation='relu', padding='same')(input_img) | |
x = MaxPooling2D((2, 2), padding='same')(x) | |
x = Conv2D(32, (3, 3), activation='relu', padding='same')(x) | |
x = MaxPooling2D((2, 2), padding='same')(x) | |
x = Conv2D(32, (3, 3), activation='relu', padding='same')(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Model | No SMOTE & No nlpaug | SMOTE & No nlpaug | SMOTE & nlpaug | |
---|---|---|---|---|
Naive Bayes | 73.1% | 81.1% | 81.9% | |
Random Forest | 73.1% | 87.8% | 95.9% | |
Gradient Boosting | 79.0% | 89.5% | 97.3% | |
XGBoost | 88.3% | 94.1% | 97.3% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Library | Descritption | Usage in This Project | |
---|---|---|---|
Librosa | audio analysis |