2013-03-21 54 views
6

我已經使用Weka 3.7.9將一個隨機森林模型保存到一個文件中,並且現在我正在對其他(非常大的)集合進行評估(在某些大型機器上亞馬遜EC2)。我使用以下命令行:Weka從命令行輸出混淆矩陣

> 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 

我仍然沒有顯示測試數據的混淆矩陣(僅適用於訓練數據)。

+1

沒有'-no-cv',它對我很好。 – 2013-03-23 13:49:09

+0

笨我!你,先生,值得+100的聲望:-)請回答,以便我可以獎勵它。 – 2013-03-23 20:21:48

+0

謝謝,完成:) – 2013-03-23 20:25:12

回答

3

它適用於您省略-no-cv選項。