Home > OS >  SVM classifier giving wrong predictions for MNIST images
SVM classifier giving wrong predictions for MNIST images

Time:05-01

I'm using SVM to predict the values in MNIST dataset. The accuracy of the model comes close to 91% but when I use it along with open cv to predict the value of an image, the result always shows 0. What is the issue here? I've added the image that I'm using for reference.
enter image description here

CodePudding user response:

The output of the prediction is not on-hot encoded, so you shouldn't apply np.argmax at the end.
So try this,

print("The predicted value is : ",prediction[0])

CodePudding user response:

I guess my first obvious question is why are you using the first 7k samples out of 70k for training. And the crossval performance is even based on the same samples. Why are you not picking a large sample set for training.

Even the official dataset says: The MNIST database of handwritten digits with 784 features, raw data available at: http://yann.lecun.com/exdb/mnist/. It can be split in a training set of the first 60,000 examples, and a test set of 10,000 examples

  • Related