Search in sources :

Example 1 with CorrelationComputer

use of org.knime.base.node.preproc.correlation.compute.CorrelationComputer in project knime-core by knime.

the class SortedCorrelationComputer method calculateSpearman.

/**
 * Calculates the Spearmans rank for all pairs of Data table columns based on previously calculated ranks.
 * @param exec the Execution context.
 * @return the output matrix to be turned into the output model
 * @throws CanceledExecutionException if canceled by users
 */
protected HalfDoubleMatrix calculateSpearman(final ExecutionContext exec) throws CanceledExecutionException {
    // // the ranking must have been calculated before
    assert (m_rank != null);
    double progStep = 0.5;
    CorrelationComputer calculator = new CorrelationComputer(m_rank.getDataTableSpec(), 0);
    exec.setMessage("Calculating table statistics");
    ExecutionContext execStep1 = exec.createSubExecutionContext(progStep);
    calculator.calculateStatistics(m_rank, execStep1);
    execStep1.setProgress(1.0);
    exec.setMessage("Calculating correlation values");
    ExecutionMonitor execStep2 = exec.createSubExecutionContext(progStep);
    return calculator.calculateOutput(m_rank, execStep2);
}
Also used : ExecutionContext(org.knime.core.node.ExecutionContext) CorrelationComputer(org.knime.base.node.preproc.correlation.compute.CorrelationComputer) ExecutionMonitor(org.knime.core.node.ExecutionMonitor)

Aggregations

CorrelationComputer (org.knime.base.node.preproc.correlation.compute.CorrelationComputer)1 ExecutionContext (org.knime.core.node.ExecutionContext)1 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)1