Package weka.filters

Interface Sourcable

All Known Implementing Classes:
AllFilter, Center, Normalize, ReplaceMissingValues, Standardize

public interface Sourcable
Interface for filters that can be converted to Java source.
$Revision: 8034 $
FracPete (fracpete at waikato dot ac dot nz)
  • Method Summary

    Modifier and Type
    toSource(String className, Instances data)
    Returns a string that describes the filter as source.
  • Method Details

    • toSource

      String toSource(String className, Instances data) throws Exception
      Returns a string that describes the filter as source. The filter will be contained in a class with the given name (there may be auxiliary classes), and will contain two methods with these signatures:
       // converts one row
       public static Object[] filter(Object[] i);
       // converts a full dataset (first dimension is row index)
       public static Object[][] filter(Object[][] i);
      where the array i contains elements that are either Double, String, with missing values represented as null. The generated code is public domain and comes with no warranty.
      className - the name that should be given to the source class.
      data - the dataset used for initializing the filter
      the object source described by a string
      Exception - if the source can't be computed