← ব্লগে ফিরে যান

Scikit-learn 1.9 Ships Callbacks and GPU Boost on June 12

Scikit-learn 1.9, released June 12, 2026, introduces a real-time callback API and expanded GPU support, deepening its integration with the Hugging Face ML ecosystem.

শেয়ার: XFacebookLinkedInWhatsApp
Desliza para seguir leyendo

Scikit-learn 1.9 Released June 12, 2026: A Major Leap for Classical ML Engineering

The scikit-learn core team shipped version 1.9.0 on June 12, 2026, marking one of the library's most feature-rich releases in recent memory. The update lands at a critical moment for the machine learning ecosystem: as large language models continue to dominate headlines, scikit-learn's maintainers have doubled down on what the library does best — fast, interpretable, production-grade classical machine learning — while simultaneously modernizing its interface for the next generation of ML tooling. The release is available on PyPI and compatible with Python 3.11 through 3.14.

For engineers who build ML pipelines on structured, tabular data — the bread-and-butter of enterprise ML — scikit-learn 1.9 delivers a cascade of improvements: a brand-new experimental callback system for training monitoring, expanded GPU acceleration through the Array API, a lighter-weight dataframe compatibility layer via narwhals, and a significantly richer HTML estimator visualization. These changes collectively address long-standing friction points for practitioners who deploy sklearn models at scale.

The release also arrives against the backdrop of an active partnership with Hugging Face, the AI platform that has grown into the central hub of the open-source ML community. While version 1.9 does not ship with new Hugging Face-specific integration code, the two organizations have spent the past four years building a shared infrastructure — most notably through the skops library — that now hosts nearly 800 scikit-learn models on the Hugging Face Hub. Together, the 1.9 release and the maturing sklearn–Hugging Face pipeline represent a pivotal moment for classical ML in the age of foundation models.

The Callback API: Real-Time Training Monitoring Comes to Scikit-learn

The single most impactful addition in version 1.9 is the experimental callback mechanism, a long-requested feature that introduces real-time monitoring and progress visibility into the training loop of scikit-learn estimators. Until now, ML engineers using sklearn had no native way to observe a model fitting in progress — no progress bars, no live loss curves, no early stopping hooks. That gap forced teams to rely on workarounds such as verbose logging flags or external libraries. Version 1.9 closes it definitively.

The callback system introduces two concrete implementations out of the box:

  • sklearn.callback.ProgressBar — renders a live progress bar during fit(), giving engineers a real-time view of how far along training has progressed without leaving the notebook or terminal
  • sklearn.callback.ScoringMonitor — logs scoring metrics at each iteration of the optimization loop, enabling convergence tracking without external tooling or custom boilerplate

In version 1.9, the callback system is supported by a targeted but meaningful set of estimators: LogisticRegression (using the lbfgs solver), the full SearchCV family (GridSearchCV, RandomizedSearchCV, HalvingGridSearchCV, and HalvingRandomSearchCV), Pipeline, and StandardScaler. The maintainers have explicitly signaled that this is a foundation, not a ceiling — the release blog post describes the callback mechanism as one that "opens the door to progress bars or advanced monitoring of convergence," with broader estimator coverage planned for subsequent releases.

The significance of this feature extends beyond user experience. For teams integrating scikit-learn into larger MLOps pipelines — where monitoring, alerting, and auditability are non-negotiable requirements — the callback API provides a programmatic hook that can feed into logging infrastructure, dashboards, or experiment trackers such as MLflow and Weights & Biases. It signals that the scikit-learn team is thinking seriously about the operational context in which their library is used, not just the statistical correctness of its algorithms.

"The callback mechanism opens the door to progress bars or advanced monitoring of convergence," — scikit-learn 1.9 release announcement, June 2026

Looking forward, the experimental status of the callback API means the interface may evolve before stabilization. Engineers building production systems on top of it should treat the API surface as subject to change through versions 1.10 and 1.11. That said, the design is already expressive enough to cover the most common monitoring use cases, and the community response since the June 12 release has been largely positive, with several MLOps tool maintainers already experimenting with callback adapters for their platforms.

