'logistic Regression on a arrays of various sizes
In an audio classification exercise, I am trying to do a logistic regression where my X_train is a list. In fact, the list contains 100 elements and each element is an array of size: N1 But after doing the fit, I have the error of "setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (100,) + inhomogeneous part." which I imagine is because of various size of the elements of my list. My question is: how can I equalize the size of the elements? For example, making my list a list of arrays of size 5001 ?
mfcc_all = []
labels_all = []
for i in range (100):
entry = entries.loc[i,:]
mfcc = load_mfcc(entry, _msdi_path)
mfcc_all.append(mfcc)
y = get_label(entry)
labels_all.append(y)
logReg = LogisticRegression()
logReg.fit(mfcc_all, labels_all)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
