2014-10-10 42 views
2

我有非常明確的機器學習訓練集(只有字符串屬性)。爲什麼WEKA-TestSets必須具有類屬性?

例如

@relation training_rel 

@attribute class {politics,sports} 
@attribute text string 

@data 
politics,'some text about politics over here' 
... // a lot of other training instances of class politics 
sports,'and now some sports over here' 
... // a lot of other training instances of class sports 

好吧,這是我的訓練集,當然只是一個例子...現在我想建立一個分類器(NaiveBayes)。這工作完全正常。我知道大多數分類器無法處理文本,所以我必須過濾我的數據。我爲此使用了一個StringToWordVector。

我發現的網絡上的所有示例都定義了測試實例也具有類值(http://www.cs.ubc.ca/labs/beta/Projects/autoweka/datasets/) 但是爲什麼?我的意思是我不知道我的文本是屬於政治還是體育,這就是爲什麼我使用分類器來了解這個...我明白錯誤嗎?

回答

1

測試數據集中的標籤用於分類器評估目的。您可以針對訓練數據集訓練模型,並在測試數據集上評估模型性能。沒有標籤,您無法評估測試數據。

在實際使用時間內,您不會知道實際的標籤。因此,讓您的測試數據代表真實數據集非常重要。否則你的評估結果是沒有價值的。

相關問題