use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class LogRegLearnerNodeDialogPane method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO s) throws InvalidSettingsException {
final LogRegLearnerSettings settings = new LogRegLearnerSettings();
final DataColumnSpecFilterConfiguration config = LogRegLearnerNodeModel.createDCSFilterConfiguration();
m_filterPanel.saveConfiguration(config);
settings.setIncludedColumns(config);
settings.setTargetColumn(m_selectionPanel.getSelectedColumn());
settings.setTargetReferenceCategory((DataCell) m_targetReferenceCategory.getSelectedItem());
settings.setUseTargetDomainOrder(m_notSortTarget.isSelected());
settings.setUseFeatureDomainOrder(m_notSortIncludes.isSelected());
settings.setSolver((Solver) m_solverComboBox.getSelectedItem());
settings.setMaxEpoch((int) m_maxEpochSpinner.getValue());
settings.setPerformLazy(m_lazyCalculationCheckBox.isSelected());
settings.setCalcCovMatrix(m_calcCovMatrixCheckBox.isSelected());
try {
String str = m_epsilonField.getText();
double epsilon = Double.valueOf(str);
settings.setEpsilon(epsilon);
} catch (NumberFormatException nfe) {
throw new InvalidSettingsException("Please provide a valid value for epsilon.");
}
settings.setLearningRateStrategy((LearningRateStrategies) m_learningRateStrategyComboBox.getSelectedItem());
try {
String str = m_initialLearningRateField.getText();
double lr = Double.valueOf(str);
settings.setInitialLearningRate(lr);
} catch (NumberFormatException nfe) {
throw new InvalidSettingsException("Please provide a valid value for the initial learning rate.");
}
settings.setPrior((Prior) m_priorComboBox.getSelectedItem());
settings.setPriorVariance((double) m_priorVarianceSpinner.getValue());
settings.setInMemory(m_inMemoryCheckBox.isSelected());
Long seed;
if (m_useSeedCheckBox.isSelected()) {
final String seedText = m_seedField.getText();
try {
seed = Long.valueOf(seedText);
} catch (Exception e) {
throw new InvalidSettingsException("Unable to parse seed \"" + seedText + "\"", e);
}
} else {
seed = null;
}
settings.setSeed(seed);
settings.setChunkSize((int) m_chunkSizeSpinner.getValue());
settings.validate();
settings.saveSettings(s);
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class SplitNodeDialog2 method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
DataColumnSpecFilterConfiguration config = SplitNodeModel2.createColFilterConf();
m_filterPanel.saveConfiguration(config);
config.saveConfiguration(settings);
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class SplitNodeDialog2 method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
final DataTableSpec spec = specs[0];
DataColumnSpecFilterConfiguration config = SplitNodeModel2.createColFilterConf();
config.loadConfigurationInDialog(settings, spec);
m_filterPanel.loadConfiguration(config, spec);
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class PolyRegLearnerDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
DataTableSpec dataTableSpec = (DataTableSpec) specs[0];
try {
m_settings.loadSettingsInDialog(settings, dataTableSpec);
} catch (InvalidSettingsException ex) {
LinkedHashSet<String> defSelected = new LinkedHashSet<String>();
for (DataColumnSpec s : dataTableSpec) {
if (s.getType().isCompatible(DoubleValue.class)) {
defSelected.add(s.getName());
}
}
NodeSettings fakeSettings = PolyRegLearnerSettings.createFakeSettings("column filter", defSelected.toArray(new String[0]), new String[0], false);
DataColumnSpecFilterConfiguration conf = new DataColumnSpecFilterConfiguration("column filter");
conf.loadConfigurationInDialog(fakeSettings, dataTableSpec);
m_settings.getFilterConfiguration().loadConfigurationInDialog(fakeSettings, dataTableSpec);
// for the rest: ignore it, defaults are used instead
}
m_targetColumn.update(dataTableSpec, m_settings.getTargetColumn());
m_degree.getModel().setValue(m_settings.getDegree());
m_viewRows.getModel().setValue(m_settings.getMaxRowsForView());
m_colSelectionPanel.loadConfiguration(m_settings.getFilterConfiguration(), dataTableSpec);
m_colSelectionPanel.resetHiding();
m_colSelectionPanel.hideNames((DataColumnSpec) m_targetColumn.getSelectedItem());
m_missingValueHandlingIgnore.setSelected(m_settings.getMissingValueHandling().equals(MissingValueHandling.ignore));
m_missingValueHandlingFail.setSelected(m_settings.getMissingValueHandling().equals(MissingValueHandling.fail));
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class ColumnListLoopStartNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
DataColumnSpecFilterConfiguration config = createDCSFilterConfiguration();
config.loadConfigurationInModel(settings);
}
Aggregations