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

add a result summary method #3

Closed
jzluo opened this issue Jul 5, 2022 · 0 comments · Fixed by #6
Closed

add a result summary method #3

jzluo opened this issue Jul 5, 2022 · 0 comments · Fixed by #6
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jzluo
Copy link
Owner

jzluo commented Jul 5, 2022

A summary method to present in a prettier format would be nice. I don't think it needs to be as detailed as the summary in statsmodels. This is what summary in logistf looks like:

                   coef  se(coef) lower 0.95  upper 0.95       Chisq            p method
(Intercept)  0.12025405 0.4763429 -0.8185591  1.07315122  0.06286298 8.020268e-01      2
age         -1.10598131 0.4149021 -1.9737884 -0.30742514  7.50773092 6.143472e-03      2
oc          -0.06881673 0.4344026 -0.9414363  0.78920202  0.02467044 8.751911e-01      2
vic          2.26887464 0.5384872  1.2730216  3.43543273 22.93139022 1.678877e-06      2
vicl        -2.11140817 0.5320395 -3.2608611 -1.11773495 19.10407252 1.237805e-05      2
vis         -0.78831694 0.4089620 -1.6080879  0.01518468  3.69740975 5.449701e-02      2
dia          3.09601166 1.5052197  0.7745682  8.03029352  7.89693139 4.951873e-03      2

Method: 1-Wald, 2-Profile penalized log-likelihood, 3-None

Likelihood ratio test=49.09064 on 6 df, p=7.15089e-09, n=239
Wald test = 31.96835 on 6 df, p = 1.654713e-05

Should be called like:

firth = FirthLogisticRegression()
firth.fit(X, y)
firth.summary()

Maybe an optional var_names parameter in .summary() so that the feature names can be printed in the summary as well, otherwise x0, x1, etc.

Probably the most straightforward way is to just stick everything in a Pandas dataframe and print (and perhaps return?) that. Pretty printing with tabulate can be considered, maybe with tabulate as just an optional dependency?

@jzluo jzluo added enhancement New feature or request good first issue Good for newcomers labels Jul 5, 2022
@jzluo jzluo linked a pull request Jul 28, 2022 that will close this issue
@jzluo jzluo closed this as completed in #6 Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant