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

source: http://weka.sourceforge.net/doc.stable


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -