use of org.knime.base.node.preproc.autobinner2.AutoBinnerLearnSettings.BinNaming 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 {
m_settings.setTargetColumn(m_targetCol.getIncludedColumnSet().toArray(new String[0]));
m_settings.setIncludeAll(m_targetCol.isKeepAllSelected());
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);
}
use of org.knime.base.node.preproc.autobinner2.AutoBinnerLearnSettings.BinNaming 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