0

I am using the Weka tool for SMO in machine learning. How could I generate the predictions in a Java snippet? I get the following output when I use the GUI tool with "buildLogisticModels" set to true. Which method in the Evaluation class generates the output? Please see below the sample where col1 - instance #; col2 = actual; col3 = predicted; col4 = error; col5 = prediction:

 1        1:1        1:1       0.781
 2        1:1        1:1       0.644 
 3        1:1        1:1       0.742 
 4        1:1        1:1       0.748 
 5        1:1        1:1       0.810 
 6        2:0        1:1   +   0.864 
 7        2:0        1:1   +   0.845 
 8        2:0        1:1   +   0.722 

Also, is there any way to generate the binary SMO output in Java? E.g.:

  • 1 * <0.307692 0.588235 0 0.333333 > * X]
  • 1 * <0.461538 0.529412 0.5 0 > * X]
  • 1 * <0.384615 0.588235 0.25 0.333333 > * X]
  • 1 * <0.230769 0.705882 0.25 0.666667 > * X]
  • 1 * <0.615385 0.764706 0.25 0.333333 > * X]

Thanks in advance.

4

1 回答 1

0

肯定有一种方法可以在 Java 程序中使用 Weka API。您只需添加对 weka.jar 文件的引用并建立正确的对象,然后探索 API 以找到必要的方法。看看这里开始使用它。IMO 我会走 API 路线只是因为命令行看起来相当 hackish..

http://weka.wikispaces.com/Use+Weka+in+your+Java+code

于 2013-06-25T12:25:57.833 回答