I have a problem to train my classifier.
I have 10 different kinds of music genres, each genre with 100 songs, after making an Mfccs I have a numpy array of (1293, 20)
If all together with np.vstack I have an array of (1293000, 20) and another for the labels.
When I run model.fit (features, labels)
, it takes a lot of time.
I have also tried with:
from sklearn.manifold import TSNE
X_embedded = TSNE (n_components = 2).fit_transform(features)
X_embedded.shape
I've tried to reduce the songs from 1000 to 100 but it's still taking a long time.
Any idea how I can classify songs with arrays with so much data?
I put some code:
scaler = sklearn.preprocessing.StandardScaler()
y, sr = librosa.load('EXAMPLE1')
mfcc = librosa.feature.mfcc(y, sr=sr, n_mfcc=20).T
mfcc_scaled = scaler.fit_transform(mfcc)
mfcc_scaled.shape # (1293, 20)
y, sr = librosa.load('/Users/josetorronteras/AnacondaProjects/Neural-Networks/genres/pop/pop.00044.au')
mfcc2 = librosa.feature.mfcc(y, sr=sr, n_mfcc=20).T
mfcc_scaled2 = scaler.fit_transform(mfcc2)
mfcc_scaled2.shape # (1293, 20)
tmp_arr = []
tmp_arr.append(mfcc_scaled)
tmp_arr.append(mfcc_scaled2)
mafcc_list = np.vstack(tmp_arr)
mafcc_list.shape # (2586, 20)
a0 = np.zeros(len(mfcc_scaled))
a1 = np.ones(len(mfcc_scaled2))
labels = np.concatenate((a0, a1))
labels.shape # (2586,)
Thanks
partial_fit
instead offit
. I forgot to include the link. $\endgroup$partial_fit( X , y , classes = None , sample_weight = None )
And i other code i see a loop.. $\endgroup$