Example usage for weka.filters.unsupervised.attribute RemoveUseless setOptions

List of usage examples for weka.filters.unsupervised.attribute RemoveUseless setOptions

Introduction

In this page you can find the example usage for weka.filters.unsupervised.attribute RemoveUseless setOptions.

Prototype

@Override
public void setOptions(String[] options) throws Exception 

Source Link

Document

Parses a given list of options.

Usage

From source file:com.deafgoat.ml.prognosticator.InstancesFilter.java

License:Apache License

/**
 * Applies a filter to remove useless attributes with a variance greater
 * than the specified value//from   w  w  w  .j  a v  a2s  .  com
 * 
 * @param variance
 *            The maximum variance for the attribute
 * @throws Exception
 *             If filter could not be applied
 */
public void removeUselessFilter(String variance) throws Exception {
    if (_logger.isDebugEnabled()) {
        _logger.debug("Applying remove useless filter");
    }
    // Might employ filtered classifier for production
    RemoveUseless ru = new RemoveUseless();
    String[] options = new String[2];
    options[0] = "-M";
    options[1] = variance;
    ru.setOptions(options);
    ru.setInputFormat(_instances);
    _instances = Filter.useFilter(_instances, ru);
}