GPU Acceleration and Array API: Scikit-learn Moves Toward Hardware Neutrality

One of the defining narratives of the 2024–2026 period in ML engineering has been the acceleration of hardware diversity: engineers are no longer confined to CPUs for classical ML. Scikit-learn's response to this trend — the gradual rollout of Array API support — took a meaningful step forward in version 1.9. The release expands GPU-compatible execution to a broader set of estimators and metrics, further decoupling scikit-learn from the assumption that all computation happens on a CPU with NumPy arrays.

In version 1.9, the major estimators to gain GPU support via the Array API are:

  • linear_model.LogisticRegression with solver="lbfgs" — one of the most widely used estimators in the library now runs natively on GPU
  • linear_model.PoissonRegressor with solver="lbfgs" — critical for count data and insurance or actuarial applications
  • kernel_approximation.Nystroem — GPU-accelerated kernel approximation unlocks large-scale kernel SVM workflows
  • pipeline.FeatureUnion — enabling fully GPU-accelerated multi-branch feature combination pipelines

Metric functions also gained coverage in 1.9: d2_absolute_error_score, d2_pinball_score, and average_precision_score now accept Array API compliant inputs, meaning they can operate directly on GPU tensors without copying data back to the CPU. The release also ships a new utility, sklearn.utils._array_api.move_estimator_to, which allows engineers to move a fitted estimator's array attributes to a different device or namespace — a critical enabler for mixed-device ML pipelines where preprocessing may happen on CPU while inference runs on GPU.

The practical implications are substantial. Independent benchmarks published by :probabl. in March 2026 demonstrated up to 15x speed-ups in complex scikit-learn pipelines when running on GPU via the Array API. While these gains depend heavily on model type and data size — smaller datasets often see no benefit due to data-transfer overhead — they validate the strategic direction: for large tabular datasets and computationally intensive pipelines, GPU-accelerated sklearn is now a viable production option.

Sparse Interface Modernization

Version 1.9 also introduces the "sparse_interface" configuration key, which lets users control whether scikit-learn returns SciPy sparse matrices or the newer sparse array interface:

import sklearn
sklearn.set_config(sparse_interface="sparray")  # opt into sparse arrays

This is part of a broader alignment with the SciPy ecosystem's direction, which has been moving from the legacy csr_matrix format toward csr_array since SciPy 1.8. The current default remains "spmatrix" for backwards compatibility, but the team has signaled a future default change to "sparray" in coming releases. Engineers building new pipelines should consider opting into the new interface today to avoid a disruptive migration later.

Narwhals Integration: A Lighter Path to Dataframe Interoperability

One of the quieter but strategically important changes in scikit-learn 1.9 is the addition of narwhals as a new library dependency. Narwhals is a lightweight compatibility layer that allows Python code to work seamlessly across multiple dataframe libraries — primarily pandas and Polars — without requiring library-specific conditional branching. In adopting narwhals, scikit-learn is acknowledging a reality that practitioners have felt for the past two years: the Python data ecosystem is no longer synonymous with pandas alone.

The immediate impetus for this change is the deprecation of the dataframe interchange protocol (__dataframe__) by the Polars team. Scikit-learn had been relying on this protocol to handle non-pandas dataframes through its set_output API, introduced in version 1.2. With Polars deprecating the protocol, the sklearn team needed a more robust solution that would not break as the Polars API continued to evolve. As the version 1.9 changelog explains, narwhals provides exactly that: a unified, lightweight interface that sits above the dataframe layer and translates operations to the underlying library.

For ML engineers, this is a significant quality-of-life improvement with real production implications. Polars, which prioritizes performance through lazy evaluation, multi-threaded processing, and a Rust backend, has gained substantial traction as an alternative to pandas for data preprocessing at scale. Teams that have migrated their upstream preprocessing pipelines to Polars can now use set_output(transform="polars") in scikit-learn without hitting the compatibility issues that plagued the interchange protocol approach. The narwhals bridge ensures that sklearn's transformer outputs — whether from StandardScaler, ColumnTransformer, or custom estimators — can be returned as Polars DataFrames natively, preserving the lazy execution context downstream.

The choice of narwhals — a community-driven project rather than a first-party solution from either the pandas or Polars teams — reflects the scikit-learn team's preference for ecosystem neutrality. Rather than betting on one dataframe library's internal API, they have adopted an abstraction layer that will evolve alongside the broader ecosystem. This is the same philosophical approach that motivated the Array API adoption: where possible, scikit-learn should be a consumer of community standards rather than a definer of proprietary interfaces.

For data scientists working at the intersection of sklearn and modern data stack tooling — pipelines that ingest from Parquet via DuckDB, preprocess with Polars, and model with sklearn — narwhals closes a gap that previously required manual conversion steps or custom wrapper code. The end-to-end pipeline can now remain in Polars-native territory all the way through the sklearn transform stage.

Scikit-learn and Hugging Face Hub: 800 Models and a Deepening Partnership

The scikit-learn 1.9 release does not include new first-party Hugging Face integration code, but it lands within an ecosystem that has been quietly maturing since June 2022, when Hugging Face became an official sponsor of the scikit-learn consortium at the Fondation Inria in Paris. That partnership, now in its fourth year, has produced concrete infrastructure changes that are transforming how classical ML models are shared, deployed, and discovered.

The centerpiece of the sklearn–Hugging Face integration is skops, a Python library purpose-built to bridge the two ecosystems. Skops provides two core capabilities that address real pain points in classical ML model distribution:

  1. Secure serialization via skops.io — scikit-learn models are packaged as zip archives with accompanying JSON schema files, replacing the unsafe pickle format that has long been a security concern in ML model sharing. Unlike pickle, the skops format allows model consumers to inspect the full object structure before loading it, providing a meaningful safeguard against supply-chain attacks via malicious model files — a threat vector that has become increasingly relevant as the Hugging Face Hub scales.
  2. Hugging Face Hub integration via skops.card — with skops, engineers can push trained sklearn models directly to the Hub, generate model cards automatically from estimator metadata, and make models available for in-browser inference through Hugging Face Spaces. The model card generation alone removes a documentation burden that previously discouraged practitioners from sharing classical ML models publicly.

The scale of this integration is reflected in current Hub statistics: as of June 2026, there are 799 scikit-learn models hosted on the Hugging Face Hub, spanning tabular classification, tabular regression, and a growing set of structured prediction tasks including credit scoring, fraud detection, customer churn prediction, and medical risk stratification. That number represents a library that, four years ago, had virtually no presence on the Hub — Hugging Face's platform was built primarily around deep learning models for NLP, vision, and audio. The growth of sklearn models on the Hub signals an important broadening of the platform's scope: it is becoming a home for the full ML stack, not just neural networks.

The Human Capital Behind the Partnership

The institutional investment underpinning the collaboration is equally noteworthy. Two experienced developers are embedded at Hugging Face specifically to advance the sklearn ecosystem: Adrin Jalali, a core scikit-learn contributor who has been central to the library's governance and API design, and Benjamin Bossan, author of the widely-used skorch library that bridges scikit-learn and PyTorch. Their presence at Hugging Face ensures that the integration is driven by engineers who understand scikit-learn's internals at the level required to build reliable, forward-compatible tooling.

The partnership also has institutional depth through the Evaluate library, Hugging Face's framework for efficient, standardized ML evaluation. The evaluate library is being extended to natively support scikit-learn metrics in its API, which would allow engineers to compute and compare sklearn metrics — precision, recall, F1, AUC, calibration — alongside deep learning metrics within a single evaluation pipeline. This is an important step toward unified ML evaluation tooling across classical and neural approaches, reducing the operational complexity that currently comes from maintaining separate evaluation code for different model families.

