azmyrajab / polars_ols

Polars least squares extension - enables fast linear model polar expressions
MIT License
113 stars 10 forks source link

Add rsquared, pvalue, etc to results #31

Closed jackaixin closed 2 months ago

jackaixin commented 2 months ago

Hi @azmyrajab, I’m really a fan of this extension, which speeds up my cross-sectional regression task by more than 10x (i was using statsmodels before). However, I’m wondering if it’s possible to add other metrics that are available in statsmodels’ results. Common metrics include rsquared, rsquared_adj, pvalue, tvalue, fvalue, nobs, etc. Maybe there can be an argument specifying which metrics are needed so users can pick only the ones required in order not to sacrifice performance.

I would really appreciate your help!

azmyrajab commented 2 months ago

Hi @jackaixin - glad the library has been helpful for you. Had a go at this, supporting a majority of what you have requested above (and made it easy to add in more items, if you ever need to and are up for contributing)

See: https://github.com/azmyrajab/polars_ols/issues/20#issuecomment-2308885533

jackaixin commented 2 months ago

Thanks a lot @azmyrajab for the quick turnaround. I probably should pick up rust and contribute more!