Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correlation auto passing extra parameters #1114

Merged
merged 2 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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