Skip to content

Commit

Permalink
fix: correlation auto passing extra parameters (#1114)
Browse files Browse the repository at this point in the history
* fix: correlation `auto` passing extra parameters

* fix: Remove debugger trace

Co-authored-by: Alexandre Quemy <[email protected]>
  • Loading branch information
2 people authored and portellaa committed Oct 20, 2022
1 parent c2f817d commit 21f4fe6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pandas_profiling/model/correlations.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Auto(Correlation):
@staticmethod
@multimethod
def compute(
config: Settings, df: Sized, summary: dict, n_bins: int
config: Settings, df: Sized, summary: dict
) -> Optional[Sized]:
raise NotImplementedError()

Expand Down
7 changes: 3 additions & 4 deletions src/pandas_profiling/model/pandas/correlations_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,11 @@ def pandas_phik_compute(
return correlation


@Auto.compute.register(Settings, pd.DataFrame, dict, int)
@Auto.compute.register(Settings, pd.DataFrame, dict)
def pandas_auto_compute(
config: Settings,
df: pd.DataFrame,
summary: dict,
n_bins: int = 10,
summary: dict
) -> Optional[pd.DataFrame]:
threshold = config.categorical_maximum_correlation_distinct

Expand All @@ -175,7 +174,7 @@ def pandas_auto_compute(
and value["n_distinct"] <= threshold
]
df_discretized = Discretizer(
DiscretizationType.UNIFORM, n_bins=n_bins
DiscretizationType.UNIFORM, n_bins=config.correlations["auto"].n_bins
).discretize_dataframe(df)
columns_tested = numerical_columns + categorical_columns
correlation_matrix = pd.DataFrame(
Expand Down

0 comments on commit 21f4fe6

Please sign in to comment.