use of org.knime.core.node.util.filter.NameFilterConfiguration.FilterResult in project knime-core by knime.
the class RankCorrelationComputeNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected PortObjectSpec[] configure(final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
DataTableSpec in = (DataTableSpec) inSpecs[0];
final String[] includes;
if (m_columnFilterModel == null) {
m_columnFilterModel = createColumnFilterModel();
// auto-configure, no previous configuration
m_columnFilterModel.loadDefaults(in);
includes = m_columnFilterModel.applyTo(in).getIncludes();
setWarningMessage("Auto configuration: Using all suitable columns (in total " + includes.length + ")");
} else {
FilterResult applyTo = m_columnFilterModel.applyTo(in);
includes = applyTo.getIncludes();
}
if (includes.length == 0) {
throw new InvalidSettingsException("No columns selected");
}
return new PortObjectSpec[] { PMCCPortObjectAndSpec.createOutSpec(includes), new PMCCPortObjectAndSpec(includes), null };
}
use of org.knime.core.node.util.filter.NameFilterConfiguration.FilterResult in project knime-core by knime.
the class CronbachNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected PortObjectSpec[] configure(final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
DataTableSpec in = (DataTableSpec) inSpecs[0];
if (!in.containsCompatibleType(DoubleValue.class)) {
throw new InvalidSettingsException("No double compatible columns in input");
}
final String[] includes;
if (m_columnFilterModel == null) {
m_columnFilterModel = createColumnFilterModel();
// auto-configure, no previous configuration
m_columnFilterModel.loadDefaults(in);
includes = m_columnFilterModel.applyTo(in).getIncludes();
setWarningMessage("Auto configuration: Using all suitable columns (in total " + includes.length + ")");
} else {
FilterResult applyTo = m_columnFilterModel.applyTo(in);
includes = applyTo.getIncludes();
}
if (includes.length == 0) {
throw new InvalidSettingsException("Please include at least two numerical columns!");
}
return new PortObjectSpec[] { getDataTableSpec() };
}
use of org.knime.core.node.util.filter.NameFilterConfiguration.FilterResult in project knime-core by knime.
the class OneWayANOVANodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) throws InvalidSettingsException {
DataTableSpec spec = inSpecs[0];
if (m_settings.getGroupingColumn() == null || !spec.containsName(m_settings.getGroupingColumn())) {
throw new InvalidSettingsException("Please define a grouping column.");
}
FilterResult filterResult = m_settings.getTestColumns().applyTo(spec);
if (filterResult.getIncludes().length == 0) {
if (filterResult.getExcludes().length > 0) {
throw new InvalidSettingsException("Please select at least " + "one test column.");
} else {
throw new InvalidSettingsException("There are no numeric columns " + "in the input table. At least one numeric column " + "is needed to perform the test.");
}
}
if (m_settings.getConfidenceIntervalProb() > 0.99 || m_settings.getConfidenceIntervalProb() < 0.01) {
throw new InvalidSettingsException("The property " + "\"Confidence Interval (in %)\" must be in the range " + "[1, 99].");
}
return new DataTableSpec[] { OneWayANOVAStatistics.getTableSpec(), LeveneTestStatistics.getTableSpec(), OneWayANOVAStatistics.getGroupStatisticsSpec() };
}
use of org.knime.core.node.util.filter.NameFilterConfiguration.FilterResult in project knime-core by knime.
the class OneSampleTTestNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) throws InvalidSettingsException {
DataTableSpec spec = inSpecs[0];
FilterResult filterResult = m_settings.getTestColumns().applyTo(spec);
if (filterResult.getIncludes().length == 0) {
if (filterResult.getExcludes().length > 0) {
throw new InvalidSettingsException("Please select at least " + "one test column.");
} else {
throw new InvalidSettingsException("There are no numeric columns " + "in the input table. At least one numeric column " + "is needed to perform the test.");
}
}
if (m_settings.getConfidenceIntervalProb() > 0.99 || m_settings.getConfidenceIntervalProb() < 0.01) {
throw new InvalidSettingsException("The property " + "\"Confidence Interval (in %)\" must be in the range " + "[1, 99].");
}
return new DataTableSpec[] { OneSampleTTestStatistics.getTableSpec(), OneSampleTTestStatistics.getDescStatsSpec() };
}
use of org.knime.core.node.util.filter.NameFilterConfiguration.FilterResult in project knime-core by knime.
the class OneSampleTTestNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inData, final ExecutionContext exec) throws Exception {
DataTableSpec spec = inData[0].getSpec();
FilterResult filter = m_settings.getTestColumns().applyTo(spec);
OneSampleTTest test = new OneSampleTTest(filter.getIncludes(), m_settings.getTestValue(), m_settings.getConfidenceIntervalProb());
OneSampleTTestStatistics[] result = test.execute(inData[0], exec);
m_descStats = getDescriptiveStatisticsTable(result, exec);
m_stats = getTestStatisticsTable(result, exec);
return new BufferedDataTable[] { m_stats, m_descStats };
}
Aggregations