abess-team / abess

Fast Best-Subset Selection Library
https://abess.readthedocs.io/
Other
474 stars 41 forks source link

[New feature, Python] Support no-intercept model for most GLM models #513

Closed oooo26 closed 1 year ago

oooo26 commented 1 year ago

As issuse #507 and #511 mentioned, we may introduce argument to control whether the intercept is considered or not. If the intercept is dropped, we would assume that the data has been centered.

Note: R package API will need to adapt the additional parameter fit_intercept, see src/api.h.

oooo26 commented 1 year ago

Cox and Ordinal is not supported because:

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (485255f) 97.72% compared to head (19aacef) 97.73%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #513 +/- ## ======================================= Coverage 97.72% 97.73% ======================================= Files 7 7 Lines 969 970 +1 ======================================= + Hits 947 948 +1 Misses 22 22 ``` | Flag | Coverage Δ | | |---|---|---| | Python | `97.73% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=abess-team#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/abess-team/abess/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=abess-team) | Coverage Δ | | |---|---|---| | [python/abess/linear.py](https://app.codecov.io/gh/abess-team/abess/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=abess-team#diff-cHl0aG9uL2FiZXNzL2xpbmVhci5weQ==) | `99.11% <ø> (ø)` | | | [python/abess/bess\_base.py](https://app.codecov.io/gh/abess-team/abess/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=abess-team#diff-cHl0aG9uL2FiZXNzL2Jlc3NfYmFzZS5weQ==) | `98.88% <100.00%> (+<0.01%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Mamba413 commented 1 year ago

I just have one more question:

oooo26 commented 1 year ago

I just have one more question:

  • Does abess can correctly select the effective variables in this case?

I have tested the examples in pytest, and they work just like the model with intercept, even when the data is not centered.

Only Gamma Regression performs not good, and I would test it on the centered data later.

Do u think we should do more simulated data tests to compare the performance?

Mamba413 commented 1 year ago

That's pretty good. Gamma regression is much more difficult. Maybe the data generation mechanism is the main issue (see https://github.com/abess-team/abess/issues/509), we can address this later.

bbayukari commented 1 year ago

R API has been updated in 96ed869f48a0ba954b1ef101616dbf12ae7cbd3a.