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

Decouple df.head() from the Cramer's computation #1179

Open
glemaitre opened this issue Dec 5, 2024 · 3 comments
Open

Decouple df.head() from the Cramer's computation #1179

glemaitre opened this issue Dec 5, 2024 · 3 comments

Comments

@glemaitre
Copy link
Member

I got kind of surprise when I did the following display

import skrub
from sklearn.datasets import fetch_california_housing

skrub.patch_display()
X, y = fetch_california_housing(return_X_y=True, as_frame=True)
X.head()

image

It took some time to understand that the reason was due to the X.head() and that in this case, it was making sense.

I'm wondering if you should avoid computing all the different values when one call X.head() instead of showing the statistics on few line. It can be misleading.

An alternative is to compute the statistics on the full dataset instead even if a user request to check the .head(). However if you call .head() it might be only because you are interested of seeing the couple of first line of the dataframe without checking any other statistics.

@jeromedockes WDYT?

@Vincent-Maladiere
Copy link
Member

How could the TableReport access the full dataframe if you pass .head()?

@glemaitre
Copy link
Member Author

I did not think on how it is implemented. So it seems that the most reasonable solution is to avoid computing some of the statistics when the sample size is really small < 10?

@jeromedockes
Copy link
Member

not computing the associations under a certain sample size makes sense.

or we could also change the conditions under which we show the red "warning". The cramer V is an estimate of an effect size but it does not say anything about significance. by computing it we also get a chi-square statistic and thus a p-value. I wouldn't show the p-value to the user because it is not reliable, as the hypotheses of the test are not verified etc. but I guess we could still rely on it to decide if it is worth calling the user's attention to this pair of columns or not.

also, we may want to implement the bias correction of the cramer v statistic wikipedia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants