Does statsmodels compute R2 and other metrics on a validation-/test- set?

Does statsmodels compute R2 and other metrics on a validation set?

I am using the OLS from the statsmodels.api when printing summary, an r2 and r2_asjusted are presented.

I did not trust those 0.88 and computed an own adjusted R2 with scikit-learn r2_score and the adjusted r2 function from this answer resulting in 0.88 as well. So the question arose.

Topic goodness-of-fit r-squared statsmodels scikit-learn

Category Data Science


No.

There's another question over on Stack Overflow concerning wrapping statsmodels models to use the sklearn conventions, so that you can use sklearn cross-validation, hyperparameter searches, etc.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.