资源简介
可以在weka中使用并被JAVA调用的SVM工具包
代码片段和文件信息
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not write to the Free Software
* Foundation Inc. 675 Mass Ave Cambridge MA 02139 USA.
*/
/*
* Example.java
* Copyright (C) 2005 Yasser EL-Manzalawy
*
*/
/*
* This exmaple deomnstrates how to use WLSVM classifier.
*/
import weka.classifiers.Evaluation;
import wlsvm.WLSVM;
public class Example {
public static void main(String[] argv)throws Exception{
if (argv.length < 1){
System.out.println(“Usage: Example “);
System.exit(1);
}
String dataFile = argv[0]; // input arff file
WLSVM lib = new WLSVM();
String[] ops = {new String(“-t“)
dataFile
new String(“-x“) // 5 folds CV
new String(“5“)
new String(“-i“) //
//---------------
new String(“-S“) // WLSVM options
new String(“0“) // Classification problem
new String(“-K“) // RBF kernel
new String(“2“)
new String(“-G“) // gamma
new String(“1“)
new String(“-C“) // C
new String(“7“)
new String(“-Z“) // normalize input data
new String(“1“)
new String(“-M“) // cache size in MB
new String(“100“)
};
System.out.println(Evaluation.evaluateModel(libops));
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 976 2005-10-06 17:11 WLSVM\COPYRIGHT
文件 1912 2005-10-11 16:35 WLSVM\Examples\Example.java
文件 116434 2005-10-11 15:56 WLSVM\lib\libsvm.jar
文件 15409 2005-11-08 23:29 WLSVM\lib\wlsvm.jar
文件 17977 2003-03-14 08:35 WLSVM\LICENSE
文件 2756 2005-10-22 15:30 WLSVM\README
文件 1496 2005-06-14 10:05 WLSVM\README.libsvm
文件 14174 2004-10-02 04:18 WLSVM\README.weka
文件 15085 2005-11-08 23:26 WLSVM\src\wlsvm\WLSVM.class
文件 20042 2005-11-08 23:26 WLSVM\src\wlsvm\WLSVM.java
目录 0 2009-03-24 13:03 WLSVM\src\wlsvm
目录 0 2009-03-24 13:03 WLSVM\Examples
目录 0 2009-03-24 13:03 WLSVM\lib
目录 0 2009-03-24 13:03 WLSVM\src
目录 0 2009-03-24 13:03 WLSVM
----------- --------- ---------- ----- ----
206261 15
- 上一篇:Jmeter websocket
- 下一篇:Android-电池信息获取
评论
共有 条评论