use of org.knime.core.node.util.filter.NameFilterConfiguration.EnforceOption in project knime-core by knime.
the class OptionsPanel method newTargetSelected.
/**
* @param item
*/
private void newTargetSelected(final DataColumnSpec item) {
String col = m_targetColumnBox.getSelectedColumn();
if (m_lastTableSpec == null || col == null) {
return;
}
DataTableSpec filtered = getCurrentAttributeSpec();
// Set<String> prevIn = m_includeColumnsFilterPanel.getIncludedColumnSet();
// m_includeColumnsFilterPanel.update(filtered, false, prevIn);
Set<String> prevIn = m_includeColumnsFilterPanel2.getIncludedNamesAsSet();
String[] prevInArray = prevIn.toArray(new String[prevIn.size()]);
Set<String> prevEx = m_includeColumnsFilterPanel2.getExcludedNamesAsSet();
String[] prevExArray = prevEx.toArray(new String[prevEx.size()]);
DataColumnSpecFilterConfiguration conf = TreeEnsembleLearnerConfiguration.createColSpecFilterConfig();
m_includeColumnsFilterPanel2.saveConfiguration(conf);
EnforceOption prevEnforceOption = conf.isEnforceInclusion() ? EnforceOption.EnforceInclusion : EnforceOption.EnforceExclusion;
String[] prevExWithFormerTarget = Arrays.copyOf(prevExArray, prevEx.size() + 1);
prevExWithFormerTarget[prevEx.size()] = getMissingColSpecName(filtered, prevInArray, prevExArray);
conf.loadDefaults(prevInArray, prevExWithFormerTarget, prevEnforceOption);
m_includeColumnsFilterPanel2.loadConfiguration(conf, filtered);
ChangeEvent e = new ChangeEvent(this);
for (ChangeListener l : m_changeListenerList) {
l.stateChanged(e);
}
}
use of org.knime.core.node.util.filter.NameFilterConfiguration.EnforceOption in project knime-core by knime.
the class OptionsPanel method newTargetSelected.
/**
* @param item
*/
private void newTargetSelected(final DataColumnSpec item) {
String col = m_targetColumnBox.getSelectedColumn();
if (m_lastTableSpec == null || col == null) {
return;
}
DataTableSpec filtered = getCurrentAttributeSpec();
// Set<String> prevIn = m_includeColumnsFilterPanel.getIncludedColumnSet();
// m_includeColumnsFilterPanel.update(filtered, false, prevIn);
Set<String> prevIn = m_includeColumnsFilterPanel2.getIncludedNamesAsSet();
String[] prevInArray = prevIn.toArray(new String[prevIn.size()]);
Set<String> prevEx = m_includeColumnsFilterPanel2.getExcludedNamesAsSet();
String[] prevExArray = prevEx.toArray(new String[prevEx.size()]);
DataColumnSpecFilterConfiguration conf = TreeEnsembleLearnerConfiguration.createColSpecFilterConfig();
m_includeColumnsFilterPanel2.saveConfiguration(conf);
EnforceOption prevEnforceOption = conf.isEnforceInclusion() ? EnforceOption.EnforceInclusion : EnforceOption.EnforceExclusion;
String[] prevExWithFormerTarget = Arrays.copyOf(prevExArray, prevEx.size() + 1);
prevExWithFormerTarget[prevEx.size()] = getMissingColSpecName(filtered, prevInArray, prevExArray);
conf.loadDefaults(prevInArray, prevExWithFormerTarget, prevEnforceOption);
m_includeColumnsFilterPanel2.loadConfiguration(conf, filtered);
ChangeEvent e = new ChangeEvent(this);
for (ChangeListener l : m_changeListenerList) {
l.stateChanged(e);
}
}
use of org.knime.core.node.util.filter.NameFilterConfiguration.EnforceOption in project knime-core by knime.
the class OptionsPanel method newTargetSelected.
/**
* @param item
*/
private void newTargetSelected(final DataColumnSpec item) {
String col = m_targetColumnBox.getSelectedColumn();
if (m_lastTableSpec == null || col == null) {
return;
}
DataTableSpec filtered = getCurrentAttributeSpec();
// Set<String> prevIn = m_includeColumnsFilterPanel.getIncludedColumnSet();
// m_includeColumnsFilterPanel.update(filtered, false, prevIn);
Set<String> prevIn = m_includeColumnsFilterPanel2.getIncludedNamesAsSet();
String[] prevInArray = prevIn.toArray(new String[prevIn.size()]);
Set<String> prevEx = m_includeColumnsFilterPanel2.getExcludedNamesAsSet();
String[] prevExArray = prevEx.toArray(new String[prevEx.size()]);
DataColumnSpecFilterConfiguration conf = TreeEnsembleLearnerConfiguration.createColSpecFilterConfig();
m_includeColumnsFilterPanel2.saveConfiguration(conf);
EnforceOption prevEnforceOption = conf.isEnforceInclusion() ? EnforceOption.EnforceInclusion : EnforceOption.EnforceExclusion;
String[] prevExWithFormerTarget = Arrays.copyOf(prevExArray, prevEx.size() + 1);
prevExWithFormerTarget[prevEx.size()] = getMissingColSpecName(filtered, prevInArray, prevExArray);
conf.loadDefaults(prevInArray, prevExWithFormerTarget, prevEnforceOption);
m_includeColumnsFilterPanel2.loadConfiguration(conf, filtered);
ChangeEvent e = new ChangeEvent(this);
for (ChangeListener l : m_changeListenerList) {
l.stateChanged(e);
}
}
use of org.knime.core.node.util.filter.NameFilterConfiguration.EnforceOption in project knime-core by knime.
the class AttributeSelectionPanel method newTargetSelected.
/**
* @param item
*/
private void newTargetSelected(final DataColumnSpec item) {
String col = m_targetColumnBox.getSelectedColumn();
if (m_lastTableSpec == null || col == null) {
return;
}
DataTableSpec filtered = getCurrentAttributeSpec();
// Set<String> prevIn = m_includeColumnsFilterPanel.getIncludedColumnSet();
// m_includeColumnsFilterPanel.update(filtered, false, prevIn);
Set<String> prevIn = m_includeColumnsFilterPanel2.getIncludedNamesAsSet();
String[] prevInArray = prevIn.toArray(new String[prevIn.size()]);
Set<String> prevEx = m_includeColumnsFilterPanel2.getExcludedNamesAsSet();
String[] prevExArray = prevEx.toArray(new String[prevEx.size()]);
DataColumnSpecFilterConfiguration conf = TreeEnsembleLearnerConfiguration.createColSpecFilterConfig();
m_includeColumnsFilterPanel2.saveConfiguration(conf);
EnforceOption prevEnforceOption = conf.isEnforceInclusion() ? EnforceOption.EnforceInclusion : EnforceOption.EnforceExclusion;
String[] prevExWithFormerTarget = Arrays.copyOf(prevExArray, prevEx.size() + 1);
prevExWithFormerTarget[prevEx.size()] = getMissingColSpecName(filtered, prevInArray, prevExArray);
conf.loadDefaults(prevInArray, prevExWithFormerTarget, prevEnforceOption);
m_includeColumnsFilterPanel2.loadConfiguration(conf, filtered);
ChangeEvent e = new ChangeEvent(this);
for (ChangeListener l : m_changeListenerList) {
l.stateChanged(e);
}
}
Aggregations