Search in sources :

Example 1 with PredictorNodeDialog

use of org.knime.base.node.mine.util.PredictorNodeDialog in project knime-core by knime.

the class SotaPredictorNodeFactory method createNodeDialogPane.

/**
 * {@inheritDoc}
 */
@Override
protected NodeDialogPane createNodeDialogPane() {
    return new PredictorNodeDialog(SotaPredictorNodeModel.createAppendProbabilities()) {

        /**
         * {@inheritDoc}
         */
        @Override
        protected void extractTargetColumn(final PortObjectSpec[] specs) {
            if (specs[0] instanceof SotaPortObjectSpec) {
                final SotaPortObjectSpec sotaSpec = (SotaPortObjectSpec) specs[0];
                final DataColumnSpec classColumnSpec = sotaSpec.getClassColumnSpec();
                setLastTargetColumn(classColumnSpec == null ? new DataColumnSpecCreator("No class", StringCell.TYPE).createSpec() : classColumnSpec);
            } else {
                throw new IllegalArgumentException("Wrong input: " + specs[0].getClass());
            }
        }
    };
}
Also used : DataColumnSpec(org.knime.core.data.DataColumnSpec) DataColumnSpecCreator(org.knime.core.data.DataColumnSpecCreator) SotaPortObjectSpec(org.knime.base.node.mine.sota.SotaPortObjectSpec) PredictorNodeDialog(org.knime.base.node.mine.util.PredictorNodeDialog)

Aggregations

SotaPortObjectSpec (org.knime.base.node.mine.sota.SotaPortObjectSpec)1 PredictorNodeDialog (org.knime.base.node.mine.util.PredictorNodeDialog)1 DataColumnSpec (org.knime.core.data.DataColumnSpec)1 DataColumnSpecCreator (org.knime.core.data.DataColumnSpecCreator)1