import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
style.use("ggplot")
from sklearn import svm
X=[[1,0,0,0,0],
[0,1,0,0,0],
[0,0,1,0,0],
[1,0,0,1,0],
[1,0,0,0,1]]
y=[0,1,1,1,0]
model=svm.SVC()
model.fit(X,y)
print(model.predict([1,0,1,0,0]))
I was working on this but Iam getting an error as
"if it contains a single sample.".format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[1. 0. 1. 0. 0.].
Reshape your data either using array.reshape(-1, 1) if your data has a single fe
ature or array.reshape(1, -1) if it contains a single sample.
Iam new to this can u guys help me out?