The modelSelector Package offers a variety of functions for criterion based model selection in python.
The Package supports:
- Various Model Selection Criteria:
- AIC,
- AICc,
- BIC,
- Mallow's Cp.
- Custom Models, as well as interfaces to linear and logistic regression models via
scikit.learn. - Standard selection algorithms, like
- forward,
- (efficient) backward,
- exhaustive, and
- efficient exhaustive.
- Visualization Routines for visualization of results.
From pip via
pip3 install modelSelectoror from GitHub via
git clone <insert repo url here>
pip3 install .Set up a linear regression model for given data (or alternatively use a wrapper around your own model) via
from modelSelector import LinearRegressionModel, AIC
# generate the full model, and fit it to data.
model = LinearRegressionModel('M_1111')
criterion = AIC()
# use any of our algorithms to perform the model selection
result = backward_search(super_model=model,
criterion=criterion,
exclude_before_fitting=True,
data_x=data_x,
data_y=data_y)See the example notebook for further details and an overview over all supported algorithms.
Will be added after publication.
