Version 1.6
scikit-learn Docs · نسخهٔ 5e9184e53cd3 · BSD-3-Clause
===========
Version 1.6
For a short description of the main highlights of the release, please refer to sphx_glr_auto_examples_release_highlights_plot_release_highlights_1_6_0.py.
Version 1.6.1
January 2025
Changed models
- |Fix| The
tags.input_tags.sparseflag was corrected for a majority of estimators.
By Antoine Baker <antoinebaker> 30187
Changes impacting many modules
- |Fix|
_more_tags,_get_tags, and_safe_tagsare now raising a
DeprecationWarning instead of a FutureWarning to only notify developers instead of end-users. By Guillaume Lemaitre <glemaitre> in 30573
:mod:sklearn.metrics
- |Fix| Fix regression when scikit-learn metric called on PyTorch CPU tensors would
raise an error (with array API dispatch disabled which is the default). By Loïc Estève <lesteve> 30454
:mod:sklearn.model_selection
- |Fix|
~model_selection.cross_validate,~model_selection.cross_val_predict,
and ~model_selection.cross_val_score now accept params=None when metadata routing is enabled. By Adrin Jalali_ 30451
:mod:sklearn.tree
- |Fix| Use
log2instead oflnfor building trees to maintain behavior of previous
versions. By Thomas Fan_ 30557
:mod:sklearn.utils
- |Enhancement|
utils.estimator_checks.check_estimator_sparse_tagensures that
the estimator tag input_tags.sparse is consistent with its fit method (accepting sparse input X or raising the appropriate error). By Antoine Baker <antoinebaker> 30187
- |Fix| Raise a
DeprecationWarningwhen there is no concrete implementation of__sklearn_tags__
in the MRO of the estimator. We request to inherit from BaseEstimator that implements __sklearn_tags__. By Guillaume Lemaitre <glemaitre> 30516
Version 1.6.0
December 2024
Changes impacting many modules
- |Enhancement|
__sklearn_tags__was introduced for setting tags in estimators.
More details in estimator_tags. By Thomas Fan <thomasjpfan> and Adrin Jalali <adrinjalali> 29677
- |Enhancement| Scikit-learn classes and functions can be used while only having a
import sklearn import line. For example, import sklearn; sklearn.svm.SVC() now works. By Thomas Fan <thomasjpfan> 29793
- |Fix| Classes
metrics.ConfusionMatrixDisplay,
metrics.RocCurveDisplay, calibration.CalibrationDisplay, metrics.PrecisionRecallDisplay, metrics.PredictionErrorDisplay and inspection.PartialDependenceDisplay now properly handle Matplotlib aliases for style parameters (e.g., c and color, ls and linestyle, etc). By Joseph Barbier <JosephBARBIERDARNAL> 30023
- |API|
utils.validation.validate_datais introduced and replaces previously
private base.BaseEstimator._validate_data method. This is intended for third party estimator developers, who should use this function in most cases instead of utils.check_array and utils.check_X_y. By Adrin Jalali <adrinjalali> 29696
Support for Array API
Additional estimators and functions have been updated to include support for all Array API <https://data-apis.org/array-api/latest/>_ compliant inputs.
See array_api for more details.
- |Feature|
model_selection.GridSearchCV,
model_selection.RandomizedSearchCV, model_selection.HalvingGridSearchCV and model_selection.HalvingRandomSearchCV now support Array API compatible inputs when their base estimators do. By Tim Head <betatim> and Olivier Grisel <ogrisel> 27096
- |Feature|
sklearn.metrics.f1_scorenow supports Array API compatible
inputs. By Omar Salman <OmarManzoor> 27369
- |Feature|
preprocessing.LabelEncodernow supports Array API compatible inputs.
By Omar Salman <OmarManzoor> 27381
- |Feature|
sklearn.metrics.mean_absolute_errornow supports Array API compatible
inputs. By Edoardo Abati <EdAbati> 27736
- |Feature|
sklearn.metrics.mean_tweedie_deviancenow supports Array API
compatible inputs. By Thomas Li <lithomas1> 28106
- |Feature|
sklearn.metrics.pairwise.cosine_similaritynow supports Array API
compatible inputs. By Edoardo Abati <EdAbati> 29014
- |Feature|
sklearn.metrics.pairwise.paired_cosine_distancesnow supports Array
API compatible inputs. By Edoardo Abati <EdAbati> 29112
- |Feature|
sklearn.metrics.cluster.entropynow supports Array API compatible
inputs. By Yaroslav Korobko <Tialo> 29141
- |Feature|
sklearn.metrics.mean_squared_errornow supports Array API compatible
inputs. By Yaroslav Korobko <Tialo> 29142
- |Feature|
sklearn.metrics.pairwise.additive_chi2_kernelnow supports Array API
compatible inputs. By Yaroslav Korobko <Tialo> 29144
- |Feature|
sklearn.metrics.d2_tweedie_scorenow supports Array API compatible
inputs. By Emily Chen <EmilyXinyi> 29207
- |Feature|
sklearn.metrics.max_errornow supports Array API compatible inputs.
By Edoardo Abati <EdAbati> 29212
- |Feature|
sklearn.metrics.mean_poisson_deviancenow supports Array API
compatible inputs. By Emily Chen <EmilyXinyi> 29227
- |Feature|
sklearn.metrics.mean_gamma_deviancenow supports Array API compatible
inputs. By Emily Chen <EmilyXinyi> 29239
- |Feature|
sklearn.metrics.pairwise.cosine_distancesnow supports Array API
compatible inputs. By Emily Chen <EmilyXinyi> 29265
- |Feature|
sklearn.metrics.pairwise.chi2_kernelnow supports Array API
compatible inputs. By Yaroslav Korobko <Tialo> 29267
- |Feature|
sklearn.metrics.mean_absolute_percentage_errornow supports Array API
compatible inputs. By Emily Chen <EmilyXinyi> 29300
- |Feature|
sklearn.metrics.pairwise.paired_euclidean_distancesnow supports
Array API compatible inputs. By Emily Chen <EmilyXinyi> 29389
- |Feature|
sklearn.metrics.pairwise.euclidean_distancesand
sklearn.metrics.pairwise.rbf_kernel now support Array API compatible inputs. By Omar Salman <OmarManzoor> 29433
- |Feature|
sklearn.metrics.pairwise.linear_kernel,
sklearn.metrics.pairwise.sigmoid_kernel, and sklearn.metrics.pairwise.polynomial_kernel now support Array API compatible inputs. By Omar Salman <OmarManzoor> 29475
- |Feature|
sklearn.metrics.mean_squared_log_errorand
sklearn.metrics.root_mean_squared_log_error now support Array API compatible inputs. By Virgil Chan <virchan> 29709
- |Feature|
preprocessing.MinMaxScalerwithclip=Truenow supports Array API
compatible inputs. By Shreekant Nandiyawar <Shree7676> 29751
- Support for the soon to be deprecated
cupy.array_apimodule has been
removed in favor of directly supporting the top level cupy module, possibly via the array_api_compat.cupy compatibility wrapper. By Olivier Grisel <ogrisel> 29639
Metadata routing
Refer to the Metadata Routing User Guide <metadata_routing> for more details.
- |Feature|
semi_supervised.SelfTrainingClassifier
now supports metadata routing. The fit method now accepts `**fit_params which are passed to the underlying estimators via their fit methods. In addition, the ~semi_supervised.SelfTrainingClassifier.predict, ~semi_supervised.SelfTrainingClassifier.predict_proba, ~semi_supervised.SelfTrainingClassifier.predict_log_proba, ~semi_supervised.SelfTrainingClassifier.score and ~semi_supervised.SelfTrainingClassifier.decision_function methods also accept **params which are passed to the underlying estimators via their respective methods. By Adam Li <adam2392> 28494`
- |Feature|
ensemble.StackingClassifierand
ensemble.StackingRegressor now support metadata routing and pass `**fit_params to the underlying estimators via their fit methods. By Stefanie Senger <StefanieSenger> 28701`
- |Feature|
model_selection.learning_curvenow supports metadata routing for the
fit method of its estimator and for its underlying CV splitter and scorer. By Stefanie Senger <StefanieSenger> 28975
- |Feature|
compose.TransformedTargetRegressornow supports metadata
routing in its ~compose.TransformedTargetRegressor.fit and ~compose.TransformedTargetRegressor.predict methods and routes the corresponding params to the underlying regressor. By Omar Salman <OmarManzoor> 29136
- |Feature|
feature_selection.SequentialFeatureSelectornow supports
metadata routing in its fit method and passes the corresponding params to the model_selection.cross_val_score function. By Omar Salman <OmarManzoor> 29260
- |Feature|
model_selection.permutation_test_scorenow supports metadata routing
for the fit method of its estimator and for its underlying CV splitter and scorer. By Adam Li <adam2392> 29266
- |Feature|
feature_selection.RFEandfeature_selection.RFECV
now support metadata routing. By Omar Salman <OmarManzoor> 29312
- |Feature|
model_selection.validation_curvenow supports metadata routing for
the fit method of its estimator and for its underlying CV splitter and scorer. By Stefanie Senger <StefanieSenger> 29329
- |Fix| Metadata is routed correctly to grouped CV splitters via
linear_model.RidgeCV and linear_model.RidgeClassifierCV and UnsetMetadataPassedError is fixed for linear_model.RidgeClassifierCV with default scoring. By Stefanie Senger <StefanieSenger> 29634
- |Fix| Many method arguments which shouldn't be included in the routing mechanism are
now excluded and the set_{method}_request methods are not generated for them. By Adrin Jalali_ 29920
Dropping official support for PyPy
Due to limited maintainer resources and small number of users, official PyPy support has been dropped. Some parts of scikit-learn may still work but PyPy is not tested anymore in the scikit-learn Continuous Integration. By Loïc Estève <lesteve> 29128
Dropping support for building with setuptools
From scikit-learn 1.6 onwards, support for building with setuptools has been removed. Meson is the only supported way to build scikit-learn. By Loïc Estève <lesteve> 29400
Free-threaded CPython 3.13 support
scikit-learn has preliminary support for free-threaded CPython, in particular free-threaded wheels are available for all of our supported platforms.
Free-threaded (also known as nogil) CPython 3.13 is an experimental version of CPython 3.13 which aims at enabling efficient multi-threaded use cases by removing the Global Interpreter Lock (GIL).
For more details about free-threaded CPython see py-free-threading doc <https://py-free-threading.github.io>_, in particular how to install a free-threaded CPython <https://py-free-threading.github.io/installing_cpython/>_ and Ecosystem compatibility tracking <https://py-free-threading.github.io/tracking/>_.
Feel free to try free-threaded on your use case and report any issues!
By Loïc Estève <lesteve> and many other people in the wider Scientific Python and CPython ecosystem, for example Nathan Goldbaum <ngoldbaum>, Ralf Gommers <rgommers>, Edgar Andrés Margffoy Tuay <andfoy>. 30360
:mod:sklearn.base
- |Enhancement| Added a function
base.is_clustererwhich determines whether a given
estimator is of category clusterer. By Christian Veenhuis <ChVeen> 28936
- |API| Passing a class object to
~sklearn.base.is_classifier,
~sklearn.base.is_regressor, and ~sklearn.base.is_outlier_detector is now deprecated. Pass an instance instead. By Adrin Jalali_ 30122
:mod:sklearn.calibration
- |API|
cv="prefit"is deprecated for~sklearn.calibration.CalibratedClassifierCV.
Use ~sklearn.frozen.FrozenEstimator instead, as CalibratedClassifierCV(FrozenEstimator(estimator)). By Adrin Jalali_ 30171
:mod:sklearn.cluster
- |API| The
copyparameter ofcluster.Birchwas deprecated in 1.6 and will be
removed in 1.8. It has no effect as the estimator does not perform in-place operations on the input data. By Yao Xiao <Charlie-XIAO> 29124
:mod:sklearn.compose
- |Enhancement|
sklearn.compose.ColumnTransformerverbose_feature_names_out
now accepts string format or callable to generate feature names. By Marc Bresson <MarcBresson> 28934
:mod:sklearn.covariance
- |Efficiency|
covariance.MinCovDetfitting is now slightly faster.
By Antony Lee <anntzer> 29835
:mod:sklearn.cross_decomposition
- |Fix|
cross_decomposition.PLSRegressionproperly raises an error when
n_components is larger than n_samples. By Thomas Fan <thomasjpfan> 29710
:mod:sklearn.datasets
- |Feature|
datasets.fetch_fileallows downloading arbitrary data-file
from the web. It handles local caching, integrity checks with SHA256 digests and automatic retries in case of HTTP errors. By Olivier Grisel <ogrisel> 29354
:mod:sklearn.decomposition
- |Enhancement|
~sklearn.decomposition.LatentDirichletAllocationnow has a
`normalize parameter in ~sklearn.decomposition.LatentDirichletAllocation.transform and ~sklearn.decomposition.LatentDirichletAllocation.fit_transform methods to control whether the document topic distribution is normalized. By Adrin Jalali_ 30097`
- |Fix|
~sklearn.decomposition.IncrementalPCA
will now only raise a `ValueError when the number of samples in the input data to partial_fit is less than the number of components on the first call to partial_fit. Subsequent calls to partial_fit no longer face this restriction. By Thomas Gessey-Jones <ThomasGesseyJonesPX> 30224`
:mod:sklearn.discriminant_analysis
- |Fix|
discriminant_analysis.QuadraticDiscriminantAnalysis
will now cause LinAlgWarning in case of collinear variables. These errors can be silenced using the reg_param attribute. By Alihan Zihna <azihna> 19731
:mod:sklearn.ensemble
- |Feature|
ensemble.ExtraTreesClassifierand
ensemble.ExtraTreesRegressor now support missing-values in the data matrix X. Missing-values are handled by randomly moving all of the samples to the left, or right child node as the tree is traversed. By Adam Li <adam2392> 28268
- |Efficiency| Small runtime improvement of fitting
ensemble.HistGradientBoostingClassifier and ensemble.HistGradientBoostingRegressor by parallelizing the initial search for bin thresholds. By Christian Lorentzen <lorentzenchr> 28064
- |Efficiency|
ensemble.IsolationForestnow runs parallel jobs
during predict offering a speedup of up to 2-4x on sample sizes larger than 2000 using joblib. By Adam Li <adam2392> and Sérgio Pereira <sergiormpereira> 28622
- |Enhancement| The verbosity of
ensemble.HistGradientBoostingClassifier
and ensemble.HistGradientBoostingRegressor got a more granular control. Now, verbose = 1 prints only summary messages, verbose >= 2 prints the full information as before. By Christian Lorentzen <lorentzenchr> 28179
- |API| The parameter
algorithmofensemble.AdaBoostClassifieris deprecated
and will be removed in 1.8. By Jérémie du Boisberranger <jeremiedbb> 29997
:mod:sklearn.feature_extraction
- |Fix|
feature_extraction.text.TfidfVectorizernow correctly preserves the
dtype of idf_ based on the input data. By Guillaume Lemaitre <glemaitre> 30022
:mod:sklearn.frozen
- |MajorFeature|
~sklearn.frozen.FrozenEstimatoris now introduced which allows
freezing an estimator. This means calling .fit on it has no effect, and doing a clone(frozenestimator) returns the same estimator instead of an unfitted clone. 29705 By Adrin Jalali_ 29705
:mod:sklearn.impute
- |Fix|
impute.KNNImputerexcludes samples with nan distances when
computing the mean value for uniform weights. By Xuefeng Xu <xuefeng-xu> 29135
- |Fix| When
min_valueandmax_valueare array-like and some features are dropped due to
keep_empty_features=False, impute.IterativeImputer no longer raises an error and now indexes correctly. By Guntitat Sawadwuthikul <gunsodo> 29451
- |Fix| Fixed
impute.IterativeImputerto make sure that it does not skip
the iterative process when keep_empty_features is set to True. By Arif Qodari <arifqodari> 29779
- |API| Add a warning in
impute.SimpleImputerwhenkeep_empty_feature=Falseand
strategy="constant". In this case empty features are not dropped and this behaviour will change in 1.8. By Arthur Courselle <ArthurCourselle> and Simon Riou <simon-riou> 29950
:mod:sklearn.linear_model
- |Enhancement| The
solver="newton-cholesky"in
linear_model.LogisticRegression and linear_model.LogisticRegressionCV is extended to support the full multinomial loss in a multiclass setting. By Christian Lorentzen <lorentzenchr> 28840
- |Fix| In
linear_model.Ridgeandlinear_model.RidgeCV, afterfit,
the coef_ attribute is now of shape (n_samples,) like other linear models. By Maxwell Liu<MaxwellLZH>, Guillaume Lemaitre_, and Adrin Jalali_ 19746
- |Fix|
linear_model.LogisticRegressionCVcorrects sample weight handling
for the calculation of test scores. By Shruti Nath <snath-xoc> 29419
- |Fix|
linear_model.LassoCVandlinear_model.ElasticNetCVnow
take sample weights into accounts to define the search grid for the internally tuned alpha hyper-parameter. By John Hopfensperger <s-banach> and Shruti Nath <snath-xoc> 29442
- |Fix|
linear_model.LogisticRegression,linear_model.PoissonRegressor,
linear_model.GammaRegressor, linear_model.TweedieRegressor now take sample weights into account to decide when to fall back to solver='lbfgs' whenever solver='newton-cholesky' becomes numerically unstable. By Antoine Baker <antoinebaker> 29818
- |Fix|
linear_model.RidgeCVnow properly uses predictions on the same scale as
the target seen during fit. These predictions are stored in cv_results_ when scoring != None. Previously, the predictions were rescaled by the square root of the sample weights and offset by the mean of the target, leading to an incorrect estimate of the score. By Guillaume Lemaitre <glemaitre>, Jérôme Dockes <jeromedockes> and Hanmin Qin <qinhanmin2014> 29842
- |Fix|
linear_model.RidgeCVnow properly supports custom multioutput scorers
by letting the scorer manage the multioutput averaging. Previously, the predictions and true targets were both squeezed to a 1D array before computing the error. By Guillaume Lemaitre <glemaitre> 29884
- |Fix|
linear_model.LinearRegressionnow sets thecondparameter when
calling the scipy.linalg.lstsq solver on dense input data. This ensures more numerically robust results on rank-deficient data. In particular, it empirically fixes the expected equivalence property between fitting with reweighted or with repeated data points. By Antoine Baker <antoinebaker> 30040
- |Fix|
linear_model.LogisticRegressionand other linear models that
accept solver="newton-cholesky" now report the correct number of iterations when they fall back to the "lbfgs" solver because of a rank deficient Hessian matrix. By Olivier Grisel <ogrisel> 30100
- |Fix|
~sklearn.linear_model.SGDOneClassSVMnow correctly inherits from
~sklearn.base.OutlierMixin and the tags are correctly set. By Guillaume Lemaitre <glemaitre> 30227
- |API| Deprecates
copy_Xinlinear_model.TheilSenRegressoras the parameter
has no effect. copy_X will be removed in 1.8. By Adam Li <adam2392> 29105
:mod:sklearn.manifold
- |Efficiency|
manifold.locally_linear_embeddingand
manifold.LocallyLinearEmbedding now allocate more efficiently the memory of sparse matrices in the Hessian, Modified and LTSA methods. By Giorgio Angelotti <giorgioangel> 28096
:mod:sklearn.metrics
- |Efficiency|
sklearn.metrics.classification_reportis now faster by caching
classification labels. By Adrin Jalali <adrinjalali> 29738
- |Enhancement|
metrics.RocCurveDisplay.from_estimator,
metrics.RocCurveDisplay.from_predictions, metrics.PrecisionRecallDisplay.from_estimator, and metrics.PrecisionRecallDisplay.from_predictions now accept a new keyword despine to remove the top and right spines of the plot in order to make it clearer. By Yao Xiao <Charlie-XIAO> 26367
- |Enhancement|
sklearn.metrics.check_scoringnow acceptsraise_excto specify
whether to raise an exception if a subset of the scorers in multimetric scoring fails or to return an error code. By Stefanie Senger <StefanieSenger> 28992
- |Fix|
metrics.roc_auc_scorewill now correctly return np.nan and
warn user if only one class is present in the labels. By Hleb Levitski <glevv> and Janez Demšar <janezd> 27412, 30013
- |Fix| The functions
metrics.mean_squared_log_errorand
metrics.root_mean_squared_log_error now check whether the inputs are within the correct domain for the function y=\log(1+x), rather than y=\log(x). The functions metrics.mean_absolute_error, metrics.mean_absolute_percentage_error, metrics.mean_squared_error and metrics.root_mean_squared_error now explicitly check whether a scalar will be returned when multioutput=uniform_average. By Virgil Chan <virchan> 29709
- |API| The
assert_all_finiteparameter of functions
metrics.pairwise.check_pairwise_arrays and metrics.pairwise_distances is renamed into ensure_all_finite. force_all_finite will be removed in 1.8. By Jérémie du Boisberranger <jeremiedb> 29404
- |API|
scoring="neg_max_error"should be used instead ofscoring="max_error"
which is now deprecated. By Farid "Freddie" Taba <artificialfintelligence> 29462
- |API| The default value of the
response_methodparameter of
metrics.make_scorer will change from None to "predict" and None will be removed in 1.8. In the meantime, None is equivalent to "predict". By Jérémie du Boisberranger <jeremiedb> 30001
:mod:sklearn.model_selection
- |Enhancement|
~model_selection.GroupKFoldnow has the ability to shuffle groups into
different folds when shuffle=True. By Zachary Vealey <zvealey> 28519
- |Enhancement| There is no need to call
fiton a
~sklearn.model_selection.FixedThresholdClassifier if the underlying estimator is already fitted. By Adrin Jalali <adrinjalali> 30172
- |Fix| Improve error message when
model_selection.RepeatedStratifiedKFold.split
is called without a y argument By Anurag Varma <Anurag-Varma> 29402
:mod:sklearn.neighbors
- |Enhancement|
neighbors.NearestNeighbors,
neighbors.KNeighborsClassifier, neighbors.KNeighborsRegressor, neighbors.RadiusNeighborsClassifier, neighbors.RadiusNeighborsRegressor, neighbors.KNeighborsTransformer, neighbors.RadiusNeighborsTransformer, and neighbors.LocalOutlierFactor now work with metric="nan_euclidean", supporting nan inputs. By Carlo Lemos <vitaliset>, Guillaume Lemaitre_, and Adrin Jalali_ 25330
- |Enhancement| Add
neighbors.NearestCentroid.decision_function,
neighbors.NearestCentroid.predict_proba and neighbors.NearestCentroid.predict_log_proba to the neighbors.NearestCentroid estimator class. Support the case when X is sparse and shrinking_threshold is not None in neighbors.NearestCentroid. By Matthew Ning <NoPenguinsLand> 26689
- |Enhancement| Make
predict,predict_proba, andscoreof
neighbors.KNeighborsClassifier and neighbors.RadiusNeighborsClassifier accept X=None as input. In this case predictions for all training set points are returned, and points are not included into their own neighbors. By Dmitry Kobak <dkobak> 30047
- |Fix|
neighbors.LocalOutlierFactorraises a warning in thefitmethod
when duplicate values in the training data lead to inaccurate outlier detection. By Henrique Caroço <HenriqueProj> 28773
:mod:sklearn.neural_network
- |Fix|
neural_network.MLPRegressordoes no longer crash when the model
diverges and that early_stopping is enabled. By Marc Bresson <MarcBresson> 29773
:mod:sklearn.pipeline
- |MajorFeature|
pipeline.Pipelinecan now transform metadata up to the step requiring the
metadata, which can be set using the transform_input parameter. By Adrin Jalali_ 28901
- |Enhancement|
pipeline.Pipelinenow warns about not being fitted before calling methods
that require the pipeline to be fitted. This warning will become an error in 1.8. By Adrin Jalali_ 29868
- |Fix| Fixed an issue with tags and estimator type of
~sklearn.pipeline.Pipeline
when pipeline is empty. This allows the HTML representation of an empty pipeline to be rendered correctly. By Gennaro Daniele Acciaro <gdacciaro> 30203
:mod:sklearn.preprocessing
- |Enhancement| Added
warnoption tohandle_unknownparameter in
preprocessing.OneHotEncoder. By Hleb Levitski <glevv> 28637
- |Enhancement| The HTML representation of
preprocessing.FunctionTransformer
will show the function name in the label. By Yao Xiao <Charlie-XIAO> 29158
- |Fix|
preprocessing.PowerTransformernow usesscipy.special.inv_boxcox
to output nan if the input of BoxCox's inverse is invalid. By Xuefeng Xu <xuefeng-xu> 27875
:mod:sklearn.semi_supervised
- |API|
semi_supervised.SelfTrainingClassifier
deprecated the base_estimator parameter in favor of estimator. By Adam Li <adam2392> 28494
:mod:sklearn.tree
- |Feature|
tree.ExtraTreeClassifierandtree.ExtraTreeRegressornow
support missing-values in the data matrix `X. Missing-values are handled by randomly moving all of the samples to the left, or right child node as the tree is traversed. By Adam Li <adam2392> and Loïc Estève <lesteve> 27966, 30318`
- |Fix| Escape double quotes for labels and feature names when exporting trees to Graphviz
format. By Santiago M. Mola <smola>. 17575
:mod:sklearn.utils
- |Enhancement|
utils.check_arraynow acceptsensure_non_negative
to check for negative values in the passed array, until now only available through calling utils.check_non_negative. By Tamara Atanasoska <tamaraatanasoska> 29540
- |Enhancement|
~sklearn.utils.estimator_checks.check_estimatorand
~sklearn.utils.estimator_checks.parametrize_with_checks now check and fail if the classifier has the tags.classifier_tags.multi_class = False tag but does not fail on multi-class data. By Adrin Jalali_ 29874
- |Enhancement|
utils.validation.check_is_fittednow passes on stateless
estimators. An estimator can indicate it's stateless by setting the requires_fit tag. See estimator_tags for more information. By Adrin Jalali <adrinjalali> 29880
- |Enhancement| Changes to
~utils.estimator_checks.check_estimatorand
~utils.estimator_checks.parametrize_with_checks.
~utils.estimator_checks.check_estimatorintroduces new arguments:
`on_skip, on_fail, and callback` to control the behavior of the check runner. Refer to the API documentation for more details.
- `
generate_only=True` is deprecated in
~utils.estimator_checks.check_estimator. Use ~utils.estimator_checks.estimator_checks_generator instead.
- The `
_xfail_checks` estimator tag is now removed, and now in order to indicate
which tests are expected to fail, you can pass a dictionary to the ~utils.estimator_checks.check_estimator as the `expected_failed_checks parameter. Similarly, the expected_failed_checks parameter in ~utils.estimator_checks.parametrize_with_checks` can be used, which is a callable returning a dictionary of the form::
{ "check_name": "reason to mark this check as xfail", }
By Adrin Jalali_ 30149
- |Fix|
utils.estimator_checks.parametrize_with_checksand
utils.estimator_checks.check_estimator now support estimators that have set_output called on them. By Adrin Jalali <adrinjalali> 29869
- |API| The
assert_all_finiteparameter of functionsutils.check_array,
utils.check_X_y, utils.as_float_array is renamed into ensure_all_finite. force_all_finite will be removed in 1.8. By Jérémie du Boisberranger <jeremiedb> 29404
- |API|
utils.estimator_checks.check_sample_weights_invariance
replaced by utils.estimator_checks.check_sample_weight_equivalence_on_dense_data which uses integer (including zero) weights and utils.estimator_checks.check_sample_weight_equivalence_on_sparse_data which does the same on sparse data. By Antoine Baker <antoinebaker> 29818, 30137
- |API| Using
_estimator_typeto set the estimator type is deprecated. Inherit from
~sklearn.base.ClassifierMixin, ~sklearn.base.RegressorMixin, ~sklearn.base.TransformerMixin, or ~sklearn.base.OutlierMixin instead. Alternatively, you can set estimator_type in ~sklearn.utils.Tags in the __sklearn_tags__ method. By Adrin Jalali_ 30122
Thanks to everyone who has contributed to the maintenance and improvement of the project since version 1.5, including:
Aaron Schumacher, Abdulaziz Aloqeely, abhi-jha, Acciaro Gennaro Daniele, Adam J. Stewart, Adam Li, Adeel Hassan, Adeyemi Biola, Aditi Juneja, Adrin Jalali, Aisha, Akanksha Mhadolkar, Akihiro Kuno, Alberto Torres, alexqiao, Alihan Zihna, Aniruddha Saha, antoinebaker, Antony Lee, Anurag Varma, Arif Qodari, Arthur Courselle, ArthurDbrn, Arturo Amor, Aswathavicky, Audrey Flanders, aurelienmorgan, Austin, awwwyan, AyGeeEm, a.zy.lee, baggiponte, BlazeStorm001, bme-git, Boney Patel, brdav, Brigitta Sipőcz, Cailean Carter, Camille Troillard, Carlo Lemos, Christian Lorentzen, Christian Veenhuis, Christine P. Chai, claudio, Conrad Stevens, datarollhexasphericon, Davide Chicco, David Matthew Cherney, Dea María Léon, Deepak Saldanha, Deepyaman Datta, dependabot[bot], dinga92, Dmitry Kobak, Domenico, Drew Craeton, dymil, Edoardo Abati, EmilyXinyi, Eric Larson, Evelyn, fabianhenning, Farid "Freddie" Taba, Gael Varoquaux, Giorgio Angelotti, Hleb Levitski, Guillaume Lemaitre, Guntitat Sawadwuthikul, Haesun Park, Hanjun Kim, Henrique Caroço, hhchen1105, Hugo Boulenger, Ilya Komarov, Inessa Pawson, Ivan Pan, Ivan Wiryadi, Jaimin Chauhan, Jakob Bull, James Lamb, Janez Demšar, Jérémie du Boisberranger, Jérôme Dockès, Jirair Aroyan, João Morais, Joe Cainey, Joel Nothman, John Enblom, JorgeCardenas, Joseph Barbier, jpienaar-tuks, Julian Chan, K.Bharat Reddy, Kevin Doshi, Lars, Loic Esteve, Lucas Colley, Lucy Liu, lunovian, Marc Bresson, Marco Edward Gorelli, Marco Maggi, Marco Wolsza, Maren Westermann, MarieS-WiMLDS, Martin Helm, Mathew Shen, mathurinm, Matthew Feickert, Maxwell Liu, Meekail Zain, Michael Dawson, Miguel Cárdenas, m-maggi, mrastgoo, Natalia Mokeeva, Nathan Goldbaum, Nathan Orgera, nbrown-ScottLogic, Nikita Chistyakov, Nithish Bolleddula, Noam Keidar, NoPenguinsLand, Norbert Preining, notPlancha, Olivier Grisel, Omar Salman, ParsifalXu, Piotr, Priyank Shroff, Priyansh Gupta, Quentin Barthélemy, Rachit23110261, Rahil Parikh, raisadz, Rajath, renaissance0ne, Reshama Shaikh, Roberto Rosati, Robert Pollak, rwelsch427, Santiago Castro, Santiago M. Mola, scikit-learn-bot, sean moiselle, SHREEKANT VITTHAL NANDIYAWAR, Shruti Nath, Søren Bredlund Caspersen, Stefanie Senger, Stefano Gaspari, Steffen Schneider, Štěpán Sršeň, Sylvain Combettes, Tamara, Thomas, Thomas Gessey-Jones, Thomas J. Fan, Thomas Li, ThorbenMaa, Tialo, Tim Head, Tuhin Sharma, Tushar Parimi, Umberto Fasci, UV, vedpawar2254, Velislav Babatchev, Victoria Shevchenko, viktor765, Vince Carey, Virgil Chan, Wang Jiayi, Xiao Yuan, Xuefeng Xu, Yao Xiao, yareyaredesuyo, Zachary Vealey, Ziad Amerr