Overview
Scikit-learn 1.7, released on June 15, 2025, improves the HTML representation of estimators and adds Poisson loss to MLPRegressor.
Main Features
Improved HTML representation
Estimators now display an interactive HTML representation in Jupyter notebooks, making pipeline inspection easier.
python
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
pipe = Pipeline([
('scaler', StandardScaler()),
('svc', SVC()),
])
pipe # HTML representation in Jupyter
MLP with Poisson loss
The MLPRegressor now supports Poisson loss, suitable for count data.
python
from sklearn.neural_network import MLPRegressor
from sklearn.datasets import make_regression
X, y = make_regression(n_samples=500, random_state=42)
y = abs(y) # positive values for Poisson
mlp = MLPRegressor(loss='poisson', max_iter=500)
mlp.fit(X, y)
print(f'Score: {mlp.score(X, y):.3f}')
