精确,召回和正确分类实例



如何计算是、否类的Precision和Recall:

               TP Rate   FP Rate   Precision   Recall  F-Measure   ROC Area  Class
                 0.444     0.8        0.5       0.444     0.471      0.522    yes
                 0.2       0.556      0.167     0.2       0.182      0.522    no
Weighted Avg.    0.357     0.713      0.381     0.357     0.367      0.522

,正确分类实例为35.714%

使用Weka的数据天气

@relation weather
@attribute outlook {sunny, overcast, rainy}
@attribute temperature real 
@attribute humidity real
@attribute windy {TRUE, FALSE}
@attribute play {yes, no}
No.  outlook temperature humidity windy play
1   sunny       85.0    85.0    FALSE   no
2   sunny       80.0    90.0    TRUE    no
3   overcast    83.0    86.0    FALSE   yes
4   rainy       70.0    96.0    FALSE   yes
5   rainy       68.0    80.0    FALSE   yes
6   rainy       65.0    70.0    TRUE    no
7   overcast    64.0    65.0    TRUE    yes
8   sunny       72.0    95.0    FALSE   no
9   sunny       69.0    70.0    FALSE   yes
10  rainy       75.0    80.0    FALSE   yes
11  sunny       75.0    70.0    TRUE    yes
12  overcast    72.0    90.0    TRUE    yes
13  overcast    81.0    75.0    FALSE   yes
14  rainy       71.0    91.0    TRUE    no

===========================

===运行信息===

Scheme:weka.classifiers.rules.PART -M 2 -C 0.25 -Q 1
Relation:     weather
Instances:    14
Attributes:   5
              outlook
              temperature
              humidity
              windy
              play
Test mode:10-fold cross-validation
=== Classifier model (full training set) ===
PART decision list
------------------
outlook = overcast: yes (4.0)
windy = TRUE: no (4.0/1.0)
outlook = sunny: no (3.0/1.0)
: yes (3.0)
Number of Rules  :  4

Time taken to build model: 0 seconds
=== Stratified cross-validation ===
=== Summary ===
Correctly Classified Instances           5               35.7143 %
Incorrectly Classified Instances         9               64.2857 %
Kappa statistic                         -0.3404
Mean absolute error                      0.5518
Root mean squared error                  0.6935
Relative absolute error                115.875  %
Root relative squared error            140.5649 %
Total Number of Instances               14     
=== Detailed Accuracy By Class ===
               TP Rate   FP Rate   Precision   Recall  F-Measure   ROC Area  Class
                 0.444     0.8        0.5       0.444     0.471      0.522    yes
                 0.2       0.556      0.167     0.2       0.182      0.522    no
Weighted Avg.    0.357     0.713      0.381     0.357     0.367      0.522
=== Confusion Matrix ===
 a b   <-- classified as
 4 5 | a = yes
 4 1 | b = no

感谢并致以良好的问候

从混淆矩阵:

=== Confusion Matrix ===
 a b   <-- classified as
 4 5 | a = yes
 4 1 | b = no

Precision计算为4/8,即正确分类的a的数量(yes)除以预测的a的数量;Recall计算为4/9,即正确分类的a的数量(yes)除以真实的a的总数。另一个类的精度和召回率是相反的。

在一张小抄中查看所有这些标准的定义

最新更新