Corr

class Corr<T, C>(val df: DataFrame<T>, val columns: ColumnsSelector<T, C>)

An intermediate class used in the corr operation.

This class does not perform any computation by itself — it serves as a transitional step before specifying how the correlation should be calculated. It must be followed by one of the computation methods to produce a correlation DataFrame.

The resulting DataFrame is a correlation matrix where rows correspond to one set of columns, columns to the other set, and each cell contains the Pearson correlation coefficient between the respective pair of columns.

Use the following methods to perform the computation:

  • with — selects a second set of columns and computes correlations between the initially selected columns and this second set.

  • withItself — computes pairwise correlations within the initially selected columns.

See Grammar for more details.

Constructors

Link copied to clipboard
constructor(df: DataFrame<T>, columns: ColumnsSelector<T, C>)

Properties

Link copied to clipboard
internal val columns: ColumnsSelector<T, C>
Link copied to clipboard
internal val df: DataFrame<T>

Functions

Link copied to clipboard
internal fun <T, C, R> Corr<T, C>.corrImpl(otherColumns: ColumnsSelector<T, R>): DataFrame<T>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun <T, C, R> Corr<T, C>.with(otherColumns: ColumnsSelector<T, R>): DataFrame<T>
fun <T, C> Corr<T, C>.with(vararg otherColumns: String): DataFrame<T>

Calculates the correlation of specified columns with values in the columns previously selected with corr.

fun <T, C, R> Corr<T, C>.with(vararg otherColumns: KProperty<R>): DataFrame<T>
fun <T, C, R> Corr<T, C>.with(vararg otherColumns: ColumnReference<R>): DataFrame<T>
Link copied to clipboard
fun <T, C> Corr<T, C>.withItself(): DataFrame<T>

Calculates Pearson pairwise correlations between the columns previously selected with corr.