use of org.knime.core.node.BufferedDataTable in project knime-core by knime.
the class StringToDateTimeNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inData, final ExecutionContext exec) throws Exception {
final ColumnRearranger columnRearranger = createColumnRearranger(inData[0].getDataTableSpec());
final BufferedDataTable out = exec.createColumnRearrangeTable(inData[0], columnRearranger, exec);
if (m_failCounter > 0) {
setWarningMessage(m_failCounter + " rows could not be converted. Check the message in the missing cells for details.");
}
return new BufferedDataTable[] { out };
}
use of org.knime.core.node.BufferedDataTable in project knime-core by knime.
the class StringToDurationPeriodNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inData, final ExecutionContext exec) throws Exception {
final BufferedDataTable in = inData[0];
if (m_type.getStringValue().equals(OutputType.Automatic.name())) {
DataTableRowInput rowInput = new DataTableRowInput(in);
try {
detectTypes(rowInput);
} finally {
rowInput.close();
}
// no more rows to look at, guess that column is Period, if it was not detected
for (int i = 0; i < m_detectedTypes.length; i++) {
if (m_detectedTypes[i] == null) {
m_detectedTypes[i] = PeriodCellFactory.TYPE;
}
}
}
final ColumnRearranger r = createColumnRearranger(in.getDataTableSpec());
final BufferedDataTable out = exec.createColumnRearrangeTable(in, r, exec);
if (m_failCounter > 0) {
setWarningMessage(m_failCounter + " rows could not be converted. Check the message in the missing cells for details.");
}
return new BufferedDataTable[] { out };
}
use of org.knime.core.node.BufferedDataTable 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.node.BufferedDataTable 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.node.BufferedDataTable in project knime-core by knime.
the class StandCronbachNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected PortObject[] execute(final PortObject[] inData, final ExecutionContext exec) throws Exception {
PMCCPortObjectAndSpec model = (PMCCPortObjectAndSpec) inData[0];
HalfDoubleMatrix mat = model.getCorrelationMatrix();
double sum = 0;
double count = 0;
for (int i = 0; i < mat.getRowCount(); i++) {
for (int j = i + 1; j < mat.getRowCount(); j++) {
if (Double.isNaN(mat.get(i, j))) {
throw new IOException("No NAN values supported for the calculation, " + "try using an alternative correlation meassure");
}
sum += mat.get(i, j);
count++;
}
}
double mean = sum / count;
double cronbach = (mat.getRowCount() * mean) / (1 + (mat.getRowCount() - 1) * mean);
BufferedDataContainer out = exec.createDataContainer(getDataTableSpec());
RowKey k = new RowKey("Cronbach");
DataRow r = new DefaultRow(k, new DoubleCell(cronbach));
out.addRowToTable(r);
out.close();
return new BufferedDataTable[] { out.getTable() };
}
Aggregations