From 30fc68d3d6a1825637e97f64816bdcbca09bf3bf Mon Sep 17 00:00:00 2001 From: "andrei.kislitsyn" Date: Mon, 5 May 2025 17:46:23 +0400 Subject: [PATCH 1/5] Corr docs init --- .../jetbrains/kotlinx/dataframe/api/corr.kt | 98 +++++++++++++++++++ .../documentation/DocumentationUrls.kt | 3 + 2 files changed, 101 insertions(+) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt index 754a93c76e..beb4ebd0b6 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt @@ -1,19 +1,117 @@ package org.jetbrains.kotlinx.dataframe.api +import kotlinx.datetime.Instant +import kotlinx.datetime.LocalDate +import kotlinx.datetime.LocalDateTime +import kotlinx.datetime.LocalTime import org.jetbrains.kotlinx.dataframe.AnyCol import org.jetbrains.kotlinx.dataframe.ColumnsSelector import org.jetbrains.kotlinx.dataframe.DataFrame +import org.jetbrains.kotlinx.dataframe.RowColumnExpression +import org.jetbrains.kotlinx.dataframe.RowValueExpression import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.toColumnSet +import org.jetbrains.kotlinx.dataframe.dataTypes.IFRAME +import org.jetbrains.kotlinx.dataframe.dataTypes.IMG +import org.jetbrains.kotlinx.dataframe.documentation.DocumentationUrls +import org.jetbrains.kotlinx.dataframe.documentation.DocumentationUrls.Convert +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarLink +import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak +import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns +import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.ColumnGroupsAndNestedColumnsMention import org.jetbrains.kotlinx.dataframe.impl.api.corrImpl +import java.math.BigDecimal +import java.math.BigInteger +import java.net.URL import kotlin.reflect.KProperty +import kotlin.reflect.KType import kotlin.reflect.typeOf +/** + * Calculates the correlation between values in the specified [columns\]. + * + * This function does not perform the calculation immediately. Instead, it selects a primary set of columns + * and returns a [Corr] object, which serves as an intermediate step in the correlation analysis. + * + * The [Corr] object provides two methods to perform correlation computations: + * - [with][Corr.with] — allows you to specify a second set of columns and computes correlations between + * the initially selected columns and this second set. + * - [withItself][Corr.withItself] — computes correlations within the initially selected columns. + * + * Each of these methods returns a [DataFrame] where rows correspond to one set of columns, columns to the other set, + * and each cell contains the correlation coefficient between the corresponding pair of columns. + * + * If you need to compute correlations between all columns in a DataFrame, use [DataFrame.corr()][DataFrame.corr]. + * + * Check out [Grammar]. + * + * @include [SelectingColumns.ColumnGroupsAndNestedColumnsMention] + * + * See [Selecting Columns][ConvertSelectingOptions]. + * + * For more information: {@include [DocumentationUrls.Corr]} + */ +internal interface CorrDocs { + + /** + * {@comment Version of [SelectingColumns] with correctly filled in examples} + * @include [SelectingColumns] {@include [SetCorrOperationArg]} + */ + interface ConvertSelectingOptions + + /** + * ## Corr Operation Grammar + * {@include [LineBreak]} + * {@include [DslGrammarLink]} + * {@include [LineBreak]} + * + * **[`corr`][convert]**` { columnsSelector: `[`ColumnsSelector`][ColumnsSelector]` }` + * + * {@include [Indent]} + * __`.`__[**`with`**][Corr.with]` { columnsSelector: `[`ColumnsSelector`][ColumnsSelector]` }` + * + * {@include [Indent]} + *`| `__`.`__[**`withItself`**][Corr.withItself]`()` + */ + interface Grammar +} + +/** {@set [SelectingColumns.OPERATION] [corr][corr]} */ +@ExcludeFromSources +private interface SetCorrOperationArg + +/** + * {@include [CorrDocs]} + * ### This Corr Overload + */ +@ExcludeFromSources +private interface CommonCorrDocs + internal fun AnyCol.isSuitableForCorr() = isSubtypeOf() || type() == typeOf() // region DataFrame +/** + * An intermediate class used in the [corr] operation. + * + * This class itself does not perform any computations — it is a transitional step + * before specifying how to compute correlation. + * It must be followed by one of the methods specifying correlation + * computation to produce a new correlation [DataFrame]. + * + * Each of these methods returns a [DataFrame] where rows correspond to one set of columns, columns to the other set, + * and each cell contains the correlation coefficient between the corresponding pair of columns. + * + * Use the following methods to perform the computation: + * - [with { columnsSelector }][with] – selects a second set of columns and computes correlations between + * the initially selected columns and this second set. + * - [withItself()][withItself] - computes correlations within the initially selected columns. + * + * See [Grammar][CorrDocs.Grammar] for more details. + */ public data class Corr(internal val df: DataFrame, internal val columns: ColumnsSelector) public fun DataFrame.corr(): DataFrame = corr { colsAtAnyDepth { it.isSuitableForCorr() } }.withItself() diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt index 7e800c32ee..57b16b90b2 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt @@ -101,4 +101,7 @@ internal interface DocumentationUrls { /** [See `convert` on the documentation website.]({@include [Url]}/convert.html) */ interface Convert + + /** [See `convert` on the documentation website.]({@include [Url]}/corr.html) */ + interface Corr } From 5b9db55f3727603cef031cdbfa6ce98de6cc6a77 Mon Sep 17 00:00:00 2001 From: "andrei.kislitsyn" Date: Thu, 26 Jun 2025 15:35:57 +0400 Subject: [PATCH 2/5] corr kdocs complete --- .../jetbrains/kotlinx/dataframe/api/corr.kt | 176 ++++++++++++++---- 1 file changed, 142 insertions(+), 34 deletions(-) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt index 5be34caa17..da23ebf9ce 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt @@ -1,59 +1,48 @@ package org.jetbrains.kotlinx.dataframe.api -import kotlinx.datetime.Instant -import kotlinx.datetime.LocalDate -import kotlinx.datetime.LocalDateTime -import kotlinx.datetime.LocalTime import org.jetbrains.kotlinx.dataframe.AnyCol import org.jetbrains.kotlinx.dataframe.ColumnsSelector import org.jetbrains.kotlinx.dataframe.DataFrame -import org.jetbrains.kotlinx.dataframe.RowColumnExpression -import org.jetbrains.kotlinx.dataframe.RowValueExpression import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload +import org.jetbrains.kotlinx.dataframe.api.CorrDocs.Grammar +import org.jetbrains.kotlinx.dataframe.api.CorrDocs.SelectingOptions import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.toColumnSet -import org.jetbrains.kotlinx.dataframe.dataTypes.IFRAME -import org.jetbrains.kotlinx.dataframe.dataTypes.IMG import org.jetbrains.kotlinx.dataframe.documentation.DocumentationUrls -import org.jetbrains.kotlinx.dataframe.documentation.DocumentationUrls.Convert import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarLink import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources import org.jetbrains.kotlinx.dataframe.documentation.Indent import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns -import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.ColumnGroupsAndNestedColumnsMention import org.jetbrains.kotlinx.dataframe.impl.api.corrImpl import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API -import java.math.BigDecimal -import java.math.BigInteger -import java.net.URL import kotlin.reflect.KProperty -import kotlin.reflect.KType import kotlin.reflect.typeOf /** * Calculates the correlation between values in the specified [columns\]. * - * This function does not perform the calculation immediately. Instead, it selects a primary set of columns - * and returns a [Corr] object, which serves as an intermediate step in the correlation analysis. + * This function does not compute the correlation immediately. + * Instead, it defines the primary set of columns + * and returns a [Corr] instance that allows configuring how the correlation should be computed. * - * The [Corr] object provides two methods to perform correlation computations: - * - [with][Corr.with] — allows you to specify a second set of columns and computes correlations between - * the initially selected columns and this second set. - * - [withItself][Corr.withItself] — computes correlations within the initially selected columns. + * The [Corr] object provides two methods to perform correlation calculations: + * - [with][Corr.with] — computes correlations between the initially selected columns and a second set of columns. + * - [withItself][Corr.withItself] — computes pairwise correlations within the initially selected columns. * - * Each of these methods returns a [DataFrame] where rows correspond to one set of columns, columns to the other set, + * Each method returns a square or rectangular correlation matrix represented as a [DataFrame], + * where rows and columns correspond to the selected column sets, * and each cell contains the correlation coefficient between the corresponding pair of columns. * - * If you need to compute correlations between all columns in a DataFrame, use [DataFrame.corr()][DataFrame.corr]. + * To compute correlations between all suitable columns in the [DataFrame], use [DataFrame.corr()][DataFrame.corr]. * * Check out [Grammar]. * * @include [SelectingColumns.ColumnGroupsAndNestedColumnsMention] * - * See [Selecting Columns][ConvertSelectingOptions]. + * See also: [Selecting Columns][SelectingOptions]. * - * For more information: {@include [DocumentationUrls.Corr]} + * For more information, see: {@include [DocumentationUrls.Corr]} */ internal interface CorrDocs { @@ -61,7 +50,7 @@ internal interface CorrDocs { * {@comment Version of [SelectingColumns] with correctly filled in examples} * @include [SelectingColumns] {@include [SetCorrOperationArg]} */ - interface ConvertSelectingOptions + interface SelectingOptions /** * ## Corr Operation Grammar @@ -98,30 +87,76 @@ internal fun AnyCol.isSuitableForCorr() = isSubtypeOf() || type() == typ /** * An intermediate class used in the [corr] operation. * - * This class itself does not perform any computations — it is a transitional step - * before specifying how to compute correlation. - * It must be followed by one of the methods specifying correlation - * computation to produce a new correlation [DataFrame]. + * 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]. * - * Each of these methods returns a [DataFrame] where rows correspond to one set of columns, columns to the other set, - * and each cell contains the correlation coefficient between the corresponding pair of columns. + * 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 correlation coefficient + * between the respective pair of columns. * * Use the following methods to perform the computation: - * - [with { columnsSelector }][with] – selects a second set of columns and computes correlations between - * the initially selected columns and this second set. - * - [withItself()][withItself] - computes correlations within the initially selected columns. + * - [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][CorrDocs.Grammar] for more details. */ public data class Corr(internal val df: DataFrame, internal val columns: ColumnsSelector) +/** + * Computes the correlation matrix between all suitable columns in this [DataFrame], + * including nested columns at any depth. + * + * The result is a square correlation matrix represented as a [DataFrame], + * where both rows and columns correspond to the original columns, + * and each cell contains the correlation coefficient between the respective pair of columns. + * + * Only columns suitable for correlation (e.g., numeric types) are included in the result. + * + * For more information, see: {@include [DocumentationUrls.Corr]} + * + * @return A square correlation matrix as a [DataFrame], where both rows and columns correspond to the original columns. + */ public fun DataFrame.corr(): DataFrame = corr { colsAtAnyDepth().filter { it.isSuitableForCorr() } }.withItself() +/** + * {@include [CommonCorrDocs]} + * @include [SelectingColumns.Dsl] {@include [SetCorrOperationArg]} + * + * ### Examples + * ```kotlin + * // Compute correlations between the "age" column and the "weight" and "height" columns + * df.corr { age }.with { weight and height } + * + * // Compute pairwise correlations between all columns of type `Number` + * df.corr { colsOf() }.withItself() + * ``` + * @param [columns\] The [Columns Selector][ColumnsSelector] used to select the columns + * of this [DataFrame] to compute a correlation. + * @return A [Corr] intermediate object with the selected columns. + */ public fun DataFrame.corr(columns: ColumnsSelector): Corr = Corr(this, columns) +/** + * {@include [CommonCorrDocs]} + * @include [SelectingColumns.ColumnNames] {@include [SetCorrOperationArg]} + * + * ### Examples + * ```kotlin + * // Compute correlations between the "age" column and the "weight" and "height" columns + * df.corr { age }.with { weight and height } + * + * // Compute pairwise correlations between all columns of type `Number` + * df.corr { colsOf() }.withItself() + * ``` + * @param [columns\] The [Column Names][String] used to select the columns + * of this [DataFrame] to compute a correlation. + * @return A [Corr] intermediate object with the selected columns. + */ public fun DataFrame.corr(vararg columns: String): Corr = corr { columns.toColumnSet() } @Deprecated(DEPRECATED_ACCESS_API) @@ -132,8 +167,67 @@ public fun DataFrame.corr(vararg columns: KProperty): Corr = @AccessApiOverload public fun DataFrame.corr(vararg columns: ColumnReference): Corr = corr { columns.toColumnSet() } +/** + * Calculates the correlation of specified [columns][otherColumns] + * with values in the columns previously selected with [corr]. + * + * Returns a correlation matrix represented as a [DataFrame], + * where rows and columns correspond to the selected column sets, + * and each cell contains the correlation coefficient between the corresponding pair of columns. + * + * Check out [Grammar]. + * + * @include [SelectingColumns.ColumnGroupsAndNestedColumnsMention] + * + * See also: [Selecting Columns][SelectingOptions]. + * + * For more information, see: {@include [DocumentationUrls.Corr]} + */ +internal interface CorrWithDocs + +/** + * {@include [CorrWithDocs]} + * ### This Corr With Overload + */ +@ExcludeFromSources +private interface CommonCorrWithDocs + +/** + * {@include [CommonCorrWithDocs]} + * @include [SelectingColumns.Dsl] {@include [SetCorrOperationArg]} + * + * ### Examples + * ```kotlin + * // Compute correlations between the "age" column and the "weight" and "height" columns + * df.corr { age }.with { weight and height } + * + * // Compute correlations between the "speed" column and all columns of type `Double` (excluding itself) + * df.corr { speed }.with { colsOf() except speed } + * ``` + * + * @param otherColumns The [ColumnsSelector] used to select the second set of columns + * from this [DataFrame] to compute correlations against the initially selected columns. + * @return A [DataFrame] containing the resulting correlation matrix. + */ public fun Corr.with(otherColumns: ColumnsSelector): DataFrame = corrImpl(otherColumns) +/** + * {@include [CommonCorrWithDocs]} + * @include [SelectingColumns.ColumnNames] {@include [SetCorrOperationArg]} + * + * ### Examples + * ```kotlin + * // Compute correlations between the "age" column and the "weight" and "height" columns + * df.corr("age").with("weight", "height") + * + * // Compute correlations between the "speed" column and all columns of type `Number` + * df.corr { colsOf() }.with("speed") + * ``` + * + * @param otherColumns The [Column Names][String] used to select the second set of columns + * from this [DataFrame] to compute correlations against the initially selected columns. + * @return A [DataFrame] containing the resulting correlation matrix. + */ public fun Corr.with(vararg otherColumns: String): DataFrame = with { otherColumns.toColumnSet() } @Deprecated(DEPRECATED_ACCESS_API) @@ -146,6 +240,20 @@ public fun Corr.with(vararg otherColumns: KProperty): DataFra public fun Corr.with(vararg otherColumns: ColumnReference): DataFrame = with { otherColumns.toColumnSet() } +/** + * Calculates pairwise correlations between the columns + * previously selected with [corr]. + * + * Returns a square correlation matrix represented as a [DataFrame], + * where both rows and columns correspond to the selected columns, + * and each cell contains the correlation coefficient between the respective pair of columns. + * + * Check out [Grammar]. + * + * For more information, see: {@include [DocumentationUrls.Corr]} + * + * @return A [DataFrame] containing the pairwise correlation matrix. + */ public fun Corr.withItself(): DataFrame = with(columns) // endregion From df16ffd7298b9b34d84b116fe4d323b1c5aa6bf8 Mon Sep 17 00:00:00 2001 From: "andrei.kislitsyn" Date: Fri, 27 Jun 2025 15:31:48 +0400 Subject: [PATCH 3/5] corr docs fixes --- .../jetbrains/kotlinx/dataframe/api/corr.kt | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt index da23ebf9ce..1a31f4913f 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt @@ -16,23 +16,30 @@ import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns import org.jetbrains.kotlinx.dataframe.impl.api.corrImpl import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API +import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import kotlin.reflect.KProperty import kotlin.reflect.typeOf /** - * Calculates the correlation between values in the specified [columns\]. + * Calculates the Pearson pairwise correlation between values in the specified [columns\]. * * This function does not compute the correlation immediately. * Instead, it defines the primary set of columns * and returns a [Corr] instance that allows configuring how the correlation should be computed. * + * The function is available for numeric- and [Boolean] columns. + * [Boolean] values are converted into 1 for true and 0 for false. + * All other columns are ignored. + * If a [ColumnGroup] instance is passed as the target column for correlation, + * it will be unpacked into suitable nested columns. + * * The [Corr] object provides two methods to perform correlation calculations: * - [with][Corr.with] — computes correlations between the initially selected columns and a second set of columns. * - [withItself][Corr.withItself] — computes pairwise correlations within the initially selected columns. * - * Each method returns a square or rectangular correlation matrix represented as a [DataFrame], + * Each method returns a square or rectangular correlation matrix represented by a [DataFrame], * where rows and columns correspond to the selected column sets, - * and each cell contains the correlation coefficient between the corresponding pair of columns. + * and each cell contains the Pearson correlation coefficient between the corresponding pair of columns. * * To compute correlations between all suitable columns in the [DataFrame], use [DataFrame.corr()][DataFrame.corr]. * @@ -92,7 +99,7 @@ internal fun AnyCol.isSuitableForCorr() = isSubtypeOf() || type() == typ * 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 correlation coefficient + * 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: @@ -108,11 +115,13 @@ public data class Corr(internal val df: DataFrame, internal val columns * Computes the correlation matrix between all suitable columns in this [DataFrame], * including nested columns at any depth. * - * The result is a square correlation matrix represented as a [DataFrame], + * The result is a square correlation matrix represented by a [DataFrame], * where both rows and columns correspond to the original columns, - * and each cell contains the correlation coefficient between the respective pair of columns. + * and each cell contains the Pearson correlation coefficient between the respective pair of columns. * - * Only columns suitable for correlation (e.g., numeric types) are included in the result. + * The function is available for numeric- and [Boolean] columns. + * [Boolean] values are converted into 1 for true and 0 for false. + * All other columns are ignored. * * For more information, see: {@include [DocumentationUrls.Corr]} * @@ -127,6 +136,12 @@ public fun DataFrame.corr(): DataFrame = * {@include [CommonCorrDocs]} * @include [SelectingColumns.Dsl] {@include [SetCorrOperationArg]} * + * The function is available for numeric- and [Boolean] columns. + * [Boolean] values are converted into 1 for true and 0 for false. + * All other columns are ignored. + * If a [ColumnGroup] instance is passed as the target column for correlation, + * it will be unpacked into suitable nested columns. + * * ### Examples * ```kotlin * // Compute correlations between the "age" column and the "weight" and "height" columns @@ -145,6 +160,12 @@ public fun DataFrame.corr(columns: ColumnsSelector): Corr * {@include [CommonCorrDocs]} * @include [SelectingColumns.ColumnNames] {@include [SetCorrOperationArg]} * + * The function is available for numeric- and [Boolean] columns. + * [Boolean] values are converted into 1 for true and 0 for false. + * All other columns are ignored. + * If a [ColumnGroup] instance is passed as the target column for correlation, + * it will be unpacked into suitable nested columns. + * * ### Examples * ```kotlin * // Compute correlations between the "age" column and the "weight" and "height" columns @@ -171,9 +192,9 @@ public fun DataFrame.corr(vararg columns: ColumnReference): Corr Corr.with(vararg otherColumns: ColumnReference): D * Calculates pairwise correlations between the columns * previously selected with [corr]. * - * Returns a square correlation matrix represented as a [DataFrame], + * Returns a square correlation matrix represented by a [DataFrame], * where both rows and columns correspond to the selected columns, - * and each cell contains the correlation coefficient between the respective pair of columns. + * and each cell contains the Pearson correlation coefficient between the respective pair of columns. * * Check out [Grammar]. * From 0ad2463d6a5f657af0f627785bd8cbd7f89ef3d9 Mon Sep 17 00:00:00 2001 From: "andrei.kislitsyn" Date: Fri, 27 Jun 2025 17:38:32 +0400 Subject: [PATCH 4/5] corr kdocs Pearson mention --- .../main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt index 1a31f4913f..719ceefbbb 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt @@ -112,7 +112,7 @@ internal fun AnyCol.isSuitableForCorr() = isSubtypeOf() || type() == typ public data class Corr(internal val df: DataFrame, internal val columns: ColumnsSelector) /** - * Computes the correlation matrix between all suitable columns in this [DataFrame], + * Computes the pearson correlation between all suitable columns in this [DataFrame], * including nested columns at any depth. * * The result is a square correlation matrix represented by a [DataFrame], @@ -262,7 +262,7 @@ public fun Corr.with(vararg otherColumns: ColumnReference): D with { otherColumns.toColumnSet() } /** - * Calculates pairwise correlations between the columns + * Calculates Pearson pairwise correlations between the columns * previously selected with [corr]. * * Returns a square correlation matrix represented by a [DataFrame], From a2a093187e533d5d1d153c95300ebda370688fcb Mon Sep 17 00:00:00 2001 From: "andrei.kislitsyn" Date: Fri, 27 Jun 2025 17:39:36 +0400 Subject: [PATCH 5/5] corr kdocs linter --- .../src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt index 719ceefbbb..8c90cd7187 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/corr.kt @@ -6,6 +6,7 @@ import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload import org.jetbrains.kotlinx.dataframe.api.CorrDocs.Grammar import org.jetbrains.kotlinx.dataframe.api.CorrDocs.SelectingOptions +import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.toColumnSet import org.jetbrains.kotlinx.dataframe.documentation.DocumentationUrls @@ -16,7 +17,6 @@ import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns import org.jetbrains.kotlinx.dataframe.impl.api.corrImpl import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API -import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import kotlin.reflect.KProperty import kotlin.reflect.typeOf