Search in sources :

Example 11 with BufferedDataTable

use of org.knime.core.node.BufferedDataTable in project knime-core by knime.

the class PMMLRuleEditorNodeModel method execute.

/**
 * {@inheritDoc}
 */
@Override
protected PortObject[] execute(final PortObject[] inData, final ExecutionContext exec) throws Exception {
    final BufferedDataTable table = (BufferedDataTable) inData[0];
    RearrangerAndPMMLModel m = createRearrangerAndPMMLModel(table.getDataTableSpec());
    return new PortObject[] { exec.createColumnRearrangeTable(table, m.getRearranger(), exec), m.getPMMLPortObject() };
}
Also used : BufferedDataTable(org.knime.core.node.BufferedDataTable) PortObject(org.knime.core.node.port.PortObject) PMMLPortObject(org.knime.core.node.port.pmml.PMMLPortObject)

Example 12 with BufferedDataTable

use of org.knime.core.node.BufferedDataTable in project knime-core by knime.

the class PairedTTestStatistics method getTTestTable.

/**
 * Get the test result of the t-test.
 * @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;
}
Also used : DataTableSpec(org.knime.core.data.DataTableSpec) BufferedDataContainer(org.knime.core.node.BufferedDataContainer) BufferedDataTable(org.knime.core.node.BufferedDataTable) DataCell(org.knime.core.data.DataCell) DefaultRow(org.knime.core.data.def.DefaultRow)

Example 13 with BufferedDataTable

use of org.knime.core.node.BufferedDataTable in project knime-core by knime.

the class PairedTTestStatistics method getDescStatsTable.

/**
 * Get descriptive statistics
 * @param exec the execution context
 * @return the descriptive statistics for each column of the pair
 */
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;
}
Also used : DataTableSpec(org.knime.core.data.DataTableSpec) BufferedDataContainer(org.knime.core.node.BufferedDataContainer) BufferedDataTable(org.knime.core.node.BufferedDataTable) DataCell(org.knime.core.data.DataCell) DefaultRow(org.knime.core.data.def.DefaultRow)

Example 14 with BufferedDataTable

use of org.knime.core.node.BufferedDataTable in project knime-core by knime.

the class TwoSampleTTestStatistics 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;
}
Also used : DataTableSpec(org.knime.core.data.DataTableSpec) BufferedDataContainer(org.knime.core.node.BufferedDataContainer) BufferedDataTable(org.knime.core.node.BufferedDataTable) DataCell(org.knime.core.data.DataCell) DefaultRow(org.knime.core.data.def.DefaultRow)

Example 15 with BufferedDataTable

use of org.knime.core.node.BufferedDataTable in project knime-core by knime.

the class TwoSampleTTestStatistics method getGroupTable.

/**
 * Get descriptive statistics.
 * @param exec the execution context
 * @return the descriptive statistics for each group
 */
public BufferedDataTable getGroupTable(final ExecutionContext exec) {
    DataTableSpec outSpec = getGroupStatisticsSpec();
    BufferedDataContainer cont = exec.createDataContainer(outSpec);
    int r = 0;
    for (List<DataCell> cells : getGroupStatisticsCells()) {
        cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
        r++;
    }
    cont.close();
    BufferedDataTable outTable = cont.getTable();
    return outTable;
}
Also used : DataTableSpec(org.knime.core.data.DataTableSpec) BufferedDataContainer(org.knime.core.node.BufferedDataContainer) BufferedDataTable(org.knime.core.node.BufferedDataTable) DataCell(org.knime.core.data.DataCell) DefaultRow(org.knime.core.data.def.DefaultRow)

Aggregations

BufferedDataTable (org.knime.core.node.BufferedDataTable)460 DataTableSpec (org.knime.core.data.DataTableSpec)221 ColumnRearranger (org.knime.core.data.container.ColumnRearranger)148 DataRow (org.knime.core.data.DataRow)130 BufferedDataContainer (org.knime.core.node.BufferedDataContainer)104 PortObject (org.knime.core.node.port.PortObject)102 DataCell (org.knime.core.data.DataCell)93 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)66 DataColumnSpec (org.knime.core.data.DataColumnSpec)65 DefaultRow (org.knime.core.data.def.DefaultRow)63 RowKey (org.knime.core.data.RowKey)59 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)55 PMMLPortObject (org.knime.core.node.port.pmml.PMMLPortObject)54 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)50 ExecutionContext (org.knime.core.node.ExecutionContext)47 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)44 IOException (java.io.IOException)43 ArrayList (java.util.ArrayList)37 LinkedHashMap (java.util.LinkedHashMap)31 Test (org.junit.Test)30