📄 readme.txt
字号:
Java implementation of SMO (Sequential Minimal Optimization) for SVM
Developed by
Xiaoqian Jiang (xiaoqian-jiang@uiowa.edu)
Hwanjo Yu (hwanjoyu@cs.uiowa.edu)
Using This Code:
This code is publicly available to facilitate research in the related areas of data mining and machine learning. If you publish material based on this code, please refer to the source as follows, to help others to obtain the same code and reproduce your experiments.
SVM-JAVA: A Java implementation of the SMO (Sequential Minimal Optimization) for training SVM. Computer Science Department, University of Iowa. http://hwanjoyu.org/svm-java, 2005
Bibtex entry:
@MISC{UIOWA05svm-java,
title = "{SVM-JAVA}: A Java Implementation of the SMO (Sequential Minimal Optimization) for training SVM",
year = "2005",
howpublished = "Computer Science Department, University of Iowa. http://hwanjoyu.org/svm-java"
}
Contact xiaoqian-jiang@uiowa.edu for questions
1. Files
GetOpt.java: The command argument parser for Java
Smo.java: The main source for the SMO program
tic-tac-toe: Sample data file for dense format
heart_scale: Sample data file for sparse format
tic-tac-toe.binary: Sample data file for binary format
2. Tested platform
Linux, Windows
3. How to compile
% javac Smo.java
% javac GetOpt.java
4. How to run
Train:
% java Smo -f [datafile] -d [column NO.] -Other parameters
e.g., java Smo -f heart_scale -s
e.g., java Smo -f tic-tac-toe -d 27
e.g., java Smo -f tic-tac-toe.binary -b
Test:
% java Smo -f [datafile] -m [model file] -a
e.g., java Smo -f tic-tac-toe -m java-svm.model -a
5. Parameters
java Smo -h
usage: -h
-f data_file_name (default: java-svm.data)
-m svm_file_name (default: java-svm.model)
-o output_file_name (default: java-svm.output)
-n N
-d d
-c C (default: 0.05)
-t tolerance (default: 0.001)
-e epsilon (default: 0.001)
-p two_sigma_squared (default: 2)
-l (is_linear_kernel) (default: RBF kernel)
-s (is_sparse_data) (default: false)
-b (is_binary) (default: false)
-a (is_test_only) (default: false)
5. Data format
The data file is a flat text file, and each data point occupies one line.
For dense format, attribute values are followed by the class label (+1 or -1). (See "tic-tac-toe")
Sparse format is the same as that in libsvm or svm light. (See "heard_scale")
For binary format, feature values are binary, so only the indexes are specified. (See "tic-tac-toe.binary")
6. Output
java-svm.model: The SVM model file generated after training
java-svm.output: Function outputs on the training data
7. Saving and loading model parameters
The output order of the model paramters will be
1. The number of attributes d.
2. The flag is-sparse-data
3. The flag is-binary
4. The flag is-linear-kernel
5. The threshold b
6. If the linear kernel is used:
(a) The weight vector w
7. If non-linear kernel is used
(a) Kernel paramters
(b) The number of support vectors
(c) The Lagrange multipliers of the support vectors
(d) The support vectors, one per line
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -