Version 1.9#

For a short description of the main highlights of the release, please refer to Release Highlights for scikit-learn 1.9.

Legend for changelogs

- Major Feature something big that you couldn’t do before.

- Feature something that you couldn’t do before.

- Efficiency an existing feature now may not require as much computation or memory.

- Enhancement a miscellaneous minor improvement.

- Fix something that previously didn’t work as documented – or according to reasonable expectations – should now work.

- API Change you will need to change your code to have the same effect in the future; or a feature will be removed in the future.

Version 1.9.1#

September 2026

Support for Array API#

- Fix Fixed classification metrics to accept pandas labels when array API dispatch is enabled and predictions are from a different array API namespace or device. By Olivier Grisel. #34779

Metadata routing#

Refer to the Metadata Routing User Guide for more details.

- Fix Metadata is now correctly routed to the sub-estimator of meta-estimators such as - feature_selection.SelectFromModel,- feature_selection.RFE,- feature_selection.RFECV,- feature_selection.SequentialFeatureSelector, and- impute.IterativeImputerwhen they are used as an intermediate step of a- pipeline.Pipeline, i.e. when their composite- fit_transformmethod is the target of the routing. Previously, metadata such as- sample_weightwas silently dropped in this case. By Adrin Jalali and Kyle Schluns. #30869

- Fix - ensemble.BaggingClassifiernow correctly routes metadata via- predictand- predict_probadynamically to the corresponding method on the sub-estimator. By Stefanie Senger. #34188

- Fix - pipeline.Pipeline’s- fit_transformand- fit_predictnow correctly apply- transform_inputto metadata routed to intermediate steps, matching- fit. By Stefanie Senger. #34201

- Fix - compose.TransformedTargetRegressornow correctly routes metadata such as- sample_weightto its default regressor (- LinearRegression) when metadata routing is enabled. By Stefanie Senger. #34224

Callbacks#

- Fix Fixed a bug where fitting an estimator with a - callback.ScoringMonitorand a parallel backend using multi-processing could fail with “Could not pickle the task to send it to the workers”. By Jérémie du Boisberranger. #34821

- Fix - cluster.DBSCANand- cluster.dbscanno longer raise a spurious- EfficiencyWarningwhen given a precomputed sparse distance matrix. By Vadim. #34399

- Fix - cluster.OPTICSno longer raises a- EfficiencyWarningwhen fitted on a precomputed sparse distance matrix. By Dea María Léon. #34692

- Fix - datasets.fetch_openmlnow correctly recovers from a corrupted download by re-downloading it, instead of raising an error. By Roman Yurchak. #34262

- Fix - datasets.fetch_filenow raises a- ValueErrorwhen- local_filenameis a path instead of a plain filename. By Dea María Léon. #34815

- Fix - discriminant_analysis.LinearDiscriminantAnalysisand- discriminant_analysis.QuadraticDiscriminantAnalysisnow return the same results when using- solver="svd"and- solver="eigen". The normalization for- solver="svd"is changed to- 1/n_samplesinstead of- 1/(n_samples - n_classes)and- 1/(n_samples - 1), respectively, which is consistent with the maximum likelihood covariance estimator (same as the- solver="eigen"default). By Daniel Herrera-Esposito. #33626

- Efficiency Scorers created with - make_scorerno longer deep-copy metadata kwargs on each call, reducing memory usage during model selection and cross-validation. By Stefanie Senger. #34236

- Fix - neighbors.NearestNeighbors.radius_neighborsnow correctly handles an array-like- radiuswhen- n_jobs > 1with the- ball_treeand- kd_treealgorithms. By Nicolas Salvy. #34341

- Fix Fixed a bug in - preprocessing.QuantileTransformerwhere fitting on sparse data with- ignore_implicit_zeros=Trueand subsampling could compute degenerate quantiles for some features. By Arthur Lacote. #32587

- Fix Fixed a memory leak when calling the - fitmethod of- svm.LinearSVR. By Jake VanderPlas. #34256

- Fix Fixed an out-of-bound write in the - fitmethod of- svm.LinearSVCmemory when using- multi_class="crammer_singer". By Jake VanderPlas. #34273

- Fix The HTML representation of estimators now truncates the output feature list to 100 entries to improve rendering performance for estimators with many output features. By Dea María Léon. #34362

- Fix Array API supporting functions and estimators that handle mixed input namespaces now make negative-stride NumPy arrays contiguous before transferring them to PyTorch through DLPack, avoiding a Python process abort in - torch.from_dlpack. By Yin Li. #34380

- Fix The copy-to-clipboard icons in the HTML representation of estimators are now rendered as - <button>elements with an- aria-labeland a visible focus outline, instead of non-interactive- <i>elements, so they are reachable and usable with a keyboard and screen readers. By Dea María Léon. #34429

- Fix - set_output(transform="polars")no longer emits a- DeprecationWarningwith- polars>=1.42.1by using- how="horizontal_extend"instead of the deprecated- how="horizontal"when concatenating polars dataframes. By Felix Hoehle. #34447

Version 1.9.0#

June 2026

Changed models#

- Enhancement The - transformmethod of- preprocessing.PowerTransformerwith- method="yeo-johnson"now uses the numerical more stable function- scipy.stats.yeojohnsoninstead of an own implementation. The results may deviate in numerical edge cases or within the precision of floating-point arithmetic. By Christian Lorentzen. #33272

Changes impacting many modules#

- Major Feature Introduced a new config key: “sparse_interface” to control whether functions return sparse objects using SciPy sparse matrix or SciPy sparse array. Use - sklearn.set_config(sparse_interface="sparray")to have sklearn return sparse arrays. See more at the SciPy Sparse Migration Guide. The scikit-learn config “sparse_interface” initially defaults to sparse matrix (“spmatrix”). The plan is to have the default change to sparse array (“sparray”) in a few releases. By Dan Schult. #31177

- Enhancement Scikit-learn accepted a new library dependency: narwhals. This is a very lightweight dependency that simplifies the support of dataframe input - Xand dataframe output as specified in the- set_outputAPI. Examples are pandas and polars dataframes. Narwhals can also help to support more dataframe libraries. Another reason for its adoption was that the dataframe interchange protocol (- __dataframe__) on which scikit-learn relied so far for non-pandas dataframes got deprecated by polars and has run its course. By Christian Lorentzen and Marco Gorelli. #31127

- Enhancement The HTML representation of all scikit-learn estimators inheriting from - base.BaseEstimatornow displays a new block showing the number and names of the output features when using a- compose.ColumnTransformeror a- pipeline.FeatureUnion. A copy-paste button is available for the output features name. By Dea María Léon, Guillaume Lemaitre, Jérémie du Boisberranger, Olivier Grisel, Antoine Baker. #31937

- Enhancement - pipeline.Pipeline,- pipeline.FeatureUnionand- compose.ColumnTransformernow raise a clearer error message when an estimator class is passed instead of an instance. By Anne Beyer. #32888

- Enhancement Checks for response values now provide a clearer error message when estimator does not implement the given - response_method. By Quentin Barthélemy. #33126

- Enhancement The HTML representation of all scikit-learn estimators inheriting from - base.BaseEstimatornow includes a table displaying their fitted attributes. These are all the public estimator attributes that are computed during the call to fit with a name that ends with an underscore. By Dea María Léon, Jérémie du Boisberranger, Olivier Grisel, Guillaume Lemaitre, Antoine Baker. #33399

- Fix Raise ValueError when - sample_weightcontains only zero values to prevent meaningless input data during fitting. This change applies to all estimators that support the parameter- sample_weight. This change also affects metrics that validate sample weights. By Lucy Liu and John Hendricks. #32212

- Fix Some parameter descriptions in the HTML representation of estimators were not properly escaped, which could lead to malformed HTML if the description contains characters like - <or- >. By Olivier Grisel. #32942

Support for Array API#

Additional estimators and functions have been updated to include support for all Array API compliant inputs.

See Array API support (experimental) for more details.

- Feature - sklearn.metrics.d2_absolute_error_scoreand- sklearn.metrics.d2_pinball_scorenow support array API compatible inputs. By Virgil Chan. #31671

- Feature - linear_model.LogisticRegressionnow supports array API compatible inputs with- solver="lbfgs". By Omar Salman and Olivier Grisel. #32644

- Feature - metrics.average_precision_scorenow supports Array API compliant inputs. By Stefanie Senger. #32909

- Feature - sklearn.metrics.pairwise.paired_manhattan_distancesnow supports array API compatible inputs. By Bharat Raghunathan. #32979

- Feature - metrics.pairwise_distances_argminnow supports array API compatible inputs. By Bharat Raghunathan. #32985

- Feature - linear_model.LinearRegression,- linear_model.Ridge,- linear_model.RidgeClassifier,- linear_model.LogisticRegression, and- discriminant_analysis.LinearDiscriminantAnalysisnow raise a more informative error message when arrays passed at fit and prediction time use different array API namespaces or devices. A new- sklearn.utils._array_api.move_estimator_toutility is provided to move an estimator’s fitted array attributes to a different namespace and device. By Jérôme Dockès and Tim Head. #33076

- Feature - pipeline.FeatureUnionnow supports Array API compliant inputs when all its transformers do. By Olivier Grisel. #33263

- Feature - linear_model.PoissonRegressornow supports array API compatible inputs with- solver="lbfgs". By Christian Lorentzen and Omar Salman. #33348

- Enhancement - kernel_approximation.Nystroemnow supports array API compatible inputs. By Emily Chen. #29661

- Enhancement - linear_model.RidgeCVnow accepts array API compliant arrays with- gcv_modeset to- autoor- eigen. By Antoine Baker. #33020

- Enhancement Internal NumPy CPU conversions now always attempt a generic DLPack-based transfer and only fallback to library-specific methods when necessary. This should ease support for additional array API and DLPack compliant input types without extending the ad hoc conversion helpers. By Olivier Grisel. #33623

- Fix Fixed a bug that would cause Cython-based estimators to fail when fit on NumPy inputs when setting - sklearn.set_config(array_api_dispatch=True). By Olivier Grisel. #32846

- Fix Fixes how - pos_labelis inferred when- pos_labelis set to- None, in- sklearn.metrics.brier_score_lossand- sklearn.metrics.d2_brier_score. By Lucy Liu. #32923

- Fix - linear_model.ridge_regressionnow correctly passes a Python scalar as- fill_valueto- xp.fullwhen broadcasting alpha for multi-target regression, ensuring compliance with the array API specification. This fixes compatibility issues with some array API backends. By Olivier Grisel. #33437

- Fix - metrics.pairwise_distancesno longer emits spurious cross-library dtype comparison warnings when called with Array API inputs under- config_context(array_api_dispatch=True). By Olivier Grisel. #33873

- Fix Fixed support for integer Array API inputs on devices that do not support - float64in- preprocessing.MinMaxScaler,- preprocessing.MaxAbsScaler,- preprocessing.KernelCenterer,- preprocessing.normalize,- utils.extmath.randomized_range_finder, and internal linear-model preprocessing and log-sum-exp utilities. By Arthur Lacote. #33898

- Fix Fix passing an array as - alphain- linear_model.Ridgewhen using the array API. By Thomas Moreau. #34004

- Fix - linear_model.RidgeClassifierand- linear_model.RidgeClassifierCVnow store- classes_in the namespace and on the device of- ywhen fitted with array API inputs from mixed namespaces/devices, making them consistent with- linear_model.LogisticRegression. By Arthur Lacote. #34065

- Fix Fixed a bug where NumPy-fitted estimators could raise an error with - config_context(array_api_dispatch=True)when making predictions with array-like or SciPy sparse inputs, or when a fitted attribute was sparse, such as after calling- linear_model.LogisticRegression.sparsify. By Arthur Lacote. #34144

Metadata routing#

Refer to the Metadata Routing User Guide for more details.

- Enhancement - TargetEncodernow routes- groupsto the CV splitter internally used for cross fitting in its- fit_transform. By Samruddhi Baviskar and Stefanie Senger. #33089

- Fix Scorers now correctly request for metadata, and their - set_score_requestmethods correctly detect metadata available in the signature of their- score_func. Also,- sklearn.linear_model.LogisticRegressionCVnow correctly routes metadata to the underlying scorer when its- .score(...)method is called. By Adrin Jalali #30859

- Fix If a class explicitly defines a - set_{method}_requestmethod, it will not be overridden by the metadata routing machinery. By Adrin Jalali #32111

- Fix Metadata routing objects ( - MetadataRequest,- MetadataRouter, and their per-method requests) no longer deep-copy the owning estimator. Since scikit-learn 1.8, the routing objects hold a reference to the owner estimator for display purposes, which caused- get_routing_for_objectand- add_self_requestto transitively deep-copy the full estimator state, which can fail, and is very inefficient. By Adrin Jalali. #33827

- Fix - learning_curvenow correctly routes- sample_weightto the sub-estimator’s partial_fit method if- exploit_incremental_learningis set to- True. By Stefanie Senger. #34039

Callbacks#

- Major Feature This release introduces a new callback API to invoke callbacks during the fitting of estimators that support them. It comes with two built-in callbacks: - sklearn.callback.ProgressBar, to display progress bars.

- sklearn.callback.ScoringMonitor, to compute and log a scoring metric at the end of each iteration.

- The following estimators support callbacks: - LogisticRegression(only with- solver="lbfgs").

- It also provides a public API to implement callback support in custom estimators or or to implement custom callbacks, see the developer’s guide. - This API is experimental for now and may change without the usual deprecation cycle. - By Jérémie du Boisberranger, François Paugam and Stefanie Senger. #33322

- Enhancement - cluster.AgglomerativeClusteringand- cluster.FeatureAgglomerationnow accept- metric="l2"together with- linkage="ward".- metric="l2"is equivalent to- metric="euclidean". #24681 by Guillaume Lemaitre. #24681

- Fix - cluster.MiniBatchKMeansnow correctly handles sample weights during fitting. When sample weights are not None, mini-batch indices are created by sub-sampling with replacement using the normalized sample weights as probabilities. By Shruti Nath, Olivier Grisel, and Jeremie du Boisberranger. #30751

- Fix Fixed a bug in - cluster.BisectingKMeanswhen using a custom callable- initwith- n_clusters > 2. By Mohammad Ahmadullah Khan. #33148

- Fix The dotted line for - compose.ColumnTransformerin its HTML display now includes only its elements. The behaviour when a remainder is used, has also been corrected. By Dea María Léon. #32713

- Fix Fixes the regression that a - KeyErrorwas thrown when using- compose.ColumnTransformer.fit_transformwith metadata routing and- remainder="passthrough". By Anne Beyer. #33665

- Efficiency Re-enabled compressed caching for - datasets.fetch_kddcup99, reducing on-disk cache size without changing the public API. By Unique Shrestha. #33118

- Fix Fixed - datasets.fetch_openmlto issue OpenML API calls to- https://www.openml.org/api/v1/instead of- https://api.openml.org/api/v1/, which no longer resolves or redirects correctly. By Olivier Grisel. #33868

- Efficiency - FastICAwith- algorithm='deflation'and- fun='logcosh'is now an order of magnitude faster. By Mohammad Ahmadullah Khan. #33269

- Fix Fixed a typo (from - "OR"to- "QR") in the list of allowed values for- power_iteration_normalizerin- decomposition.TruncatedSVD. By Olivier Grisel. #33492

- Fix Fixed the way - ensemble.HistGradientBoostingClassifierand- ensemble.HistGradientBoostingRegressorcompute their bin edges to properly and consistently handle sample_weight. When- sample_weights=Noneis passed to- fitand the number of distinct feature values is less than the specified- max_bins, the edges are still set to midpoints between consecutive feature values. Otherwise, the bin edges are set to weight-aware quantiles computed using the averaged inverted CDF method. If- n_samplesis larger than the- subsampleparameter, the weights are instead used to subsample the data (with replacement) and the bin edges are set using unweighted quantiles of the subsampled data. By Shruti Nath and Olivier Grisel. #29641

- Fix - ensemble.RandomForestClassifier,- ensemble.RandomForestRegressor,- ensemble.ExtraTreesClassifierand- ensemble.ExtraTreesRegressornow use- sample_weightto draw the samples instead of forwarding them multiplied by a uniformly sampled mask to the underlying estimators. Furthermore, when- max_samplesis a float, it is now interpreted as a fraction of- sample_weight.sum()instead of- X.shape[0]. As sampling is done with replacement, a float- max_samplesgreater than- 1.0is now allowed, as well as an integer- max_samplesgreater then- X.shape[0]. The default- max_samples=Nonedraws- X.shape[0]samples, irrespective of- sample_weight. By Antoine Baker. #31529

- Fix Both - ensemble.GradientBoostingRegressorand- ensemble.GradientBoostingClassifierwith the default- "friedman_mse"criterion were computing impurity values with an incorrect scaling, leading to unexpected trees in some cases. The implementation now uses- "squared_error", which is exactly equivalent to- "friedman_mse"up to floating-point error discrepancies but computes correct impurity values. By Arthur Lacote. #32708

- API Change The - criterionparameter is now deprecated for classes- ensemble.GradientBoostingRegressorand- ensemble.GradientBoostingClassifier, as both options (- "friedman_mse"and- "squared_error") were producing the same results, up to floating-point rounding discrepancies and a bug in- "friedman_mse". By Arthur Lacote. #32708

- Fix - feature_extraction.image.reconstruct_from_patches_2dnow produces correct results when a patch dimension equals the corresponding image dimension. By Eden Rochman. #33643

- Enhancement - feature_selection.SelectFromModeland- feature_selection.RFEnow support estimators whose feature importance is a sparse matrix or array, notably by passing a user-defined callable to the parameter- importance_getter. By andymucyo-ops and isaacambrogetti. #33786

- Fix - feature_selection.RFEnow uses stable sorting when ranking feature importances. This ensures that the feature selection is deterministic and consistent across runs when feature importances are tied. By blitchj. #29532

- Efficiency Constructor signature of Gaussian process kernels is now cached, improving performance on small and medium datasets. By Stanislav Terliakov. #33067

- Fix The hyperparameters of the default kernel of - GaussianProcessRegressor, namely- ConstantKernel() * RBF(), are now optimized when- optimizeris not- None. Thus,- gpr = GaussianProcessRegressor().fit(X, y)uses optimized kernel hyperparameters. By Matthias De Lozzo. #32964

- Enhancement In - inspection.DecisionBoundaryDisplay,- multiclass_colorsnow defaults to the more accessible Petroff color sequence for multiclass problems with up to 10 classes. By Anne Beyer. #33709

- Fix In - inspection.DecisionBoundaryDisplay,- multiclass_colorsis now also used for multiclass plotting when- response_method="predict". By Anne Beyer. #33015

- Fix In - inspection.DecisionBoundaryDisplay,- n_classesis now inferred more robustly from the estimator. If it fails for custom estimators, a comprehensive error message is shown. By Anne Beyer. #33202

- Fix - inspection.DecisionBoundaryDisplaynow displays all class boundaries when using- plot_method="contour"with all response_methods, and displays all classes in distinct colors when using- plot_method="contourf"with- response_method="predict". By Anne Beyer and Levente Csibi. #33300

- Fix In - inspection.DecisionBoundaryDisplay, a- ValueErroris now raised if the colormap passed to- multiclass_colorscontains fewer colors than there are classes in multiclass problems. By Anne Beyer. #33419

- Fix For multiclass data, - inspection.DecisionBoundaryDisplaywith- plot_method="contour"now also displays class-specific contours for- response_method="predict_proba"and- response_method="decision_function". Multiclass class boundary contour lines are now displayed in black by default for all response methods to avoid confusion. By Anne Beyer. #33471

- Fix In - inspection.DecisionBoundaryDisplay,- multiclass_colors_now always stores the colors for multiclass problems as a numpy array. By Anne Beyer. #33651

- Feature - linear_model.MultiTaskElasticNet,- linear_model.MultiTaskElasticNetCV,- linear_model.MultiTaskLasso, and- linear_model.MultiTaskLassoCVnow support fitting on sparse- Xas well as fitting with- sample_weight. By Christian Lorentzen. #33440

- Efficiency - linear_model.LogisticRegressionwith- solver="lbfgs"now estimates the gradient of the loss at- float32precision when fitted with- float32data (- X) to improve training speed and memory efficiency. Previously, the input data would be implicitly cast to- float64. If you relied on the previous behavior for numerical reasons, you can explicitly cast your data to- float64before fitting to reproduce it. By Omar Salman and Olivier Grisel. #32644

- Efficiency The - linear_model.LinearRegression,- linear_model.Ridge,- linear_model.Lasso,- linear_model.LassoCV,- linear_model.ElasticNet,- linear_model.ElasticNetCVand- linear_model.BayesianRidgeclasses now no longer make an unnecessary copy of dense- X, yinput during preprocessing when- copy_X=Falseand- sample_weightis provided. By Junteng Li. #33041

- Enhancement - linear_model.LogisticRegressionCVnow correctly handles the case when the- scoringparameter is set (to something not- None) and when the CV splits result in folds where some class labels are missing. By Christian Lorentzen. #32828

- Enhancement - linear_model.ElasticNet,- linear_model.ElasticNetCVand- linear_model.enet_pathnow are able to fit Ridge regression, i.e. setting- l1_ratio=0. Before this PR, the stopping criterion was a formulation of the dual gap that breaks down for- l1_ratio=0. Now, an alternative dual gap formulation is used for this setting. This reduces the noise of raised warnings. By Christian Lorentzen. #32845

- Enhancement Efficiency - linear_model.ElasticNet,- linear_model.ElasticNetCV,- linear_model.Lasso,- linear_model.LassoCV,- linear_model.MultiTaskElasticNet,- linear_model.MultiTaskElasticNetCV- linear_model.MultiTaskLasso,- linear_model.MultiTaskLassoCVas well as- linear_model.lasso_pathand- linear_model.enet_pathare now faster when fit with strong L1 penalty and many features. During gap safe screening of features, the update of the residual is now only performed if the coefficient is not zero. By Christian Lorentzen. #33161

- Fix - linear_model.LassoCVand- linear_model.ElasticNetCVnow take the- positiveparameter into account to compute the maximum- alphaparameter, where all coefficients are zero. This impacts the search grid for the internally tuned- alphahyper-parameter stored in the attribute- alphas_. By Junteng Li. #32768

- Fix Correct the formulation of - alphawithin- linear_model.SGDOneClassSVM. The corrected value is- alpha = nuinstead of- alpha = nu / 2. Note: This might result in changed values for the fitted attributes like- coef_and- offset_as well as the predictions made using this class. By Omar Salman. #32778

- Fix - linear_model.enet_pathnow correctly handles the- precomputeparameter when- check_input=False. Previously, the value of- precomputewas not properly treated which could lead to a ValueError. This also affects- linear_model.ElasticNetCV,- linear_model.LassoCV,- linear_model.MultiTaskElasticNetCVand- linear_model.MultiTaskLassoCV. By Albert Dorador. #33014

- Fix The leave-one out errors and model parameters estimated in - linear_model.RidgeCVand- linear_model.RidgeClassifierCVwhen- cv=Noneare now numerically stable in the small- alpharegime. The default- autooption is now equivalent to- eigenand picks the cheaper option: eigendecomposition of the covariance matrix when- n_features <= n_samples, respectively of the Gram matrix when- n_samples > n_features. When- store_cv_results=Trueand- Xis an integer array, the- cv_results_attribute was wrongly coerced to the integer dtype of- X, it now always has a float dtype. By Antoine Baker. #33020

- Fix Fixed a bug in - linear_model.SGDClassifierfor multiclass settings where large negative values of- linear_model.SGDClassifier.decision_functioncould lead to NaN values. In this case, this fix assigns equal probability for each class. By Christian Lorentzen. #33168

- Fix Fix unsigned integer overflow in - linear_model.RidgeClassifierwhen fitting with unsigned integer inputs. Internal label binarisation now avoids wrapping -1 for unsigned integer target dtypes. By Virgil Chan. #33441

- Fix The - tolparameter in- linear_model.LinearRegressionis now set as the- condparameter of the- scipy.linalg.lstsqsolver when fitting on dense data. Some tests involving- linear_model.LinearRegressionwere brittle with the default- condvalues from- scipyor- numpy. Here at least the user has control over the- condvalue and can change it if necessary. By Antoine Baker. #33565

- Fix - linear_model.LogisticRegressionCVno longer raises a- TypeErrorwhen- refit=Falseand- use_legacy_attributes=Falseare set together with a non-elasticnet penalty like- l1_ratios=[0.0]. Previously,- Nonewas stored in- l1_ratio_instead of- 0.0, which caused- float()to fail during post-processing. By Mohamad Fazeli. #33902

- Fix - linear_model.BayesianRidgeand- linear_model.ARDRegressionnow center test features during- predictto correctly compute predictive variance. By Danilo Silva. #33918

- API Change Passing - sample_weightas a positional argument to- linear_model.LogisticRegressionCV.scoreis deprecated and will be removed in version 1.11. Pass it as a keyword argument instead. By Adrin Jalali #30859 #30859

- API Change The default value of the - scoringparameter in- linear_model.LogisticRegressionCVwill change in version 1.11 from- None, i.e. accuracy, to- "neg_log_loss". This is a much better default scoring function as it aligns with the log loss that logistic regression is minimizing (with regularization). For the meantime, you can silence the warning for this change by explicitly passing a value to- scoring. By Christian Lorentzen. #33333

- API Change The parameter - n_alphashas been deprecated for- linear_model.lasso_pathand- linear_model.enet_path. This deprecation follows the same deprecation that has happened for- linear_model.ElasticNetCVand- linear_model.LassoCV. The parameter- alphasnow supports both integers and array-likes, removing the need for- n_alphas. From now on, only- alphasshould be set, either to and integer to indicate the number of automatically generated alphas or to an array-like of values for the regularization path. By Christian Lorentzen. #33855

- Efficiency The way ARPACK eigensolver is called in - manifold.SpectralEmbeddingand- cluster.SpectralClusteringwas improved, resulting in faster runtimes. By Dmitry Kobak. #33262

- Fix - manifold.MDS.fit_transformreturns the correct number of components when using- init="classical_mds". By Ben Pedigo. #33318

- Major Feature - metrics.metric_at_thresholdshas been added to compute a metric’s values across all possible thresholds. By Carlo Lemos and Lucy Liu. #32732

- Feature Add class method - from_cv_resultsto- metrics.PrecisionRecallDisplay, which allows easy plotting of multiple precision-recall curves from- model_selection.cross_validateresults. By Lucy Liu. #30508

- Enhancement - cohen_kappa_scorenow has a- replace_undefined_byparam, that can be set to define the function’s return value when the metric is undefined (division by zero). By Stefanie Senger. #31172

- Fix - metrics.d2_pinball_scoreand- metrics.d2_absolute_error_scorenow always use the- "averaged_inverted_cdf"quantile method, both with and without sample weights. Previously, the- "linear"quantile method was used only for the unweighted case leading the surprising discrepancies when comparing the results with unit weights. Note that all quantile interpolation methods are asymptotically equivalent in the large sample limit, but this fix can cause score value changes on small evaluation sets (without weights). By Virgil Chan. #31671

- Fix - metrics.accuracy_score,- metrics.hamming_loss- metrics.zero_one_loss,- metrics.matthews_corrcoefand- metrics.confusion_matrix(when- labelsis not- None) now raise an error when- y_trueis string and- y_predis numeric, for all array-like inputs. Previously, lists and numpy arrays not of- objectdtype did not raise an error for this mixed input case. The above metrics will also raise an error for label indicator matrix inputs of inconsistent size, except for- metrics.confusion_matrixwhich does not accept label indicator matrix inputs. By Lucy Liu. #33086

- Fix Fixed - metrics.pairwise_distances_argminand- metrics.pairwise_distances_argmin_minto avoid a quadratic-time path when many distances are identical, which could lead to severe slowdowns or even a stack overflow (segmentation fault) on large inputs. By Arthur Lacote. #33252

- Fix - metrics.PrecisionRecallDisplay.from_estimatorand- metrics.PrecisionRecallDisplay.from_predictionsnow correctly plot chance level line when- y_trueis a pytorch tensor. By Lucas Oliveira. #33405

- Fix - y_predwas deprecated in favor of- y_probafor- metrics.log_lossand- metrics.d2_log_loss_scoreas predicted probabilities are expected, not predicted labels. By Lucy Liu. #33740

- Fix - metrics.pairwise_distancesno longer raises an error for the euclidean metric when called with- Y_norm_squaredand- n_jobs > 1. By Kunle Li. #33876

- API Change Passing the - pos_labeland- sample_weightparameters of- metrics.confusion_matrix_at_thresholdsas positional arguments is deprecated and will be removed in v1.11. By Jérémie du Boisberranger. #33357

- Enhancement - GroupKFoldnow uses- stablesorting when doing the group distribution. This ensures that the splits are consistent across runs. By marikabergengren and Adrin Jalali. #28464

- Fix - model_selection.StratifiedGroupKFoldnow raises a- ValueErrorwhen- n_splitsis greater than the number of unique groups, preventing degenerate folds. By Chani Fainendler. #33176

- Fix Fixed incorrect - ValueErrorwhen using- scoring="average_precision"or similar in model selection utilities such as- model_selection.GridSearchCVor- model_selection.cross_validatewith multiclass classifiers. The- pos_labelparameter is only relevant for binary classification and was incorrectly being validated for scorers used on multiclass problems. By Olivier Grisel. #33473

- Fix - neighbors.KNeighborsClassifierand- neighbors.RadiusNeighborsClassifiernow work with string labels when- algorithm="brute". By AAAZZZR. #33048

- Fix Fixed a quadratic-time path in the internal - simultaneous_sortused by- neighbors.BallTreeand- neighbors.KDTreequeries when many distances are identical, which could lead to severe slowdowns or even a stack overflow (segmentation fault) on large inputs. Neighbor searches with tied distances no longer degrade badly in runtime. By Arthur Lacote. #33252

- Fix - neural_network.MLPClassifierwith- early_stopping=Trueno longer raises a- TypeErrorwhen- ycontains non-numeric class labels (e.g. strings): validation scoring now checks finiteness only for floating predictions. By Guillaume Lemaitre. #33774

- Fix Fixed a bug in - pipeline.FeatureUnionwith- set_output(transform="polars")when transformers produce duplicate column names. By Jérémie du Boisberranger and Levente Csibi. #32106

- Fix - pipeline.Pipelinenow raises an- AttributeErrorwhen accessing attributes that are not available on an empty pipeline. It’s therefore possible to call- diron an empty pipeline. By Jérémie du Boisberranger. #33362

- Fix - PowerTransformerand- QuantileTransformernow don’t raise a warning in- inverse_transformrelated to feature names if- fitis called using data with feature names. By Thibault and Mohammad Ahmadullah Khan. #33268

- API Change The - shuffleand the- random_stateparameters are deprecated on- TargetEncoderand will be removed in version 1.11. Pass a cross-validation generator as- cvargument to specify the shuffling behaviour instead. By Stefanie Senger. #33453

- Fix Raise more informative error when fitting - svm.NuSVRwith all zero sample weights. By Lucy Liu and John Hendricks. #32212

- API Change The - probabilityparameter of- sklearn.svm.SVCand- sklearn.svm.NuSVCis deprecated due to not being thread-safe and will be removed in 1.11. Use- sklearn.calibration.CalibratedClassifierCVwith the respective estimator and- ensemble=Falseinstead. By Shruti Nath. #32050

- API Change The - probA_and- probB_attributes of- sklearn.svm.SVCand- sklearn.svm.NuSVCare deprecated due to deprecation of the- probabilityparameter and will be removed in 1.11. By Shruti Nath. #33388

- Feature In - tree.DecisionTreeRegressorand- ensemble.RandomForestRegressor,- criterion="absolute_error"— and, consequently, all criterion options — now support missing values for dense training data- X. By Arthur Lacote. #32119

- Enhancement - tree.DecisionTreeClassifier,- tree.DecisionTreeRegressor,- tree.ExtraTreeClassifier,- tree.ExtraTreeRegressor,- ensemble.RandomForestClassifier,- ensemble.RandomForestRegressor,- ensemble.ExtraTreesClassifier, and- ensemble.ExtraTreesRegressornow support combining- monotonic_cstwith missing values in dense training data. This builds on the improvements to missing-value support for dense training data in #32119. By Samuel O. Ronsin. #27630

- Fix Fix calculation of node impurity in - tree.DecisionTreeRegressor,- ensemble.RandomForestRegressor,- ensemble.ExtraTreeRegressorand- ensemble.ExtraTreesRegressorwhen missing values are present for the Poisson criterion. The Poisson criterion was returning invalid impurities (including negative values) when missing values were present. By Arthur Lacote. #32119

- Fix Fixed feature-wise NaN detection in trees. Features could be seen as NaN-free for some edge-case patterns, which led to not considering splits with NaNs assigned to the left node for those features. This affects - tree.DecisionTreeRegressor,- tree.ExtraTreeRegressor,- ensemble.RandomForestRegressorand- ensemble.ExtraTreesRegressor. By Arthur Lacote. #32193

- Fix Fixed color conversion in tree export so RGB values with zero channels are correctly converted to two-digit hexadecimal components (for example, - (0, 255, 0)now yields- #00ff00). By Simon-Martin Schröder. #33845

- API Change - criterion="friedman_mse"is now deprecated. This criterion was intended for gradient boosting but was incorrectly implemented in scikit-learn’s trees and was actually behaving identically to- criterion="squared_error". Use- criterion="squared_error"instead. This affects- tree.DecisionTreeRegressor,- tree.ExtraTreeRegressor,- ensemble.RandomForestRegressorand- ensemble.ExtraTreesRegressor. By Arthur Lacote. #32708

- Enhancement - utils.get_tagsnow provides a clearer error message when a class is passed instead of an estimator instance. By Achyuthan S and Anne Beyer. #32565

- Fix The parameter table in the HTML representation of all scikit-learn estimators inheritiging from - base.BaseEstimator, displays each parameter documentation as a tooltip. The last tooltip of a parameter in the last table of any HTML representation was partially hidden. This issue has been fixed. By Dea María Léon. #32887

- Fix Fixed - utils.stats._weighted_percentilewith- average=Trueso zero-weight samples just before the end of the array are handled correctly. This can change results before the end of the array are handled correctly. This can change results when using- sample_weightwith- preprocessing.KBinsDiscretizer(- strategy="quantile",- quantile_method="averaged_inverted_cdf") and in- metrics.median_absolute_error,- metrics.d2_pinball_score, and- metrics.d2_absolute_error_score. By Arthur Lacote. #33127

- Fix - utils.check_arraynow correctly rejects pandas- StringDtypecolumns when- dtype="numeric"is requested. In pandas 3, string columns use- StringDtypeinstead of- objectdtype, which caused- check_arrayto silently accept string data instead of raising a- ValueError. By Olivier Grisel. #33491

- Fix The code path for polars dataframes in - utils.validation.validate_datawas made independent of the dataframe interchange protocol- __dataframe__. This change was necessary to adapt to the recent deprecation of the interchange protocol in polars version 1.40. By Christian Lorentzen. #33789

- API Change - utils.multiclass.unique_labelsnow accepts- ys_typesparameter, which allows avoiding duplicate calls to- utils.multiclass.type_of_target. By Lucy Liu. #33086

Code and documentation contributors

Thanks to everyone who has contributed to the maintenance and improvement of the project since version 1.8, including:

AAAZZZR, ABHISHEK, Adrin Jalali, Agnus Paul, Ajay Raj, Akshita Sure, Albert Dorador Chalar, Alex Kuleshov, alexshacked, Alireza, Amine Abdellaziz, ANAND VENUGOPAL, Andres Nayeem Mejia, Andy, Anne Beyer, antoinebaker, Anton Karpov, Anvay, Arthur, Arthur Lacote, Arturo Amor, Ashutosh Devpura, Auguste Baum, Balaji Seshadri, baynecheke, Ben Pedigo, Bharat Raghunathan, Bodhi Russell Silberling, Bodhi Silberling, Bora Yongacoglu, camxx44, Chaitanya Dasari, Chani Fainendler, Charlie Tonneslan, Christian Lorentzen, Christian Veenhuis, Christian Yoon, Christine P. Chai, CipherCat, clijo, Colin Watson, C. Titus Brown, cui, Daniel Agyapong, Daniel Herrera-Esposito, Daniel R. Cassar, danilo-silva-ufsc, Dan Schult, david-cortes-intel, Dea María Léon, Dhruv Sharma, DhyeyTeraiya, Dimitri Papadopoulos Orfanos, Dmitry Kobak, EdenRochmanSharabi, eeshsaxena, Elizabeth DuPre, Emily (Xinyi) Chen, Eric Prestat, ethanglaser, fabianhenning, fhoehle, Florian Bourgey, François Paugam, Gaetan, Gaétan de Castellane, GarimaGarg222, GAUTAM V DATLA, Guillaume Lemaitre, Harsh Kumar Singh, Hashirama Senju, holodata-ej, Ho Yin Chau, imKartik5451, Isaacc, Itamar Turner-Trauring, Jake Blitch, Jake Vanderplas, James Dean, James Lamb, Jérémie du Boisberranger, Jim Crist-Harif, John Hendricks, Junteng Li, Karthik, Kiyarash Fazeli, Kropiunig, Kunle, Lev, Levente Csibi, Lisa, Loic Esteve, Lucas Colley, Lucas Oliveira, Lucy Liu, Luke Brace, Marco Edward Gorelli, marikabergengren, Martina Cvincekova, Matthias De Lozzo, Mohammad Ahmadullah Khan, Nguyen Cat Luong, Nicolas Salvy, Nikita, Nithurshen, Olivier Grisel, Omar Salman, pavitra danappa byali, pomrakna, prakritim01, Quentin Barthélemy, Ralf Gommers, Ram, Remi Gau, Reshama Shaikh, Riya Jha, Robert Pollak, Roman Yurchak, Rudrendu Paul, Samuel O. Ronsin, Sarvesh V, sauravyadav1008, Sepuri Sai Krishna, Seyi Kuforiji, Shadow_Lu, shifanaaaa, Shruti Nath, Shubhan Chari, Shyan Paul, Simon-Martin Schröder, Sophia Houhamdi, Stanislav Terliakov, Stefanie Senger, Taoufik KEHAL, Tejas, TejasAnalyst, Thomas J. Fan, Thomas Moreau, Thomas S., Tim Head, Tweezky66, Unique Shrestha, Varun Agnihotri, Vashita, vashita-pandey, Veer Tiwari, Virgil Chan, Wiktor Olszowy, Xiao Yuan, Yann Lechelle, Yin Li