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

enh: For the inspection of linear models, add statistical tests to the coefficients #1386

Open
sylvaincom opened this issue Mar 5, 2025 · 0 comments
Labels
enhancement New feature or request needs-triage This has been recently submitted and needs attention

Comments

@sylvaincom
Copy link
Contributor

sylvaincom commented Mar 5, 2025

Is your feature request related to a problem? Please describe.

For feature importance on linear models, we display the coefficients (see #1339 and the example on the doc). This might not be enough.

Describe the solution you'd like

Add statistical significance

as in R

http://r-statistics.co/Linear-Regression.html

summary(linearMod)  # model summary
#> Call:
#> lm(formula = dist ~ speed, data = cars)
#> 
#> Residuals:
#>     Min      1Q  Median      3Q     Max 
#> -29.069  -9.525  -2.272   9.215  43.201 
#> 
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)    
#> (Intercept) -17.5791     6.7584  -2.601   0.0123 *  
#> speed         3.9324     0.4155   9.464 1.49e-12 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 15.38 on 48 degrees of freedom
#> Multiple R-squared:  0.6511, Adjusted R-squared:  0.6438 
#> F-statistic: 89.57 on 1 and 48 DF,  p-value: 1.49e-12

as in Python, statsmodels

I do not believe scikit-learn does it.
In the the statsmodels package, there are statistical tests associated with each coefficient:

https://www.statsmodels.org/stable/regression.html

Image

Describe alternatives you've considered, if relevant

This is P2. If we show so many statistical tests, we would need to explain our users what each test does, which might not be desirable. Maybe just show the stars associated to the significance of a feature?

Additional context

No response

@sylvaincom sylvaincom added enhancement New feature or request needs-triage This has been recently submitted and needs attention labels Mar 5, 2025
@sylvaincom sylvaincom changed the title E enh: For the inspection of linear models, add statistical tests to the coefficients Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage This has been recently submitted and needs attention
Projects
None yet
Development

No branches or pull requests

1 participant