【问题标题】:Output confusion matrix in Weka from command line从命令行输出 Weka 中的混淆矩阵
【发布时间】:2013-03-21 02:16:35
【问题描述】:

我已经使用 Weka 3.7.9 将一个随机森林模型保存到一个文件中,现在我正在尝试将它与其他(非常大的)集合(在 Amazon EC2 中的一些大型机器上)进行比较。我正在使用以下命令行:

> java -server -Xmx60000m -cp weka.jar weka.classifiers.Evaluation 
weka.classifiers.trees.RandomForest -T test.arff -l random-forest.model
-i -no-cv

但是,我唯一的输出是这样的:

=== Error on test data ===

Correctly Classified Instances     3252532               80.0686 %
Incorrectly Classified Instances    809651               19.9314 %
Kappa statistic                          0.2884
Mean absolute error                      0.2539
Root mean squared error                  0.3608
Coverage of cases (0.95 level)          98.7413 %
Total Number of Instances          4062183

而我正在寻找这样的东西:

=== Detailed Accuracy By Class ===

                 TP Rate  FP Rate  Precision  Recall   F-Measure  MCC      ROC Area  PRC Area  Class
                 0.804    0.295    0.731      0.804    0.766      0.512    0.826     0.803     buyer
                 0.705    0.196    0.783      0.705    0.742      0.512    0.826     0.798     non-buyer
Weighted Avg.    0.755    0.245    0.757      0.755    0.754      0.512    0.826     0.801     

=== Confusion Matrix ===

     a     b   <-- classified as
 61728 15004 |     a = buyer
 22662 54066 |     b = non-buyer

请注意,即使我再次运行完整的训练方法,如下所示:

> java -Xmx60000m -cp weka.jar weka.classifiers.Evaluation 
weka.classifiers.trees.RandomForest -t train.arff -T test.arff 
-I 10 -K 0 -S 1 -num-slots 8 -d random-forest.model -i -no-cv

我仍然没有显示测试数据的混淆矩阵(仅适用于经过训练的数据)。

【问题讨论】:

  • 没有-no-cv 对我来说效果很好。
  • 愚弄我!!先生,您值得 +100 声望 :-) 请回答,以便我奖励它。

标签: weka


【解决方案1】:

当您省略 -no-cv 选项时,它会起作用。

【讨论】:

    猜你喜欢
    • 2014-07-09
    • 1970-01-01
    • 2015-02-14
    • 2013-12-02
    • 2017-02-18
    • 1970-01-01
    • 2018-02-04
    • 2013-02-19
    • 2014-04-02
    相关资源
    最近更新 更多