java - Wrong ordering of class values in Weka Prediction Distribution -


i added class-attribute of dataset following (same train- , testset):

arraylist<string> nomvalues = new arraylist<>(); nomvalues.add("1"); nomvalues.add("0"); datasetbinary_train.insertattributeat(new attribute("class", nomvalues), datasetbinary_train.numattributes()); 

so assume value 1 @ position 0 , value 0 @ position 1.

thus assume double[] nominalprediction.distribution() have class-probability class "1" @ position 0.

examining classification-result seems vice versa.

one prediction looking this.

nom: 1.0 0.0 1.0 0.6081479321383793 0.3918520678616207

where 1 actual class , 0 predicted class (then weight , next distribution). think higher probability label "0" observed means probability instance labeled "0" shown @ index 0

the evaluation header says

@attribute (...)

@attribute class {1,0}

so until there has right order.

can tell me how attribute-values sorted in evaluation? how ensure right 1 selected?

you're confusing labels label indices (weka uses 0-based indices internally represent labels):

nom: <actual label index> <predicted label index> <weight> <distribution>

the actual label index 1.0 ("0"), predicted index 0.0 ("1"), weight 1.0 , distribution "0.61 0.39". based on distribution, first label gets predicted (0.0 or "1").


Comments