I currently have a list which contains all of my input for an sklearn classifier. Each element in that list is a list of features, where each element represents a song in my dataset.
I need to convert this structure to a 2D numpy array so I can scale my data via sklearn's preprocessing. This is proving to be very difficult.
y = []
all_feats = []
for song in data:
mfccs_in_song = song[0]
oned_mfccs_in_song = []
for frame in mfccs_in_song:
for m in frame:
oned_mfccs_in_song.append(m)
all_feats.append(oned_mfccs_in_song)
label = song[-1]
y.append(label)
Long story short, all_feats is that list of lists. It has a length of 600. How can I convert this to a numpy array for preprocessing? I have tried numerous things, including simply all_feats = np.array(all_feats)
, however that does not work.