一般使用weka进行数据挖掘的时候会碰到两个问题,一是内存不够,二是libsvm使用不了,这时就需要重新配置RunWeka.ini文件,解决上述问题。查看RunWeka.ini原文如下:
1 # Contains the commands for running Weka either with a command prompt 2 # ("cmd_console") or without the command prompt ("cmd_default"). 3 # One can also define custom commands, which can be used with the Weka 4 # launcher "RunWeka.class". E.g., to run the launcher with a setup called 5 # "custom1", you only need to specify a key "cmd_custom1" which contains the 6 # command specification. 7 # 8 # Notes: 9 # - This file is not a DOS ini file, but a Java properties file. 10 # - The settings listed here are key-value pairs, separated by a "=". Every 11 # key can only be listed ONCE. 12 # 13 # Author FracPete (fracpete at waikato dot ac dot nz) 14 # Version $Revision: 1.3 $ 15 16 # setups (prefixed with "cmd_") 17 cmd_default=javaw -Dfile.encoding=#fileEncoding# -Xmx#maxheap# #javaOpts# -classpath "#wekajar#;#cp#" #mainclass# 18 cmd_console=cmd.exe /K start cmd.exe /K "java -Dfile.encoding=#fileEncoding# -Xmx#maxheap# #javaOpts# -classpath "#wekajar#;#cp#" #mainclass#" 19 cmd_explorer=java -Dfile.encoding=#fileEncoding# -Xmx#maxheap# #javaOpts# -classpath "#wekajar#;#cp#" weka.gui.explorer.Explorer 20 cmd_knowledgeFlow=java -Dfile.encoding=#fileEncoding# -Xmx#maxheap# #javaOpts# -classpath "#wekajar#;#cp#" weka.gui.beans.KnowledgeFlow 21 22 # placeholders ("#bla#" in command gets replaced with content of key "bla") 23 # Note: "#wekajar#" gets replaced by the launcher class, since that jar gets 24 # provided as parameter 25 maxheap=1024M 26 # The MDI GUI 27 #mainclass=weka.gui.Main 28 # The GUIChooser 29 mainclass=weka.gui.GUIChooser 30 # The file encoding; use "utf-8" instead of "Cp1252" to display UTF-8 characters in the 31 # GUI, e.g., the Explorer 32 fileEncoding=Cp1252 33 # The JAVA_OPTS environment variable (if set). Can be used as an alternative way to set 34 # the heap size (or any other JVM option) 35 javaOpts=%JAVA_OPTS% 36 # The classpath placeholder. Add any environment variables or jars to it that 37 # you need for your Weka environment. 38 # Example with an enviroment variable (e.g., THIRD_PARTY_LIBS): 39 # cp=%CLASSPATH%;%THIRD_PARTY_LIBS% 40 # Example with an extra jar (located at D:librarieslibsvm.jar): 41 # cp=%CLASSPATH%;D:\\libraries\\libsvm.jar 42 # Or in order to avoid quadrupled backslashes, you can also use slashes "/": 43 # cp=%CLASSPATH%;D:/libraries/libsvm.jar 44 cp=%CLASSPATH%
其中maxheap选项为配置weka最大使用内存,默认为1024M;
cp选项为引入包所在路径,从注释中的说明可以看到libsvm包的添加方法;
其他如:mainclass,fileEncoding,javaOpts分别为图形用户界面,文件编码,Java虚拟机选项。