Hi
Is there a function to do feature scoring for regression datasets, where
the class label is a real number rather than the conventional binary
classification scenario?
I tried on a synthetic random dataset but all score values are zero.
Pl help, here is what I tried.
public static void main(String arr[]){
Dataset dataset = new DefaultDataset();
for (int i=1; i<=10; i++){
Instance tmpInstance = InstanceTools.randomInstance(25);
tmpInstance.setClassValue(5);
System.out.println(tmpInstance.value(0)+","+tmpInstance.toString());
dataset.add(tmpInstance);
}
System.out.println("Samples="+dataset.size());
GainRatio ga = new GainRatio();
ga.build(dataset);
System.out.println("Features="+ga.noAttributes());
for (int i = 0; i < ga.noAttributes(); i++)
System.out.println(ga.score(i));
}
Sumit
|