Example usage for weka.core Capabilities hasDependency

List of usage examples for weka.core Capabilities hasDependency

Introduction

In this page you can find the example usage for weka.core Capabilities hasDependency.

Prototype

public boolean hasDependency(Capability c) 

Source Link

Document

returns true if the classifier handler has a dependency for the specified capability

Usage

From source file:adams.data.conversion.WekaCapabilitiesToSpreadSheet.java

License:Open Source License

/**
 * Performs the actual conversion./*w w  w  .  ja v  a  2s .  com*/
 *
 * @return      the converted data
 * @throws Exception   if something goes wrong with the conversion
 */
@Override
protected Object doConvert() throws Exception {
    SpreadSheet result;
    Capabilities caps;
    Row row;

    caps = (Capabilities) m_Input;
    result = new DefaultSpreadSheet();
    result.setName(OptionUtils.getCommandLine(caps.getOwner()));

    // header
    row = result.getHeaderRow();
    row.addCell("K").setContent("Capability");
    row.addCell("S").setContent("Supported");
    row.addCell("D").setContent("Dependency");

    // data
    for (Capability cap : Capability.values()) {
        row = result.addRow();
        row.addCell("K").setContentAsString(cap.toString());
        row.addCell("S").setContent(caps.handles(cap));
        row.addCell("D").setContent(caps.hasDependency(cap));
    }
    row = result.addRow();
    row.addCell("K").setContentAsString("Minimum # Instances ");
    row.addCell("S").setContent(caps.getMinimumNumberInstances());

    return result;
}