using NumericToNominal filtter

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

using NumericToNominal filtter

This post has NOT been accepted by the mailing list yet.

I used NumericToNominal to convert the class label form countinus to be nomanil BY USING WEKA API

used this code :

NumericToNominal convert= new NumericToNominal();
   String class_index=instances.numAttributes() - 1;
   String[] options= new String[2];
   options[1]=class_index;//where class index is 183 and i dont want to put a specific number in my code


        instances=Filter.useFilter(instances, convert);

        System.out.println("Nominal? "+instances.attribute(182).isNominal());

So is there any way to assign to option string has number of attributes or not?

Please any suggestion might help, thanks in advance