Skip to content

Get 98.47% test accuracy MNIST with only 250 lines of code SVM by JAVA

License

Notifications You must be signed in to change notification settings

nthoangcute/tinySVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tinySVM

Very simple support vector machine by Java

INSTALLING

Download the MNIST or EMNIST dataset from here.

Change your path in trainFile and testFile.

  public String trainFile = "/home/vietbt/java/mnist_digits_train.txt";
  public String testFile = "/home/vietbt/java/mnist_digits_test.txt";

More information about MNIST or EMNIST datasets is in here. After that, run this code with your Java IDE or by linux command line:

  javac tinySVM.java
  java tinySVM

If you have a java memory heap error, reduce batchSize to smaller.

PERFORMANCE

The update version can run with maximum 10 CPUs and return the best result after serval hours.

MNIST Digits Dataset

  • Best test accuracy: 98.47% after 112 steps

  • Confusion matrix:
0 1 2 3 4 5 6 7 8 9
0 993 0 1 0 1 0 1 0 2 0
1 2 993 0 0 0 0 0 0 3 1
2 2 4 989 4 2 0 0 2 0 2
3 0 1 6 984 0 4 1 4 8 1
4 1 2 1 1 984 1 2 3 3 5
5 0 0 1 5 2 991 4 2 4 5
6 0 0 0 0 0 3 992 2 2 2
7 1 0 1 1 2 0 0 983 5 7
8 1 0 1 4 4 0 0 2 972 11
9 0 0 0 1 5 1 0 2 1 966

AUTHOR

Bui The Viet - FPT University - vietpro213tb@gmail.com

About

Get 98.47% test accuracy MNIST with only 250 lines of code SVM by JAVA

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages