ValueError: setting an array element with a sequence. while using SVM in scikit-learn

Finally I found the answer to my question with the help of some ideas from @larsmans and @eickenberg. The problem was that X_train did not have the same number of elements in all the arrays. So, it was not able to form a 2D array. Now that I have added an additional value to that array, the dimensionality matched for all the 1D arrays and X_train was able to form a 2D array. Thanks for the ideas guys!


I had the same problem. The size of the data was consistent, so that did not help. What did work: clf.fit(list(X_train),Y_train)