Search in sources :

Example 96 with SettingsModelString

use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.

the class DecisionTreeLearnerNodeModel method validateSettings.

/**
 * This method validates the settings. That is:
 * <ul>
 * <li>The number of the class column must be an integer > 0</li>
 * <li>The positive value <code>DataCell</code> must not be null</li>
 * </ul>
 * {@inheritDoc}
 *
 * @see NodeModel#validateSettings(NodeSettingsRO)
 */
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    SettingsModelString classifyColumn = m_classifyColumn.createCloneWithValidatedValue(settings);
    if (classifyColumn.getStringValue() == null || classifyColumn.getStringValue().equals("")) {
        throw new InvalidSettingsException("Classification column not set.");
    }
    m_averageSplitpoint.validateSettings(settings);
    m_binaryNominalSplitMode.validateSettings(settings);
    m_pruningMethod.validateSettings(settings);
    m_numberRecordsStoredForView.validateSettings(settings);
    // m_pruningConfidenceThreshold.validateSettings(settings);
    m_minNumberRecordsPerNode.validateSettings(settings);
    m_splitQualityMeasureType.validateSettings(settings);
    m_maxNumNominalsForCompleteComputation.validateSettings(settings);
    m_parallelProcessing.validateSettings(settings);
    // added in v2.5.3, bug 3124
    if (settings.containsKey(KEY_FILTER_NOMINAL_VALUES_FROM_PARENT)) {
        m_filterNominalValuesFromParent.validateSettings(settings);
    }
    /* Added with 2.5 to avoid running out of heap space with columns
         * that have too many nominal values. */
    if (settings.containsKey(KEY_SKIP_COLUMNS)) {
        m_skipColumns.validateSettings(settings);
    }
}
Also used : InvalidSettingsException(org.knime.core.node.InvalidSettingsException) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Aggregations

SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)96 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)36 SettingsModelBoolean (org.knime.core.node.defaultnodesettings.SettingsModelBoolean)15 ChangeListener (javax.swing.event.ChangeListener)13 ChangeEvent (javax.swing.event.ChangeEvent)12 IOException (java.io.IOException)7 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)7 DialogComponentString (org.knime.core.node.defaultnodesettings.DialogComponentString)7 Duration (java.time.Duration)5 Period (java.time.Period)5 DateTimeParseException (java.time.format.DateTimeParseException)5 SettingsModelDateTime (org.knime.time.util.SettingsModelDateTime)5 LocalDate (java.time.LocalDate)4 LocalDateTime (java.time.LocalDateTime)4 ZonedDateTime (java.time.ZonedDateTime)4 Temporal (java.time.temporal.Temporal)4 TemporalAmount (java.time.temporal.TemporalAmount)4 DateTimeType (org.knime.time.util.DateTimeType)4 File (java.io.File)3 DateTimeException (java.time.DateTimeException)3