use of org.knime.core.data.DataTableSpec 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.data.DataTableSpec 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 };
}
use of org.knime.core.data.DataTableSpec in project knime-core by knime.
the class OneWayANOVAStatistics 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 OneSampleTTestStatistics 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 OneSampleTTestStatistics method getDescStatsTable.
/**
* Get descriptive statistics
* @param exec
* @return the descriptive statistics for each column test column
*/
public BufferedDataTable getDescStatsTable(final ExecutionContext exec) {
DataTableSpec outSpec = getDescStatsSpec();
BufferedDataContainer cont = exec.createDataContainer(outSpec);
int r = 0;
for (List<DataCell> cells : getDescStatsCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
cont.close();
BufferedDataTable outTable = cont.getTable();
return outTable;
}
Aggregations