Quantcast

using NumericToNominal filtter

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

using NumericToNominal filtter

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

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[0]="-R";
   options[1]=class_index;//where class index is 183 and i dont want to put a specific number in my code

        convert.setOptions(options);
        convert.setInputFormat(instances);

        instances=Filter.useFilter(instances, convert);

     
        System.out.println("After\n");    
        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
Loading...