Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromedockes authored Dec 7, 2024
1 parent 8826765 commit b48168d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions skrub/_column_associations.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ def column_associations(df):
The result is returned as a dataframe with columns:
`['left_column_name', 'left_column_idx', 'right_column_name',
'right_column_idx', 'cramer_v']`
``['left_column_name', 'left_column_idx', 'right_column_name',
'right_column_idx', 'cramer_v']``
As the function is commutative, each pair of columns appears only once
(either `col_1`, `col_2` or `col_2`, `col_1` but not both). The results are sorted
(either ``col_1``, ``col_2`` or ``col_2``, ``col_1`` but not both).
The results are sorted
from most associated to least associated.
To compute the Cramer's V statistic, all columns are discretized. Numeric
Expand Down Expand Up @@ -229,7 +230,6 @@ def _compute_cramer(table, n_samples):
This returns the symmetric matrix with shape (n cols, n cols) where entry
i, j contains the statistic for column i x column j.
"""
marginal_0 = table.sum(axis=-2)
marginal_1 = table.sum(axis=-1)
Expand Down

0 comments on commit b48168d

Please sign in to comment.