Version 0.22.0

In Development

Changed models

The following estimators and functions, when fit with the same data and parameters, may produce different models from the previous version. This often occurs due to changes in the modelling logic (bug fixes or enhancements), or in random sampling procedures.

Details are listed in the changelog below.

(While we are trying to better inform users by providing this information, we cannot assure that this list is complete.)

Changelog

sklearn.base

  • API Change From version 0.24 BaseEstimator.get_params will raise an AttributeError rather than return None for parameters that are in the estimator’s constructor but not stored as attributes on the instance. #14464 by Joel Nothman.

sklearn.calibration

  • Fix Fixed a bug that made calibration.CalibratedClassifierCV fail when given a sample_weight parameter of type list (in the case where sample_weights are not supported by the wrapped estimator). #13575 by William de Vazelhes.

sklearn.compose

sklearn.datasets

sklearn.decomposition

sklearn.dummy

sklearn.ensemble

sklearn.feature_extraction

sklearn.gaussian_process

sklearn.impute

sklearn.inspection

sklearn.kernel_approximation

-Fix Fixed a bug where kernel_approximation.Nystroem raised a

KeyError when using kernel="precomputed". #14706 by Venkatachalam N.

sklearn.linear_model

sklearn.manifold

sklearn.metrics

sklearn.model_selection

sklearn.pipeline

sklearn.svm

  • Enhancement svm.SVC and svm.NuSVC now accept a break_ties parameter. This parameter results in predict breaking the ties according to the confidence values of decision_function, if decision_function_shape='ovr', and the number of target classes > 2. #12557 by Adrin Jalali.

  • Enhancement SVM now throws more specific error when fit on non-square data and kernel = precomputed. svm.BaseLibSVM #14336 by Gregory Dexter.

sklearn.preprocessing

sklearn.cluster

sklearn.feature_selection

  • Fix Fixed a bug where VarianceThreshold with threshold=0 did not remove constant features due to numerical instability, by using range rather than variance in this case. #13704 by Roddy MacSween.

sklearn.utils

  • Enhancement utils.safe_indexing accepts an axis parameter to index array-like across rows and columns. The column indexing can be done on NumPy array, SciPy sparse matrix, and Pandas DataFrame. An additional refactoring was done. #14035 and #14475 by Guillaume Lemaitre <glemaitre>.

  • Feature check_estimator can now generate checks by setting generate_only=True. Previously, running check_estimator will stop when the first check fails. With generate_only=True, all checks can run independently and report the ones that are failing. Read more in rolling_your_own_estimator. #14381 by Thomas Fan.

  • Feature Added a pytest specific decorator, parametrize_with_checks, to parametrize estimator checks for a list of estimators. #14381 by Thomas Fan.

  • API Change requires_positive_X estimator tag (for models that require X to be non-negative) is now used by check_estimator to make sure a proper error message is raised if X contains some negative entries. #14680 by Alex Gramfort.

  • Enhancement utils.safe_sparse_dot works between 3D+ ndarray and sparse matrix. #14538 by Jérémie du Boisberranger.

sklearn.neighbors

sklearn.neural_network

sklearn.cross_decomposition

Miscellaneous

  • API Change Replace manual checks with check_is_fitted. Errors thrown when using a non-fitted estimators are now more uniform. #13013 by Agamemnon Krasoulis.

  • Fix Port lobpcg from SciPy which implement some bug fixes but only available in 1.3+. #13609 by Guillaume Lemaitre.

Changes to estimator checks

These changes mostly affect library developers.

  • Estimators are now expected to raise a NotFittedError if predict or transform is called before fit; previously an AttributeError or ValueError was acceptable. #13013 by by Agamemnon Krasoulis.

  • Fix Added check_transformer_data_not_an_array to checks where missing Fix Added check that pairwise estimators raise error on non-square data #14336 by Gregory Dexter.

  • Enhancement Binary only classifiers are now supported in estimator checks. Such classifiers need to have the binary_only=True estimator tag. #13875 by Trevor Stephens.