Overview
Scikit-learn 1.6, released on January 10, 2025, requires Python 3.10+ and improves cross-validation.
Main Features
Python 3.10 minimum
Python 3.9 support is dropped. Using Python 3.10+ enables match/case and union types X | Y in the internal codebase.
python
import sklearn
print(sklearn.__version__) # 1.6.0
# Python 3.10+ required
import sys
print(f'Python {sys.version}')
# Python 3.10.x or higher
Improved cross-validation
Cross-validation strategies are more flexible with better stratification options and improved group support.
python
from sklearn.model_selection import cross_val_score
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import make_classification
X, y = make_classification(n_samples=1000, random_state=42)
clf = RandomForestClassifier(random_state=42)
scores = cross_val_score(clf, X, y, cv=5)
print(f'Accuracy: {scores.mean():.3f} +/- {scores.std():.3f}')
