/mnist_tutorial

A tutorial for MNIST handwritten digit classification using sklearn, PyTorch and Keras.

Primary LanguageJupyter Notebook

Q1:

Please use the logistic regression(default parameters) in sklearn to classify the data above, and print the training accuracy and test accuracy.
Training accuracy: 97.50%
Testing accuracy: 87.30%

Q2

Please use the naive bayes(Bernoulli, default parameters) in sklearn to classify the data above, and print the training accuracy and test accuracy.
Training accuracy: 82.07%
Testing accuracy: 80.60%

Q3

Please use the support vector machine(default parameters) in sklearn to classify the data above, and print the training accuracy and test accuracy.
Training accuracy: 97.88%
Testing accuracy: 85.10%

Q4

Please adjust the parameters of SVM to increase the testing accuracy, and print the training accuracy and test accuracy.
Training accuracy: 95.37%
Testing accuracy: 87.10%

Q5:

Please print the training and testing accuracy.
Training accuracy: 99.73%
Testing accuracy: 99.10%

mnist_tutorial

A tutorial for MNIST handwritten digit classification using sklearn, PyTorch and Keras.

Code structure

Requirements

Code tested on following environments, other version should also work:

  • linux system (ubuntu 16.04)
  • python 3.6.3
  • numpy 1.13.3
  • matplotlib 2.1.0
  • sklearn 0.19.1
  • pytorch 0.4.1
  • keras 2.1.2

For students from SJTU

Please read HEAR.