Package weka.filters.unsupervised.attribute

Examples of weka.filters.unsupervised.attribute.NominalToString


   */
  public static Instances fromNominalToString(Instances dataset, Object ...columns ){
 
   
    Instances translated_dataset = dataset;
    NominalToString translator = new NominalToString();    // new instance of filter
   
    String col = "";
    for(Object c:columns)
      col += c.toString()+",";
     
      String[] options = new String[2];
      options[0] = "-C";                                    // "range"
      options[1] = col; 
      try
        translator.setOptions(options);                           // set options
        translator.setInputFormat(translated_dataset);             // inform filter about dataset **AFTER** setting options
        translated_dataset = Filter.useFilter(translated_dataset, translator);   // apply filter
        
      }catch(Exception e){
        System.out.println("Exception in filtering the dataset:");
        e.printStackTrace();
View Full Code Here

TOP

Related Classes of weka.filters.unsupervised.attribute.NominalToString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.