Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@

## Unreleased

`ModelSpec` has moved to its own package,
[modelmatrix](https://github.com/intro-stat-learning/modelmatrix), which
ISLP now depends on (`modelmatrix>=0.3`).

### Breaking changes

- **`ModelSpec`'s `intercept` defaults to `False`**, as 0.6.0 announced. Pass
`intercept=True` for statsmodels' models (`OLS`, `GLM`, ...) and for
`sklearn_sm` and `sklearn_selected` with them; most scikit-learn
estimators, and glmstar's, fit the intercept themselves. The
`FutureWarning` of 0.6.0 is gone.

### Changes

- `from ISLP.models import ModelSpec` and the other tools that build model
matrices are modelmatrix's, as are `ISLP.models.model_spec`,
`ISLP.models.columns` and `ISLP.transforms`, which now are modelmatrix's
modules, so imports from them keep working. `ISLP.models` also exports
modelmatrix's `wildcard` (R's `.`), `Contrast`, `Ordinal` and its
responses `Surv`, `Binomial`, `Multinomial` and `Outcome`.
- ISLP's tests of `ModelSpec` moved to modelmatrix.

### Bug fixes

- Stepwise selection (`Stepwise`, `min_max`) counts and finds terms among
`ModelSpec.terms_`, the fitted terms, not `terms`: with a `wildcard`, a
single term standing for many, the terms were misaligned.

## 0.6.0 (2026-10-26)

`ModelSpec` was audited before it moves to its own package in ISLP 0.7.
Expand Down
16 changes: 14 additions & 2 deletions ISLP/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,33 @@
This package contains tools to specify, manipulate
and select regression models.

`ModelSpec` and the features of a model are those of the modelmatrix
package, imported here so that `from ISLP.models import ModelSpec`
keeps working.
"""
import numpy as np, pandas as pd
from io import StringIO

from .model_spec import (ModelSpec,
from modelmatrix import (ModelSpec,
Column,
Feature,
Contrast,
Ordinal,
poly,
ns,
bs,
derived_feature,
pca,
contrast,
ordinal,
build_columns)
build_columns,
wildcard,
Wildcard,
Response,
Surv,
Binomial,
Multinomial,
Outcome)
from .strategy import (min_max as min_max_strategy,
Stepwise)
from .generic_selector import FeatureSelector
Expand Down
Loading
Loading