ubuntu下 weka的安装使用
捣鼓了一个多小时,总结出了ubuntu下weka的安装使用方法。
1 从 这里 http://www.cs.waikato.ac.nz/ml/weka/ 下载weka,我下载的版本是3-6-6
2 从这里下载svm包 http://weka.wikispaces.com/LibSVM ,我下载的是 libsvm.jar
3 为了方便我们使用weka,修改~/.bashrc 找到CLASSPATH,将weka.jar和libsvm.jar的路径添加进入 CLASSPATH,
$WEKA_PATH= weka解压的路径
CLASSPATH= 之前的设置:$WEKA_PATH/weka.jar:$WEKA_PATH/libsvm.jar
4 然后source ~/.bashrc ,设置就生效了。
5 在/usr/bin下面创建weka,添加这些内容
#! /bin/bash
java -classpath $CLASSPATH:weka.jar:libsvm.jar weka.gui.GUIChooser
然后在chmod +x weka
6 就可以在终端输入weka来启动weka了
但是运行后,有以下几个warning
Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in CLASSPATH?
这是因为缺少对应的jar包,下面各个击破,找这些包花了不少时间=,=。。。
RmiJdbc.jar http://rmijdbc.ow2.org/download.html RmiJdbc我一开始下载的是最新的,不行,
直到看到了这篇博客http://www.blogjava.net/honeybee/articles/193605.html中说,一定要选择版本2.5
idb.jar, http://download.csdn.net/detail/hjoksky/3090215 这个不需要积分哦,感谢
hsqldb.jar http://hsqldb.org/ 最新版即可
mkjdbc.jar http://en.sourceforge.jp/projects/sfnet_mcdump/downloads/mcdump/release_0_7/mkjdbc.jar/
mysql-connector-java-5.1.6.bin.jar http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.6.tar.gz/from/pick?file=Downloads/Connector-J/mysql-connector-java-5.1.6.tar.gz&mirror=pick
7 下载完这些东西之后,将jar包放在刚才weka解压的路径下,然后再次编辑~/.bashrc,将这些包的路径添加到CLASSPATH中
CLASSPATH= 之前的设置:$WEKA_PATH/hsqldb.jar:$WEKA_PATH/mkjdbc.jar:$WEKA_PATH/RmiJdbc.jar:$WEKA_PATH/idb.jar:$WEKA_PATH/mysql-connector-java-5.1.6-bin.jar:$WEKA_PATH/weka.jar:$WEKA_PATH/libsvm.jar
8 然后source ~/.bashrc,再运行weka,恩,这样就没有warning啦~