-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New feature: add information criteria for model diagnostics (#519)
* add the aic & bic computations to the GeneralizedLinearRegressor and GeneralizedLinearRegressorBase classes * update doc string and neaten _compute_information_criteria method * add the reference link * fix the df warning when using ridge regression * update CHANGELOG to include this change, extend the test to look for warnings and remove unnecessary warning * put date in CHANGELOG * slight update to doc string on _set_up_for_info_criteria * Update CHANGELOG.rst Co-authored-by: Luca Bittarello <15511539+lbittarello@users.noreply.github.com> * use the TweedieDistribution in checking the accepted family for aic/bic computation and remove the set_up / tear_down code * fix rendering of the doc string for readthedocs * get the number of observations in a more robust way Co-authored-by: Marc-Antoine Schmidt <marc-antoine.schmidt@quantco.com> * Fix spelling of 'criterion' to plural 'criteria' in docstring Co-authored-by: Luca Bittarello <15511539+lbittarello@users.noreply.github.com> * fix typo in docstring Co-authored-by: Luca Bittarello <15511539+lbittarello@users.noreply.github.com> * fix incorrect space in doc string * fix CHANGELOG.rst to document all changes that are being tracked in current release * calling for aic, bic or aicc before the model has been fit should raise an exception * remove the set up and tear down for info criteria methods as these are unnecessarily complicated * oops. definitely not removing this one * fix silly bug where _info_criteria dictionary was not initialised * restructure the information criteria api so that we pass the data in as arguments to the method * update the doc strings to reflect how degrees of freedom are computed and put warning back in for L2 penalty * we only change the GeneralizedLinearRegressor * put deleted line break back in * add parameters to doc string and make tests more readable * move _num_obs to a more sensible place in _set_up_for_fit * fix that the warnings show correctly and that they don't print out to terminal when running the tests * update to make get_info_criteria private, throw error on None aicc and note that test values are from statsmodels * change the error message slightly to be clearer * explicitly use statsmodels calculations for aic, bic and aicc in test Co-authored-by: Nick Hoernle <nicholas.hoernle@gmail.com> Co-authored-by: Luca Bittarello <15511539+lbittarello@users.noreply.github.com> Co-authored-by: Marc-Antoine Schmidt <marc-antoine.schmidt@quantco.com>
- Loading branch information
1 parent
55d3f08
commit a5c8f15
Showing
3 changed files
with
240 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters