Example usage for weka.core OptionHandler listOptions

List of usage examples for weka.core OptionHandler listOptions

Introduction

In this page you can find the example usage for weka.core OptionHandler listOptions.

Prototype

Enumeration<Option> listOptions();

Source Link

Document

Returns an enumeration of all the available options..

Usage

From source file:com.rapidminer.tools.WekaTools.java

License:Open Source License

/** Add the parameter type for the options of a Weka option handler. */
public static void addParameterTypes(OptionHandler handler, List<ParameterType> types,
        List<ParameterType> wekaParameters, boolean meta, String metaParameter) {
    String[] defaultOptions = removeMetaOptions(handler.getOptions());
    Enumeration options = handler.listOptions();
    while (options.hasMoreElements()) {
        Option option = (Option) options.nextElement();
        if (option.name().trim().length() == 0)
            break; // necessary to prevent adding of parameters of children
                   // of meta learners

        // prevent adding the meta learning scheme options
        if (meta && option.name().trim().toLowerCase().equals(metaParameter.toLowerCase())) {
            continue;
        }//from   w w w . j  a  va 2s.c  om

        ParameterType type = guessParameterType(option, defaultOptions);
        type.setExpert(false); // all Weka paras as non expert paras
        types.add(type);
        wekaParameters.add(type);
    }
}