use of org.knime.core.data.DataTableSpec in project knime-core by knime.
the class OneWayANOVANodeDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
DataTableSpec spec = specs[0];
m_settings.loadSettingsForDialog(settings, spec);
m_testColumns.loadConfiguration(m_settings.getTestColumns(), spec);
m_groupingColumn.update(spec, m_settings.getGroupingColumn());
m_confidenceIntervalProb.setText(Double.toString(m_settings.getConfidenceIntervalProb() * 100.0));
}
use of org.knime.core.data.DataTableSpec 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.data.DataTableSpec in project knime-core by knime.
the class OneWayANOVANodeModel method getGroups.
private List<String> getGroups(final BufferedDataTable inData, final ExecutionMonitor exec) throws InvalidSettingsException, CanceledExecutionException {
DataTableSpec spec = inData.getSpec();
int gIndex = spec.findColumnIndex(m_settings.getGroupingColumn());
LinkedHashSet<String> groups = new LinkedHashSet<String>();
if (gIndex < 0) {
throw new InvalidSettingsException("Grouping column not found.");
}
final int rowCount = inData.getRowCount();
int rowIndex = 0;
for (DataRow row : inData) {
exec.checkCanceled();
exec.setProgress(rowIndex++ / (double) rowCount, rowIndex + "/" + rowCount + " (\"" + row.getKey() + "\")");
DataCell group = row.getCell(gIndex);
if (!group.isMissing()) {
groups.add(group.toString());
}
}
return Arrays.asList(groups.toArray(new String[groups.size()]));
}
use of org.knime.core.data.DataTableSpec in project knime-core by knime.
the class LeveneTestStatistics method getTTestTable.
/**
* Get the test result of the t-test, for the assumption of equal
* variance and the assumption of unequal variances.
* @param exec the execution context
* @return the t-test results
*/
public BufferedDataTable getTTestTable(final ExecutionContext exec) {
DataTableSpec outSpec = getTableSpec();
BufferedDataContainer cont = exec.createDataContainer(outSpec);
int r = 0;
for (List<DataCell> cells : getTTestCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
cont.close();
BufferedDataTable outTable = cont.getTable();
return outTable;
}
use of org.knime.core.data.DataTableSpec in project knime-core by knime.
the class OneSampleTTestNodeDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
DataTableSpec spec = specs[0];
m_settings.loadSettingsForDialog(settings, spec);
m_testColumns.loadConfiguration(m_settings.getTestColumns(), spec);
m_testValue.setText(Double.toString(m_settings.getTestValue()));
m_confidenceIntervalProb.setText(Double.toString(m_settings.getConfidenceIntervalProb() * 100.0));
}
Aggregations