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);
}
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());
}
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);
}
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();
}
}
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);
}
Aggregations