The scikit-learn team published scikit-learn 1.10.0rc1 on 1 December 2026. The release candidate is on PyPI, and the 1.10 changelog contains a feature many people have wanted for years: native categorical feature support in decision trees, random forests and extra trees. No more one-hot encoding just to make a forest accept a city column.

The RC also brings L1 and Elastic-Net penalties for Poisson, Gamma and Tweedie regression, new Newton-based solvers, and automatic metadata routing. This tutorial installs the RC in an isolated environment and walks through the two biggest features with code I ran on 1.10.0rc1. It ends with what to watch for before the final release.

Install the release candidate safely

Release candidates aren’t installed by default. Use a separate virtual environment so your main projects stay on 1.9.x:

python -m venv .venv-skl110
. .venv-skl110/bin/activate
pip install "scikit-learn==1.10.0rc1" pandas
python -c "import sklearn; print(sklearn.__version__)"   # 1.10.0rc1

The latest stable release on PyPI is still 1.9.1, so a plain pip install -U scikit-learn won’t pick up the RC.

1. Categorical features in trees and forests

Until now, RandomForestClassifier and DecisionTreeClassifier only accepted numbers. Category columns had to be one-hot encoded (which creates many sparse columns) or ordinal encoded (which invents an order that doesn’t exist). HistGradientBoosting* had native support, but the classic tree models didn’t.

In 1.10, these estimators accept a categorical_features parameter:

  • tree.DecisionTreeClassifier / DecisionTreeRegressor
  • tree.ExtraTreeClassifier / ExtraTreeRegressor
  • ensemble.RandomForestClassifier / RandomForestRegressor
  • ensemble.ExtraTreesClassifier / ExtraTreesRegressor

The easiest value is "from_dtype", which treats pandas category columns as categorical.

A worked example

Here’s a small, synthetic churn dataset with two categorical columns and one numeric column, plus 10% label noise so it isn’t trivially easy:

import numpy as np
import pandas as pd
import sklearn
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score, train_test_split
from sklearn.tree import DecisionTreeClassifier

print("scikit-learn", sklearn.__version__)

rng = np.random.default_rng(0)
n = 2000
city = rng.choice(["Delhi", "Mumbai", "Pune", "Chennai", "Kolkata"], size=n)
plan = rng.choice(["free", "basic", "pro"], size=n)
tenure = rng.integers(1, 60, size=n)
churn = ((city == "Pune") & (plan == "free")) | (tenure < 6)
churn = churn ^ (rng.random(n) < 0.1)  # 10% label noise

X = pd.DataFrame({
    "city": pd.Categorical(city),
    "plan": pd.Categorical(plan),
    "tenure_months": tenure,
})
y = churn.astype(int)

forest = RandomForestClassifier(
    n_estimators=200, categorical_features="from_dtype", random_state=0
)
print("forest CV accuracy:", cross_val_score(forest, X, y, cv=5).mean().round(3))

tree = DecisionTreeClassifier(
    max_depth=3, categorical_features="from_dtype", random_state=0
).fit(X, y)
print("tree depth:", tree.get_depth(), "leaves:", tree.get_n_leaves())

X_tr, X_te, y_tr, y_te = train_test_split(X, y, random_state=0)
f2 = RandomForestClassifier(
    n_estimators=200, categorical_features="from_dtype", random_state=0
).fit(X_tr, y_tr)
print("holdout accuracy:", round(f2.score(X_te, y_te), 3))

Output on 1.10.0rc1:

scikit-learn 1.10.0rc1
forest CV accuracy: 0.864
tree depth: 3 leaves: 8
holdout accuracy: 0.87

With 10% of labels flipped at random, the best possible accuracy is about 0.90, so the forest is close to the ceiling without any encoding step. The pandas DataFrame with category dtypes goes straight into fit().

One RC quirk I hit: each scoring call printed UserWarning: X does not have valid feature names, but RandomForestClassifier was fitted with feature names, even though I passed a DataFrame every time. Predictions and scores were fine. It’s worth knowing about, and worth reporting if you see it too, since this is exactly what release candidates are for.

Limits to know

From the changelog:

  • Random forests and decision trees support binary classification and single-output regression with up to 256 categories per feature. For decision tree regressors, all criteria except absolute_error are supported.
  • Extra trees support up to 2^24 − 1 categories per feature, including multi-class and multi-output targets, using random hash splits.
  • warm_start isn’t supported together with categorical features in forests.
  • The default for categorical_features stays None for now. "from_dtype" will become the default in 1.13, so set it explicitly today if you rely on either behaviour.

In practice: for a multi-class target with a categorical column, use ExtraTreesClassifier or keep encoding for now. For high-cardinality columns (more than 256 levels) in random forests, group rare levels or use extra trees.

2. Sparse GLMs: L1 and Elastic-Net for count and cost data

PoissonRegressor, GammaRegressor and TweedieRegressor are the right models for counts, claim sizes and other positive, skewed targets. Before 1.10 they only supported an L2 penalty. Now they take an l1_ratio parameter and two new solvers, "newton-cd" and "newton-cd-gram". They build on the existing Newton solver and the fast coordinate-descent code from ElasticNet. The new solvers are also available for LogisticRegression.

With l1_ratio=1.0 you get Lasso-style feature selection:

import numpy as np
from sklearn.linear_model import PoissonRegressor

rng = np.random.default_rng(42)
X = rng.normal(size=(1000, 20))
true_coef = np.zeros(20)
true_coef[:3] = [0.5, -0.3, 0.2]          # only 3 real signals
y = rng.poisson(np.exp(X @ true_coef))

model = PoissonRegressor(
    alpha=0.05, l1_ratio=1.0, solver="newton-cd", max_iter=300
).fit(X, y)

print("non-zero coefficients:", np.flatnonzero(model.coef_))
print("first three:", model.coef_[:3].round(2))
non-zero coefficients: [ 0  1  2 13 14]
first three: [ 0.42 -0.24  0.15]

Of 20 candidate features, the model kept the three true signals plus two weak false positives, and shrank everything else to exactly zero. The first three coefficients are pulled towards zero compared with the true values, which is normal for L1. Tune alpha with cross-validation for real data.

Which solver should you pick? According to the changelog, "newton-cd-gram" builds the full Hessian (Gram) matrix and is a good choice when n_samples is much larger than n_features. "newton-cd" avoids building the full Hessian and suits cases where n_features is larger than n_samples.

3. Other changes worth a look

  • Metadata auto-requests: set_config(enable_metadata_auto_requests=True) lets estimators, scorers and CV splitters automatically request common metadata like sample_weight. HistGradientBoosting* auto-requests X_val, y_val and sample_weight_val.
  • Callbacks can receive routed metadata, and callback.ScoringMonitor can score on a validation set via scoring_val.
  • Array API support grows to LedoitWolf, OAS, LogisticRegressionCV, matthews_corrcoef, coverage_error and more.
  • GradientBoostingClassifier has a faster terminal-node update step. The changelog cites up to 20× faster training for very deep trees.
  • plot_tree and export_graphviz take a fill_colors parameter for custom class colours.
  • The estimator HTML representation is now keyboard-accessible.

How to test your project against the RC

  1. Create a separate environment and install scikit-learn==1.10.0rc1.
  2. Run your test suite and training notebooks, and watch for new warnings.
  3. Try categorical_features="from_dtype" on one model that currently one-hot encodes, and compare accuracy, training time and memory.
  4. Report regressions on the scikit-learn issue tracker before the final release.

Takeaway

scikit-learn 1.10 removes one of the oldest annoyances in classic ML: random forests and decision trees can now use categorical columns directly. Add sparse Poisson, Gamma and Tweedie models, and this is a release worth testing now. Use the RC in an isolated environment, keep production on 1.9.1, and set categorical_features explicitly so the 1.13 default change doesn’t surprise you.