Skip to content

Commit

Permalink
fix: only compute auto correlation when no config is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
jtook authored and aquemy committed Dec 21, 2022
1 parent 460a98b commit d5d4f58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 10 additions & 0 deletions examples/features/correlation_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
# Saving the data profiling report with the 'auto' correlation matrix to a html file
profile.to_file(Path("auto_uci_bank_marketing_report.html"))

# The 'Auto' correlation is also the only correlation computed when no configuration
# file is specified.

profile = ProfileReport(
df,
title="Profile Report of the UCI Bank Marketing Dataset",
)

profile.to_file(Path("auto_no_config_uci_bank_marketing_report.html"))

# The default configuration only computes the 'Auto' correlation.
# To deactivate this setting and instead calculate other types of correlations such as Pearson's
# and Cramer's V we can do the following:
Expand Down
5 changes: 0 additions & 5 deletions src/pandas_profiling/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@ class Config:

correlations: Dict[str, Correlation] = {
"auto": Correlation(key="auto"),
"spearman": Correlation(key="spearman"),
"pearson": Correlation(key="pearson"),
"kendall": Correlation(key="kendall"),
"cramers": Correlation(key="cramers"),
"phi_k": Correlation(key="phi_k"),
}

interactions: Interactions = Interactions()
Expand Down

0 comments on commit d5d4f58

Please sign in to comment.