我有兩個weka Instances
類。我試圖識別與其他屬性名稱相同的屬性。然而,使用:Weka:匹配Attribut名稱
if (testing.attribute(i).name() == training.attribute(j).name())
爲每個屬性產生False
。這裏是每個的arff文件。如您所見,兩者都包含attr1
,attr2
和attr3
。
@relation SampleTrain3Attributes
@attribute attr1 numeric
@attribute attr2 {a,b,c}
@attribute attr3 numeric
@data
1,a,2
3,b,4
5,c,6
7,a,8
@relation SampleTest5Attributes
@attribute attr1 numeric
@attribute attr2 {a,b,c}
@attribute attr3 numeric
@attribute attr4 {d,e,f}
@attribute attr5 numeric
@data
1,a,2,d,3
3,b,4,f,4
5,c,6,e,8
7,a,8,d,9
任何瞭解,將不勝感激。謝謝!
謝謝。我沒有意識到這一點。 – 2013-02-27 17:30:29