What the Scikit-learn 1.9 Release Means for Hub-Hosted Models

For the 799 models already hosted on the Hub, the scikit-learn 1.9 improvements translate directly into better model quality. The enhanced sample weight handling in tree-based models and the improved numerical stability in ridge regression models mean that models retrained on 1.9 should produce more statistically correct outputs, particularly for models trained on survey or administrative data where sample weights are common. Engineers who maintain sklearn models on the Hub should consider re-running training with version 1.9 and updating their model cards — the new HTML estimator view makes generating accurate model architecture descriptions significantly easier.

Additional Enhancements: Faster Algorithms, Smarter Visualizations, and Key Deprecations

Beyond the headline features, scikit-learn 1.9 ships a dense package of algorithmic improvements, visualization upgrades, and bug fixes that benefit day-to-day ML engineering work. Several of these deserve attention from practitioners who may otherwise overlook them in the release notes.

Algorithmic Performance Gains

FastICA with the deflation algorithm is approximately 10x faster in version 1.9, a dramatic improvement for teams using independent component analysis for signal separation in audio processing, neuroscience (EEG/fMRI), or financial time series decomposition. RidgeCV and RidgeClassifierCV — among the most commonly deployed models in production classical ML — are now both faster and more numerically stable, addressing edge cases that could produce unreliable alpha selection on ill-conditioned design matrices. The ARPACK eigensolver used in SpectralEmbedding has been optimized, benefiting graph-based manifold learning workflows that rely on eigendecomposition of large sparse matrices.

New metric_at_thresholds() Function

The new metrics.metric_at_thresholds() function computes metric values across all possible classification thresholds from a single pass over model predictions. Before this addition, computing threshold-sensitivity curves for binary classifiers — a routine task in medical diagnostics, fraud detection, and any application where the operating point is tunable — required either custom loop code or post-processing of precision_recall_curve() and roc_curve() outputs. The new function standardizes this workflow and integrates cleanly with the rest of the sklearn metrics API.

Richer HTML Estimator Visualizations

The HTML representation of fitted estimators in Jupyter notebooks has been significantly enhanced. Fitted attributes (those ending in _, such as coef_, feature_importances_, and n_iter_) are now displayed in a structured table within the HTML view, allowing engineers to inspect learned parameters at a glance without calling print(model.coef_). ColumnTransformer now shows output feature names with copy-paste buttons in the visualization, making it dramatically easier to trace how input features are mapped through complex preprocessing pipelines. For teams that use Jupyter for exploratory model development and stakeholder communication, these visualization improvements meaningfully reduce the friction of model inspection.

Tree and Linear Model Improvements

RandomForestRegressor now supports native missing-value handling when using the absolute_error criterion — closing a gap that forced practitioners to impute data before fitting ensemble models in contexts (such as healthcare records or sensor data) where missingness carries information and should not be imputed away. The release also improves the statistical correctness of sample weight handling in HistGradientBoosting, RandomForest, and ExtraTree, addressing subtle biases that could affect models trained on imbalanced datasets or survey data with probability weights. Additionally, multi-task linear models now support sparse input matrices X and sample weights — an important capability for NLP practitioners who use multi-output regression on sparse document-feature matrices.

Deprecations to Watch

Version 1.9 introduces several deprecations that teams should plan migrations for before the scheduled breaking changes in versions 1.11 and 1.12:

  • criterion="friedman_mse" in tree-based models is deprecated; the standard "squared_error" criterion is the recommended replacement
  • SVC.probability parameter is deprecated; the recommended replacement is CalibratedClassifierCV wrapping a base SVC(probability=False)
  • n_alphas parameter is deprecated in lasso_path() and enet_path()
  • The default scoring in LogisticRegressionCV will change from accuracy to "neg_log_loss" in version 1.11 — a statistically motivated change that may surprise teams relying on current default behavior for threshold-based model selection

These deprecations follow scikit-learn's convention of warning two major versions before breaking changes land, giving teams adequate runway to update their code without emergency refactors.