2011-12-16 58 views
3

我得到了矛盾的結果,在我看來應該產生相同的輸出兩種方法。有人能指出這些差異是什麼,因爲我無法理解它:S元過濾分類器和手動過濾分類器給出不同的結果

我正在研究Drexel_Stats.arff。我使用10-fold交叉驗證的1-NN分類器。 沒有任何預處理,這是混淆矩陣獲得:

a b <-- classified as 
14 3 | a = Win 
    5 1 | b = Loss 

爲了讓我用更好的成績:

weka.attributeSelection.InfoGainAttributeEval 
weka.attributeSelection.Ranker -T -1.0 -N 5 

獲得數據集的5種最挑剔的功能。然後我手動擺脫了所有其他功能並重新運行我的1-NN,我得到了這些結果:

a b <-- classified as 
16 1 | a = Win 
    1 5 | b = Loss 

現在,這地方變得混亂(至少對我來說)。我試圖使用元過濾分類器來節省手動丟棄功能的麻煩。以下是我使用(從GUI複製):

weka.classifiers.meta.FilteredClassifier 
-F "weka.filters.supervised.attribute.AttributeSelection 
-E \"weka.attributeSelection.InfoGainAttributeEval \" 
-S \"weka.attributeSelection.Ranker -T -1.0 -N 5\"" 
-W weka.classifiers.lazy.IB1 -D 

我理解爲這是以前操作的自動化,但實際上我得到這個結果的時間是不同的:

a b <-- classified as 
15 2 | a = Win 
    4 2 | b = Loss 

什麼我錯了嗎?

由於

編輯:這裏是WEKA輸出的一部分:

=== Attribute Selection on all input data === 

Search Method: 
    Attribute ranking. 

Attribute Evaluator (supervised, Class (nominal): 39 Outcome): 
    Information Gain Ranking Filter 

Ranked attributes: 
0.828 1 Opponent 
0.469 38 Opp_Steals 
0.42 24 Opp_Field_Goal_Pct 
0.331 15 Def_Rebounds 
0.306 28 Opp_Free_Throws_Made 

Selected attributes: 1,38,24,15,28 : 5 


Header of reduced data: 
@relation 'Basketball_Statistics-weka.filters.unsupervised.attribute.Remove-V-R1,38,24,15,28,39' 

@attribute Opponent {Florida_Gulf_Coast,Vermont,Penn,Rider,Toledo,Saint_Joseph,Fairleigh_Dickinson,Villanova,Syracuse,Temple,George_Mason,Georgia_State,UNC_Wilmington,James_Madison,Hofstra,Old_Dominion,Northeastern,Delaware,VCU,Towson} 
@attribute Opp_Steals numeric 
@attribute Opp_Field_Goal_Pct numeric 
@attribute Def_Rebounds numeric 
@attribute Opp_Free_Throws_Made numeric 
@attribute Outcome {Win,Loss} 

@data 

這些是在交叉驗證的每個摺疊選擇了相同的特徵?根據實例拆分可以選擇不同的功能嗎?

回答

2

您的第一個(「全局」)特徵選擇是使用所有數據點,包括所有標籤,即。它有權訪問您在交叉驗證期間無法訪問的類信息。因此,你的第一個方法是有缺陷的,導致錯誤估計太好。你的第二種方法是正確的。它的性能更差,因爲它很可能不會爲交叉驗證期間的十次運行中的每一次都選擇相同的五個功能。 hth Bernhard

+0

這很有道理。儘管如此,WEKA仍然存在一個奇怪之處,請參閱問題中的編輯。 – Renaud 2011-12-17 23:51:15