classification - Does Weka setClassIndex and setAttributeIndices start attribute from different rage? -
i using weka classification. using 2 function, "setclassindex" , "setattributeindices". dataset have 2 attributes, class , 1 more attribute. following instances in database:
@relation sms_test @attribute spamclass {spam,ham} @attribute mes string @data ham,'go until jurong point' ham,'ok lar...' spam,'free entry in 2 wkly'
following part of code.
traindata.setclassindex(0); filter = new stringtowordvector(); filter.setattributeindices("2");
this code running fine. when set, train.setclassindex ("1") or filter.setattributeindices("1") , code stops running. setclassindex function take argument starting 0 , setattributeindices takes argument starting 1? how identify weka function starts counting 0 or 1?
do setclassindex function take argument starting 0
yes, index starts 0.
and setattributeindices takes argument starting 1?
yes, indices start 1
Comments
Post a Comment