Sklearn digits dataset
<pre><code>import matplotlib.pyplot as plt

from sklearn import datasets
from sklearn import svm

digits = datasets.load_digits()

print(digits.data)

classifier = svm.SVC(gamma=0.4, C=100)
x, y = digits.data[:-1], digits.target[:-1]

x = x.reshape(1,-1)
y = y.reshape(-1,1)
print((x))

classifier.fit(x, y)
###
print('Prediction:', classifier.predict(digits.data[-3]))
###
plt.imshow(digits.images[-1], cmap=plt.cm.gray_r, interpolation='nearest')
plt.show()
</code></pre>

<p>I have reshaped the x and y as well. Still I'm getting an error saying :</p>

<p>Found input variables with inconsistent numbers of samples: [1, 1796]</p>

<p>Y has 1-d array with 1796 elements whereas x has many. How does it show 1 for x? </p>