ethanweed / pythonbook

Python adaptation of Danielle Navarro's Learning Statistics with R (http://learningstatisticswithr.com/). Work in progress!
100 stars 34 forks source link

Similifcation for AIC and BIC getters in 05.04-regression.html #38

Open ivanistheone opened 2 months ago

ivanistheone commented 2 months ago

In the Linear regression model checking sections, the functions get_aic and get_aic_bic are not necessary.

The text processing used to extract the AIC value model.fit().summary().tables[0].as_text().split('\n')[7].split('AIC:')[1].strip() can be replace with model.fit().aic.

Similarly, the BIC is available under the .bic attribute: model.fit().bic.