Version 1.5¶
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.5.0¶
In Development
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.
Functions:
sklearn.metrics.r2_scorenow supports Array API compliant inputs. #27904 by Eric Lindgren,Franck Charras <fcharras>,Olivier Grisel <ogrisel>andTim Head <betatim>.
Classes:
Support for building with Meson¶
Meson is now supported as a build backend, see Building with Meson for more details.
TODO Fill more details before the 1.5 release, when the Meson story has settled down.
Metadata Routing¶
The following models now support metadata routing in one or more or their methods. Refer to the Metadata Routing User Guide for more details.
Feature
impute.IterativeImputernow supports metadata routing in itsfitmethod. #28187 by Stefanie Senger.Feature
ensemble.BaggingClassifierandensemble.BaggingRegressornow support metadata routing. The fit methods now accept**fit_paramswhich are passed to the underlying estimators via theirfitmethods. #28432 by Adam Li and Benjamin Bossan.Feature
linear_model.RidgeCVandlinear_model.RidgeClassifierCVnow support metadata routing in theirfitmethod and route metadata to the underlyingmodel_selection.GridSearchCVobject or the underlying scorer. #27560 by Omar Salman.
Metadata Routing¶
The following models now support metadata routing in one or more or their methods. Refer to the Metadata Routing User Guide for more details.
Feature
linear_model.RANSACRegressornow supports metadata routing in itsfit,scoreandpredictmethods and route metadata to its underlying estimator’s’fit,scoreandpredictmethods. #28261 by Stefanie Senger.Feature
ensemble.VotingClassifierandensemble.VotingRegressornow support metadata routing and pass**fit_paramsto the underlying estimators via theirfitmethods. #27584 by Stefanie Senger.Feature
pipeline.FeatureUnionnow supports metadata routing in itsfitandfit_transformmethods and route metadata to the underlying transformers’fitandfit_transform. #28205 by Stefanie Senger.
Changelog¶
sklearn.cluster¶
Fix Create copy of precomputed sparse matrix within the
fitmethod ofOPTICSto avoid in-place modification of the sparse matrix. #28491 by Thanh Lam Dang.
sklearn.compose¶
Feature A fitted
compose.ColumnTransformernow implements__getitem__which returns the fitted transformers by name. #27990 by Thomas Fan.Enhancement
compose.TransformedTargetRegressornow raises an error infitif onlyinverse_funcis provided withoutfunc(that would default to identity) being explicitly set as well. #28483 by Stefanie Senger.
sklearn.datasets¶
Enhancement Adds optional arguments
n_retriesanddelayto functionsdatasets.fetch_20newsgroups,datasets.fetch_20newsgroups_vectorized,datasets.fetch_california_housing,datasets.fetch_covtype,datasets.fetch_kddcup99,datasets.fetch_lfw_pairs,datasets.fetch_lfw_people,datasets.fetch_olivetti_faces,datasets.fetch_rcv1, anddatasets.fetch_species_distributions. By default, the functions will retry up to 3 times in case of network failures. #28160 by Zhehao Liu and Filip Karlo Došilović.
sklearn.decomposition¶
Enhancement
PCAnow automatically selects the ARPACK solver for sparse inputs whensvd_solver="auto"instead of raising an error. #28498 by Thanh Lam Dang.
sklearn.dummy¶
Enhancement
dummy.DummyClassifieranddummy.DummyRegressornow have then_features_in_andfeature_names_in_attributes afterfit. #27937 by Marco vd Boom.
sklearn.ensemble¶
Efficiency Improves runtime of
predictofensemble.HistGradientBoostingClassifierby avoiding to callpredict_proba. #27844 by Christian Lorentzen.Efficiency
ensemble.HistGradientBoostingClassifierandensemble.HistGradientBoostingRegressorare now a tiny bit faster by pre-sorting the data before finding the thresholds for binning. #28102 by Christian Lorentzen.
sklearn.feature_extraction¶
Efficiency
feature_extraction.text.TfidfTransformeris now faster and more memory-efficient by using a NumPy vector instead of a sparse matrix for storing the inverse document frequency. #18843 by Paolo Montesel.Enhancement
feature_extraction.text.TfidfTransformernow preserves the data type of the input matrix if it isnp.float64ornp.float32. #28136 by Guillaume Lemaitre.
sklearn.feature_selection¶
Enhancement
feature_selection.mutual_info_regressionandfeature_selection.mutual_info_classifnow supportn_jobsparameter. #28085 by Neto Menoci and Florin Andrei.
sklearn.impute¶
Enhancement
impute.SimpleImputernow supports custom strategies by passing a function in place of a strategy name. #28053 by Mark Elliot.
sklearn.linear_model¶
Fix
linear_model.ElasticNet,linear_model.ElasticNetCV,linear_model.Lassoandlinear_model.LassoCVnow explicitly don’t accept large sparse data formats. #27576 by Stefanie Senger.API Change
linear_model.RidgeCVandlinear_model.RidgeClassifierCVwill now allowalpha=0whencv != None, which is consistent withlinear_model.Ridgeandlinear_model.RidgeClassifier. #28425 by Lucy Liu.Fix
linear_model.RidgeCVandRidgeClassifierCVcorrectly passsample_weightto the underlying scorer whencvis None. #27560 by Omar Salman.Fix
n_nonzero_coefs_attribute inlinear_model.OrthogonalMatchingPursuitwill now always beNonewhentolis set, asn_nonzero_coefsis ignored in this case. #28557 by Lucy Liu.API Change Passing
average=0to disable averaging is deprecated inlinear_model.PassiveAggressiveClassifier,linear_model.PassiveAggressiveRegressor,linear_model.SGDClassifier,linear_model.SGDRegressorandlinear_model.SGDOneClassSVM. Passaverage=Falseinstead. #28582 by Jérémie du Boisberranger.
sklearn.manifold¶
API Change Deprecates
n_iterin favor ofmax_iterinmanifold.TSNE.n_iterwill be removed in version 1.7. This makesmanifold.TSNEconsistent with the rest of the estimators. #28471 by Lucy Liu
sklearn.metrics¶
Feature
metrics.pairwise_distancesaccepts calculating pairwise distances for non-numeric arrays as well. This is supported through custom metrics only. #27456 by Venkatachalam N, Kshitij Mathur and Julian Libiseller-Egger.Efficiency Improve efficiency of functions
brier_score_loss,calibration_curve,det_curve,precision_recall_curve,roc_curvewhenpos_labelargument is specified. Also improve efficiency of methodsfrom_estimatorandfrom_predictionsinRocCurveDisplay,PrecisionRecallDisplay,DetCurveDisplay,CalibrationDisplay. #28051 by Pierre de Fréminville.Feature
sklearn.metrics.check_scoringnow returns a multi-metric scorer whenscoringas adict,set,tuple, orlist. #28360 by Thomas Fan.API Change
metrics.precision_recall_curvedeprecated the keyword argumentprobas_predin favor ofy_score.probas_predwill be removed in version 1.7. #28092 by Adam Li.API Change
metrics.brier_score_lossdeprecated the keyword argumenty_probin favor ofy_proba.y_probwill be removed in version 1.7. #28092 by Adam Li.
sklearn.model_selection¶
Enhancement CV splitters that ignores the group parameter now raises a warning when groups are passed in to split. #28210 by
Fix the
cv_results_attribute (ofmodel_selection.GridSearchCV) now returns masked arrays of the appropriate NumPy dtype, as opposed to always returning dtypeobject. #28352 by Marco Gorelli.Fix
sklearn.model_selection.train_test_scoreworks with Array API inputs. Previously indexing was not handled correctly leading to exceptions when using strict implementations of the Array API like CuPY. #28407 byTim Head <betatim>.
sklearn.multioutput¶
sklearn.pipeline¶
Feature
pipeline.FeatureUnioncan now use theverbose_feature_names_outattribute. IfTrue,get_feature_names_outwill prefix all feature names with the name of the transformer that generated that feature. IfFalse,get_feature_names_outwill not prefix any feature names and will error if feature names are not unique. #25991 by Jiawei Zhang.
sklearn.preprocessing¶
Enhancement
preprocessing.QuantileTransformerandpreprocessing.quantile_transformnow supports disabling subsampling explicitly. #27636 by Ralph Urlus.
sklearn.tree¶
Enhancement Plotting trees in matplotlib via
tree.plot_treenow show a “True/False” label to indicate the directionality the samples traverse given the split condition. #28552 by Adam Li.
Code and documentation contributors
Thanks to everyone who has contributed to the maintenance and improvement of the project since version 1.4, including:
TODO: update at the time of the release.