weka.classifiers.rules.ZeroR屬背景值(零規則)學習器,利用多數/平均決原理,提供案例集背景表現值供標竿比較之用。
任何學習器都應該比ZeroR表現(背景值)更好才有存在價值。
ZeroR學習分類時只記錄看過案例中多數類別為何。學習迴歸時只記錄看過案例的平均值為何。
預測時則完全不看案例屬性,任何案例的分類皆預測為記錄的多數類別,任何迴歸皆預測為記錄的平均值。
> java -cp weka.jar;. weka.classifiers.rules.ZeroR -t data\weather.numeric.arff
ZeroR predicts class value: yes
Time taken to build model: 0 seconds
Time taken to test model on training data: 0 seconds
=== Error on training data ===
Correctly Classified Instances 9 64.2857 %
Incorrectly Classified Instances 5 35.7143 %
Kappa statistic 0
Mean absolute error 0.4643
Root mean squared error 0.4795
Relative absolute error 100 %
Root relative squared error 100 %
Total Number of Instances 14
=== Confusion Matrix ===
a b <-- classified as
9 0 | a = yes
5 0 | b = no
=== Stratified cross-validation ===
Correctly Classified Instances 9 64.2857 %
Incorrectly Classified Instances 5 35.7143 %
Kappa statistic 0
Mean absolute error 0.4762
Root mean squared error 0.4934
Relative absolute error 100 %
Root relative squared error 100 %
Total Number of Instances 14
=== Confusion Matrix ===
a b <-- classified as
9 0 | a = yes
5 0 | b = no
如下 weather.numeric.arff 案例集的14個案例有9個yes,5個no。
outlook |
temperature |
humidity |
windy |
play |
sunny |
85 |
85 |
FALSE |
no |
sunny |
80 |
90 |
TRUE |
no |
rainy |
65 |
70 |
TRUE |
no |
sunny |
72 |
95 |
FALSE |
no |
rainy |
71 |
91 |
TRUE |
no |
overcast |
83 |
86 |
FALSE |
yes |
rainy |
70 |
96 |
FALSE |
yes |
rainy |
68 |
80 |
FALSE |
yes |
overcast |
64 |
65 |
TRUE |
yes |
sunny |
69 |
70 |
FALSE |
yes |
rainy |
75 |
80 |
FALSE |
yes |
sunny |
75 |
70 |
TRUE |
yes |
overcast |
72 |
90 |
TRUE |
yes |
overcast |
81 |
75 |
FALSE |
yes |
參考: weka.classifiers.rules.ZeorR
1.
source code
2.
documentation
沒有留言:
張貼留言