Search in sources :

Example 11 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class DialogComponentColumnFilter2 method updateModel.

private void updateModel() {
    SettingsModelColumnFilter2 model = (SettingsModelColumnFilter2) getModel();
    DataColumnSpecFilterConfiguration panelConf = model.getFilterConfiguration().clone();
    m_colFilterPanel.saveConfiguration(panelConf);
    model.setFilterConfiguration(panelConf);
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 12 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class LogRegLearnerNodeDialogPane method loadSettingsFrom.

/**
 * {@inheritDoc}
 */
@Override
protected void loadSettingsFrom(final NodeSettingsRO s, final PortObjectSpec[] specs) throws NotConfigurableException {
    final LogRegLearnerSettings settings = new LogRegLearnerSettings();
    m_inSpec = (DataTableSpec) specs[0];
    settings.loadSettingsForDialog(s, m_inSpec);
    final DataColumnSpecFilterConfiguration config = settings.getIncludedColumns();
    m_filterPanel.loadConfiguration(config, m_inSpec);
    String target = settings.getTargetColumn();
    m_selectionPanel.update(m_inSpec, target);
    // m_filterPanel.updateWithNewConfiguration(config); is not enough, we have to reload things as selection update might change the UI
    m_filterPanel.loadConfiguration(config, m_inSpec);
    // must hide the target from filter panel
    // updating m_filterPanel first does not work as the first
    // element in the spec will always be in the exclude list.
    String selected = m_selectionPanel.getSelectedColumn();
    if (null == selected) {
        for (DataColumnSpec colSpec : m_inSpec) {
            if (colSpec.getType().isCompatible(NominalValue.class)) {
                selected = colSpec.getName();
                break;
            }
        }
    }
    if (selected != null) {
        DataColumnSpec colSpec = m_inSpec.getColumnSpec(selected);
        m_filterPanel.hideNames(colSpec);
    }
    updateTargetCategories(settings.getTargetReferenceCategory());
    m_notSortTarget.setSelected(settings.getUseTargetDomainOrder());
    m_notSortIncludes.setSelected(settings.getUseFeatureDomainOrder());
    Solver solver = settings.getSolver();
    m_solverComboBox.setSelectedItem(solver);
    if (solver == Solver.IRLS) {
        setEnabledSGRelated(false);
    }
    m_maxEpochSpinner.setValue(settings.getMaxEpoch());
    m_lazyCalculationCheckBox.setSelected(settings.isPerformLazy());
    m_calcCovMatrixCheckBox.setSelected(settings.isCalcCovMatrix());
    double epsilon = settings.getEpsilon();
    m_epsilonField.setText(Double.toString(epsilon));
    m_learningRateStrategyComboBox.setSelectedItem(settings.getLearningRateStrategy());
    m_initialLearningRateField.setText(Double.toString(settings.getInitialLearningRate()));
    m_priorComboBox.setSelectedItem(settings.getPrior());
    m_priorVarianceSpinner.setValue(settings.getPriorVariance());
    m_inMemoryCheckBox.setSelected(settings.isInMemory());
    Long seed = settings.getSeed();
    toggleSeedComponents();
    m_seedField.setText(Long.toString(seed != null ? seed : System.currentTimeMillis()));
    m_chunkSizeSpinner.setValue(settings.getChunkSize());
    m_chunkSizeSpinner.setEnabled(!settings.isInMemory());
}
Also used : Solver(org.knime.base.node.mine.regression.logistic.learner4.LogRegLearnerSettings.Solver) DataColumnSpec(org.knime.core.data.DataColumnSpec) DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 13 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class ColumnListLoopStartNodeDialog method saveSettingsTo.

/**
 * {@inheritDoc}
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration conf = ColumnListLoopStartNodeModel.createDCSFilterConfiguration();
    m_filterPanel.saveConfiguration(conf);
    conf.saveConfiguration(settings);
    SettingsModelBoolean noColumnsSettings = ColumnListLoopStartNodeModel.createNoColumnsPolicySetings();
    noColumnsSettings.setBooleanValue(m_noColumnsPolicyOneInterationButton.isSelected());
    noColumnsSettings.saveSettingsTo(settings);
}
Also used : SettingsModelBoolean(org.knime.core.node.defaultnodesettings.SettingsModelBoolean) DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 14 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class ColumnListLoopStartNodeDialog method loadSettingsFrom.

/**
 * {@inheritDoc}
 */
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
    DataColumnSpecFilterConfiguration conf = ColumnListLoopStartNodeModel.createDCSFilterConfiguration();
    conf.loadConfigurationInDialog(settings, specs[0]);
    m_filterPanel.loadConfiguration(conf, specs[0]);
    // true means to run one iteration and false that the node should fail
    boolean runOneIter = settings.getBoolean(ColumnListLoopStartNodeModel.CFG_NO_COLUMNS_POLICY, true);
    if (runOneIter) {
        m_noColumnsPolicyOneInterationButton.doClick();
    } else {
        m_noColumnsPolicyFailButton.doClick();
    }
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 15 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class AutoBinnerLearnNodeDialogPane method saveSettingsTo.

/**
 * @param settings write intervals to
 * @throws InvalidSettingsException if a bin name is empty
 * @see NodeDialogPane#saveSettingsTo(NodeSettingsWO)
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration config = AutoBinnerLearnNodeModel.createDCSFilterConfiguration();
    m_filterPanel.saveConfiguration(config);
    m_settings.setFilterConfiguration(config);
    Method method = m_methodFixedNumber.isSelected() ? Method.fixedNumber : Method.sampleQuantiles;
    m_settings.setMethod(method);
    m_settings.setBinCount(((Number) m_numBins.getValue()).intValue());
    m_settings.setEqualityMethod((EqualityMethod) m_equalityMethod.getSelectedItem());
    try {
        List<Double> sampleQuantiles = explode(m_sampleQuantiles.getText());
        double[] sq = normalizeSampleQuantiles(sampleQuantiles);
        m_settings.setSampleQuantiles(sq);
    } catch (NumberFormatException e) {
        throw new InvalidSettingsException("Cannot parse the list of quantiles. Changes are " + "not applied.");
    }
    BinNaming binNaming = null;
    if (m_binNamingNumbered.isSelected()) {
        binNaming = BinNaming.numbered;
    }
    if (m_binNamingEdges.isSelected()) {
        binNaming = BinNaming.edges;
    }
    if (m_binNamingMidpoints.isSelected()) {
        binNaming = BinNaming.midpoints;
    }
    m_settings.setBinNaming(binNaming);
    m_settings.setReplaceColumn(m_replaceColumn.isSelected());
    m_settings.setIntegerBounds(m_integerBounds.isSelected());
    m_settings.setAdvancedFormatting(m_advancedFormatting.isSelected());
    m_settings.setOutputFormat((OutputFormat) m_outputFormat.getSelectedItem());
    m_settings.setPrecision(((Number) m_precision.getValue()).intValue());
    m_settings.setPrecisionMode((PrecisionMode) m_precisionMode.getSelectedItem());
    m_settings.setRoundingMode((RoundingMode) m_roundingMode.getSelectedItem());
    m_settings.saveSettings(settings);
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration) InvalidSettingsException(org.knime.core.node.InvalidSettingsException) EqualityMethod(org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.EqualityMethod) Method(org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.Method) BinNaming(org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.BinNaming)

Aggregations

DataColumnSpecFilterConfiguration (org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)75 DataTableSpec (org.knime.core.data.DataTableSpec)15 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)14 NotConfigurableException (org.knime.core.node.NotConfigurableException)9 ChangeEvent (javax.swing.event.ChangeEvent)4 ChangeListener (javax.swing.event.ChangeListener)4 DataColumnSpec (org.knime.core.data.DataColumnSpec)4 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)4 DatabaseConnectionSettings (org.knime.core.node.port.database.DatabaseConnectionSettings)4 EnforceOption (org.knime.core.node.util.filter.NameFilterConfiguration.EnforceOption)4 DatabaseConnectionPortObjectSpec (org.knime.core.node.port.database.DatabaseConnectionPortObjectSpec)2 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 Solver (org.knime.base.node.mine.regression.logistic.learner4.LogRegLearnerSettings.Solver)1 BinNaming (org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.BinNaming)1 EqualityMethod (org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.EqualityMethod)1 Method (org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.Method)1 DoubleValue (org.knime.core.data.DoubleValue)1 IntValue (org.knime.core.data.IntValue)1