I'm trying to use SVM but I dont know how to fit the model when I am using pandas data frame. If my data looks like this:
df = pd.DataFrame({"x": ['011', '100', '111'] , "y": [0,1,0]})
df.x.apply(lambda x: np.array(list(map(int,x))))
>>>df
x y
0 [0, 1, 1] 0
1 [1, 0, 0] 1
2 [1, 1, 1] 0
If I try to fit the model this way:
clf = svm.SVC().fit(df.x, df.y)
I am getting this error:
ValueError: setting an array element with a sequence.
What is the correct way to fit the SVM using this data frame?