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 vascoalramos committed Oct 21, 2022
1 parent 53b10f8 commit 48b7bef
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 48b7bef

Please sign in to comment.