Version 0.23

فهرست فصل‌ها دانلود آرشیوناشر

scikit-learn Docs · نسخهٔ 5e9184e53cd3 · BSD-3-Clause

============

Version 0.23

For a short description of the main highlights of the release, please refer to sphx_glr_auto_examples_release_highlights_plot_release_highlights_0_23_0.py.

Version 0.23.2

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.

  • |Fix| `inertia_ attribute of cluster.KMeans` and

cluster.MiniBatchKMeans.

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.cluster ......................

  • |Fix| Fixed a bug in cluster.KMeans where rounding errors could

prevent convergence to be declared when tol=0. 17959 by Jérémie du Boisberranger <jeremiedbb>.

  • |Fix| Fixed a bug in cluster.KMeans and

cluster.MiniBatchKMeans where the reported inertia was incorrectly weighted by the sample weights. 17848 by Jérémie du Boisberranger <jeremiedbb>.

  • |Fix| Fixed a bug in cluster.MeanShift with bin_seeding=True. When

the estimated bandwidth is 0, the behavior is equivalent to bin_seeding=False. 17742 by Jeremie du Boisberranger <jeremiedbb>.

  • |Fix| Fixed a bug in cluster.AffinityPropagation, that

gives incorrect clusters when the array dtype is float32. 17995 by Thomaz Santana <Wikilicious> and Amanda Dsouza <amy12xx>.

sklearn.decomposition ............................

  • |Fix| Fixed a bug in

decomposition.MiniBatchDictionaryLearning.partial_fit which should update the dictionary by iterating only once over a mini-batch. 17433 by Chiara Marmo <cmarmo>.

  • |Fix| Avoid overflows on Windows in

decomposition.IncrementalPCA.partial_fit for large `batch_size and n_samples values. 17985 by Alan Butler <aldee153> and Amanda Dsouza <amy12xx>`.

sklearn.ensemble .......................

  • |Fix| Fixed bug in ensemble.MultinomialDeviance where the

average of logloss was incorrectly calculated as sum of logloss. 17694 by Markus Rempfler <rempfler> and Tsutomu Kusanagi <t-kusanagi2>.

  • |Fix| Fixes ensemble.StackingClassifier and

ensemble.StackingRegressor compatibility with estimators that do not define n_features_in_. 17357 by Thomas Fan_.

sklearn.feature_extraction .................................

  • |Fix| Fixes bug in feature_extraction.text.CountVectorizer where

sample order invariance was broken when max_features was set and features had the same count. 18016 by Thomas Fan_, Roman Yurchak_, and Joel Nothman_.

sklearn.linear_model ...........................

  • |Fix| linear_model.lars_path does not overwrite X when

X_copy=True and Gram='auto'. 17914 by Thomas Fan_.

sklearn.manifold .......................

  • |Fix| Fixed a bug where metrics.pairwise_distances would raise an

error if `metric='seuclidean' and X is not type np.float64. 15730 by Forrest Koch <ForrestCKoch>`.

sklearn.metrics ......................

  • |Fix| Fixed a bug in metrics.mean_squared_error where the

average of multiple RMSE values was incorrectly calculated as the root of the average of multiple MSE values. 17309 by Swier Heeres <swierh>.

sklearn.pipeline .......................

  • |Fix| pipeline.FeatureUnion raises a deprecation warning when

None is included in transformer_list. 17360 by Thomas Fan_.

sklearn.utils ....................

  • |Fix| Fix utils.estimator_checks.check_estimator so that all test

cases support the binary_only estimator tag. 17812 by Bruno Charron <brcharron>.

Version 0.23.1

May 18 2020

Changelog

sklearn.cluster ......................

  • |Efficiency| cluster.KMeans efficiency has been improved for very

small datasets. In particular it cannot spawn idle threads any more. 17210 and 17235 by Jeremie du Boisberranger <jeremiedbb>.

  • |Fix| Fixed a bug in cluster.KMeans where the sample weights

provided by the user were modified in place. 17204 by Jeremie du Boisberranger <jeremiedbb>.

Miscellaneous .............

  • |Fix| Fixed a bug in the repr of third-party estimators that use a

**kwargs parameter in their constructor, when changed_only is True which is now the default. 17205 by Nicolas Hug_.

Version 0.23.0

May 12 2020

Enforcing keyword-only arguments

In an effort to promote clear and non-ambiguous use of the library, most constructor and function parameters are now expected to be passed as keyword arguments (i.e. using the param=value syntax) instead of positional. To ease the transition, a FutureWarning is raised if a keyword-only parameter is used as positional. In version 1.0 (renaming of 0.25), these parameters will be strictly keyword-only, and a TypeError will be raised. 15005 by Joel Nothman_, Adrin Jalali_, Thomas Fan_, and Nicolas Hug_. See SLEP009 <https://scikit-learn-enhancement-proposals.readthedocs.io/en/latest/slep009/proposal.html>_ for more details.

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.

  • |Fix| ensemble.BaggingClassifier, ensemble.BaggingRegressor,

and ensemble.IsolationForest.

  • |Fix| cluster.KMeans with `algorithm="elkan"` and

`algorithm="full"`.

  • |Fix| cluster.Birch
  • |Fix| compose.ColumnTransformer.get_feature_names
  • |Fix| compose.ColumnTransformer.fit
  • |Fix| datasets.make_multilabel_classification
  • |Fix| decomposition.PCA with n_components='mle'
  • |Enhancement| decomposition.NMF and

decomposition.non_negative_factorization with float32 dtype input.

  • |Fix| decomposition.KernelPCA.inverse_transform
  • |API| ensemble.HistGradientBoostingClassifier and

ensemble.HistGradientBoostingRegressor

  • |Fix| `estimator_samples_ in ensemble.BaggingClassifier`,

ensemble.BaggingRegressor and ensemble.IsolationForest

  • |Fix| ensemble.StackingClassifier and

ensemble.StackingRegressor with sample_weight

  • |Fix| gaussian_process.GaussianProcessRegressor
  • |Fix| linear_model.RANSACRegressor with `sample_weight`.
  • |Fix| linear_model.RidgeClassifierCV
  • |Fix| metrics.mean_squared_error with squared and

multioutput='raw_values'.

  • |Fix| metrics.mutual_info_score with negative scores.
  • |Fix| metrics.confusion_matrix with zero length y_true and y_pred
  • |Fix| neural_network.MLPClassifier
  • |Fix| preprocessing.StandardScaler with partial_fit and sparse

input.

  • |Fix| preprocessing.Normalizer with norm='max'
  • |Fix| Any model using the svm.libsvm or the svm.liblinear solver,

including svm.LinearSVC, svm.LinearSVR, svm.NuSVC, svm.NuSVR, svm.OneClassSVM, svm.SVC, svm.SVR, linear_model.LogisticRegression.

  • |Fix| tree.DecisionTreeClassifier, tree.ExtraTreeClassifier and

ensemble.GradientBoostingClassifier as well as `predict method of tree.DecisionTreeRegressor, tree.ExtraTreeRegressor, and ensemble.GradientBoostingRegressor and read-only float32 input in predict, decision_path and predict_proba`.

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

.. Entries should be grouped by module (in alphabetic order) and prefixed with one of the labels: |MajorFeature|, |Feature|, |Efficiency|, |Enhancement|,

FixorAPI(see whats_new.rst for descriptions).

Entries should be ordered by those labels (e.g. |Fix| after |Efficiency|). Changes not specific to a module should be listed under *Multiple Modules* or *Miscellaneous*. Entries should end with: 123456 by Joe Bloggs <joeongithub>. where 123456 is the *pull request* number, not the issue number.

sklearn.cluster ......................

  • |Efficiency| cluster.Birch implementation of the predict method

avoids high memory footprint by calculating the distances matrix using a chunked scheme. 16149 by Jeremie du Boisberranger <jeremiedbb> and Alex Shacked <alexshacked>.

  • |Efficiency| |MajorFeature| The critical parts of cluster.KMeans

have a more optimized implementation. Parallelism is now over the data instead of over initializations allowing better scalability. 11950 by Jeremie du Boisberranger <jeremiedbb>.

  • |Enhancement| cluster.KMeans now supports sparse data when

solver = "elkan". 11950 by Jeremie du Boisberranger <jeremiedbb>.

  • |Enhancement| cluster.AgglomerativeClustering has a faster and more

memory efficient implementation of single linkage clustering. 11514 by Leland McInnes <lmcinnes>.

  • |Fix| cluster.KMeans with `algorithm="elkan"` now converges with

`tol=0 as with the default algorithm="full". 16075 by Erich Schubert <kno10>`.

  • |Fix| Fixed a bug in cluster.Birch where the n_clusters parameter

could not have a np.int64 type. 16484 by Jeremie du Boisberranger <jeremiedbb>.

  • |Fix| cluster.AgglomerativeClustering add specific error when

distance matrix is not square and affinity=precomputed. 16257 by Simona Maggio <simonamaggio>.

  • |API| The `n_jobs parameter of cluster.KMeans`,

cluster.SpectralCoclustering and cluster.SpectralBiclustering is deprecated. They now use OpenMP based parallelism. For more details on how to control the number of threads, please refer to our parallelism notes. 11950 by Jeremie du Boisberranger <jeremiedbb>.

  • |API| The `precompute_distances parameter of cluster.KMeans` is

deprecated. It has no effect. 11950 by Jeremie du Boisberranger <jeremiedbb>.

  • |API| The `random_state` parameter has been added to

cluster.AffinityPropagation. 16801 by rcwoolston and Chiara Marmo <cmarmo>.

sklearn.compose ......................

  • |Efficiency| compose.ColumnTransformer is now faster when working

with dataframes and strings are used to specific subsets of data for transformers. 16431 by Thomas Fan_.

  • |Enhancement| compose.ColumnTransformer method `get_feature_names`

now supports 'passthrough' columns, with the feature name being either the column name for a dataframe, or 'xi' for column index i. 14048 by Lewis Ball <lrjball>.

  • |Fix| compose.ColumnTransformer method `get_feature_names` now

returns correct results when one of the transformer steps applies on an empty list of columns 15963 by Roman Yurchak_.

  • |Fix| compose.ColumnTransformer.fit will error when selecting

a column name that is not unique in the dataframe. 16431 by Thomas Fan_.

sklearn.datasets .......................

  • |Efficiency| datasets.fetch_openml has reduced memory usage because

it no longer stores the full dataset text stream in memory. 16084 by Joel Nothman_.

  • |Feature| datasets.fetch_california_housing now supports

heterogeneous data using pandas by setting as_frame=True. 15950 by Stephanie Andrews <gitsteph> and Reshama Shaikh <reshamas>.

  • |Feature| embedded dataset loaders datasets.load_breast_cancer,

datasets.load_diabetes, datasets.load_digits, datasets.load_iris, datasets.load_linnerud and datasets.load_wine now support loading as a pandas `DataFrame by setting as_frame=True. 15980 by wconnell and Reshama Shaikh <reshamas>`.

  • |Enhancement| Added `return_centers` parameter in

datasets.make_blobs, which can be used to return centers for each cluster. 15709 by shivamgargsya and Venkatachalam N <venkyyuvy>.

  • |Enhancement| Functions datasets.make_circles and

datasets.make_moons now accept two-element tuple. 15707 by Maciej J Mikulski <mjmikulski>.

  • |Fix| datasets.make_multilabel_classification now generates

ValueError for arguments n_classes < 1 OR length < 1. 16006 by Rushabh Vasani <rushabh-v>.

  • |API| The StreamHandler was removed from sklearn.logger to avoid

double logging of messages in common cases where a handler is attached to the root logger, and to follow the Python logging documentation recommendation for libraries to leave the log message handling to users and application code. 16451 by Christoph Deil <cdeil>.

sklearn.decomposition ............................

  • |Enhancement| decomposition.NMF and

decomposition.non_negative_factorization now preserves float32 dtype. 16280 by Jeremie du Boisberranger <jeremiedbb>.

  • |Enhancement| decomposition.TruncatedSVD.transform is now faster on

given sparse `csc matrices. 16837 by wornbb`.

  • |Fix| decomposition.PCA with a float n_components parameter, will

exclusively choose the components that explain the variance greater than n_components. 15669 by Krishna Chaitanya <krishnachaitanya9>

  • |Fix| decomposition.PCA with n_components='mle' now correctly

handles small eigenvalues, and does not infer 0 as the correct number of components. 16224 by Lisa Schwetlick <lschwetlick>, and Gelavizh Ahmadi <gelavizh1> and :user:Marija Vlajic Wheeler <marijavlajic> and 16841 by Nicolas Hug_.

  • |Fix| decomposition.KernelPCA method `inverse_transform` now

applies the correct inverse transform to the transformed data. 16655 by Lewis Ball <lrjball>.

  • |Fix| Fixed bug that was causing decomposition.KernelPCA to sometimes

raise invalid value encountered in multiply during fit. 16718 by Gui Miotto <gui-miotto>.

  • |Feature| Added n_components_ attribute to decomposition.SparsePCA

and decomposition.MiniBatchSparsePCA. 16981 by Mateusz Górski <Reksbril>.

sklearn.ensemble .......................

  • |MajorFeature| ensemble.HistGradientBoostingClassifier and

ensemble.HistGradientBoostingRegressor now support sample_weight. 14696 by Adrin Jalali_ and Nicolas Hug_.

  • |Feature| Early stopping in

ensemble.HistGradientBoostingClassifier and ensemble.HistGradientBoostingRegressor is now determined with a new early_stopping parameter instead of n_iter_no_change. Default value is 'auto', which enables early stopping if there are at least 10,000 samples in the training set. 14516 by :user:Johann Faouzi <johannfaouzi>.

  • |MajorFeature| ensemble.HistGradientBoostingClassifier and

ensemble.HistGradientBoostingRegressor now support monotonic constraints, useful when features are supposed to have a positive/negative effect on the target. 15582 by Nicolas Hug_.

  • |API| Added boolean verbose flag to classes:

ensemble.VotingClassifier and ensemble.VotingRegressor. 16069 by Sam Bail <spbail>, Hanna Bruce MacDonald <hannahbrucemacdonald>, Reshama Shaikh <reshamas>, and Chiara Marmo <cmarmo>.

  • |API| Fixed a bug in ensemble.HistGradientBoostingClassifier and

ensemble.HistGradientBoostingRegressor that would not respect the max_leaf_nodes parameter if the criteria was reached at the same time as the max_depth criteria. 16183 by Nicolas Hug_.

  • |Fix| Changed the convention for max_depth parameter of

ensemble.HistGradientBoostingClassifier and ensemble.HistGradientBoostingRegressor. The depth now corresponds to the number of edges to go from the root to the deepest leaf. Stumps (trees with one split) are now allowed. 16182 by Santhosh B <santhoshbala18>

  • |Fix| Fixed a bug in ensemble.BaggingClassifier,

ensemble.BaggingRegressor and ensemble.IsolationForest where the attribute estimators_samples_ did not generate the proper indices used during fit. 16437 by Jin-Hwan CHO <chofchof>.

  • |Fix| Fixed a bug in ensemble.StackingClassifier and

ensemble.StackingRegressor where the sample_weight argument was not being passed to cross_val_predict when evaluating the base estimators on cross-validation folds to obtain the input to the meta estimator. 16539 by Bill DeRose <wderose>.

  • |Feature| Added additional option loss="poisson" to

ensemble.HistGradientBoostingRegressor, which adds Poisson deviance with log-link useful for modeling count data. 16692 by Christian Lorentzen <lorentzenchr>

  • |Fix| Fixed a bug where ensemble.HistGradientBoostingRegressor and

ensemble.HistGradientBoostingClassifier would fail with multiple calls to fit when warm_start=True, early_stopping=True, and there is no validation set. 16663 by Thomas Fan_.

sklearn.feature_extraction .................................

  • |Efficiency| feature_extraction.text.CountVectorizer now sorts

features after pruning them by document frequency. This improves performances for datasets with large vocabularies combined with `min_df or max_df. 15834 by Santiago M. Mola <smola>`.

sklearn.feature_selection ................................

  • |Enhancement| Added support for multioutput data in

feature_selection.RFE and feature_selection.RFECV. 16103 by Divyaprabha M <divyaprabha123>.

  • |API| Adds feature_selection.SelectorMixin back to public API.

16132 by trimeta.

sklearn.gaussian_process ...............................

  • |Enhancement| gaussian_process.kernels.Matern returns the RBF kernel when `nu=np.inf`.

15503 by Sam Dixon <sam-dixon>.

  • |Fix| Fixed bug in gaussian_process.GaussianProcessRegressor that

caused predicted standard deviations to only be between 0 and 1 when WhiteKernel is not used. 15782 by plgreenLIRU.

sklearn.impute .....................

  • |Enhancement| impute.IterativeImputer accepts both scalar and array-like inputs for

`max_value and min_value. Array-like inputs allow a different max and min to be specified for each feature. 16403 by Narendra Mukherjee <narendramukherjee>`.

  • |Enhancement| impute.SimpleImputer, impute.KNNImputer, and

impute.IterativeImputer accepts pandas' nullable integer dtype with missing values. 16508 by Thomas Fan_.

sklearn.inspection .........................

  • |Feature| inspection.partial_dependence and

inspection.plot_partial_dependence now support the fast 'recursion' method for ensemble.RandomForestRegressor and tree.DecisionTreeRegressor. 15864 by Nicolas Hug_.

sklearn.linear_model ...........................

  • |MajorFeature| Added generalized linear models (GLM) with non normal error

distributions, including linear_model.PoissonRegressor, linear_model.GammaRegressor and linear_model.TweedieRegressor which use Poisson, Gamma and Tweedie distributions respectively. 14300 by Christian Lorentzen <lorentzenchr>, Roman Yurchak_, and Olivier Grisel_.

  • |MajorFeature| Support of sample_weight in

linear_model.ElasticNet and linear_model.Lasso for dense feature matrix X. 15436 by :user:Christian Lorentzen <lorentzenchr>.

  • |Efficiency| linear_model.RidgeCV and

linear_model.RidgeClassifierCV now do not allocate a potentially large array to store dual coefficients for all hyperparameters during its fit, nor an array to store all error or LOO predictions unless store_cv_values is True. 15652 by Jérôme Dockès <jeromedockes>.

  • |Enhancement| linear_model.LassoLars and

linear_model.Lars now support a jitter parameter that adds random noise to the target. This might help with stability in some edge cases. 15179 by angelaambroz.

  • |Fix| Fixed a bug where if a sample_weight parameter was passed to the fit

method of linear_model.RANSACRegressor, it would not be passed to the wrapped base_estimator during the fitting of the final model. 15773 by Jeremy Alexandre <J-A16>.

  • |Fix| Add best_score_ attribute to linear_model.RidgeCV and

linear_model.RidgeClassifierCV. 15655 by Jérôme Dockès <jeromedockes>.

  • |Fix| Fixed a bug in linear_model.RidgeClassifierCV to pass a

specific scoring strategy. Before the internal estimator outputs score instead of predictions. 14848 by Venkatachalam N <venkyyuvy>.

  • |Fix| linear_model.LogisticRegression will now avoid an unnecessary

iteration when solver='newton-cg' by checking for inferior or equal instead of strictly inferior for maximum of absgrad and tol in utils.optimize._newton_cg. 16266 by Rushabh Vasani <rushabh-v>.

  • |API| Deprecated public attributes standard_coef_, standard_intercept_,

average_coef_, and average_intercept_ in linear_model.SGDClassifier, linear_model.SGDRegressor, linear_model.PassiveAggressiveClassifier, linear_model.PassiveAggressiveRegressor. 16261 by Carlos Brandt <chbrandt>.

  • |Fix| |Efficiency| linear_model.ARDRegression is more stable and

much faster when n_samples > n_features. It can now scale to hundreds of thousands of samples. The stability fix might imply changes in the number of non-zero coefficients and in the predicted output. 16849 by Nicolas Hug_.

  • |Fix| Fixed a bug in linear_model.ElasticNetCV,

linear_model.MultiTaskElasticNetCV, linear_model.LassoCV and linear_model.MultiTaskLassoCV where fitting would fail when using joblib loky backend. 14264 by Jérémie du Boisberranger <jeremiedbb>.

  • |Efficiency| Speed up linear_model.MultiTaskLasso,

linear_model.MultiTaskLassoCV, linear_model.MultiTaskElasticNet, linear_model.MultiTaskElasticNetCV by avoiding slower BLAS Level 2 calls on small arrays 17021 by Alex Gramfort <agramfort> and Mathurin Massias <mathurinm>.

sklearn.metrics ......................

  • |Enhancement| metrics.pairwise_distances_chunked now allows

its `reduce_func to not have a return value, enabling in-place operations. 16397 by Joel Nothman`_.

  • |Fix| Fixed a bug in metrics.mean_squared_error to not ignore

argument squared when argument multioutput='raw_values'. 16323 by Rushabh Vasani <rushabh-v>

  • |Fix| Fixed a bug in metrics.mutual_info_score where negative

scores could be returned. 16362 by Thomas Fan_.

  • |Fix| Fixed a bug in metrics.confusion_matrix that would raise

an error when y_true and y_pred were length zero and labels was not None. In addition, we raise an error when an empty list is given to the labels parameter. 16442 by Kyle Parsons <parsons-kyle-89>.

  • |API| Changed the formatting of values in

metrics.ConfusionMatrixDisplay.plot and metrics.plot_confusion_matrix to pick the shorter format (either '2g' or 'd'). 16159 by Rick Mackenbach <Rick-Mackenbach> and Thomas Fan_.

  • |API| From version 0.25, metrics.pairwise_distances will no

longer automatically compute the `VI parameter for Mahalanobis distance and the V parameter for seuclidean distance if Y is passed. The user will be expected to compute this parameter on the training data of their choice and pass it to pairwise_distances. 16993 by Joel Nothman`_.

sklearn.model_selection ..............................

  • |Enhancement| model_selection.GridSearchCV and

model_selection.RandomizedSearchCV yields stack trace information in fit failed warning messages in addition to previously emitted type and details. 15622 by Gregory Morse <GregoryMorse>.

  • |Fix| model_selection.cross_val_predict supports

method="predict_proba" when y=None. 15918 by Luca Kubin <lkubin>.

  • |Fix| model_selection.fit_grid_point is deprecated in 0.23 and will

be removed in 0.25. 16401 by Arie Pratama Sutiono <ariepratama>

sklearn.multioutput ..........................

  • |Feature| multioutput.MultiOutputRegressor.fit and

multioutput.MultiOutputClassifier.fit now can accept fit_params to pass to the estimator.fit method of each step. 15953 15959 by Ke Huang <huangk10>.

  • |Enhancement| multioutput.RegressorChain now supports fit_params

for base_estimator during fit. 16111 by Venkatachalam N <venkyyuvy>.

sklearn.naive_bayes .............................

  • |Fix| A correctly formatted error message is shown in

naive_bayes.CategoricalNB when the number of features in the input differs between predict and fit. 16090 by Madhura Jayaratne <madhuracj>.

sklearn.neural_network .............................

  • |Efficiency| neural_network.MLPClassifier and

neural_network.MLPRegressor has reduced memory footprint when using stochastic solvers, 'sgd' or 'adam', and shuffle=True. 14075 by meyer89.

  • |Fix| Increases the numerical stability of the logistic loss function in

neural_network.MLPClassifier by clipping the probabilities. 16117 by Thomas Fan_.

sklearn.inspection .........................

  • |Enhancement| inspection.PartialDependenceDisplay now exposes the

deciles lines as attributes so they can be hidden or customized. 15785 by Nicolas Hug_

sklearn.preprocessing ............................

  • |Feature| argument drop of preprocessing.OneHotEncoder

will now accept value 'if_binary' and will drop the first category of each feature with two categories. 16245 by Rushabh Vasani <rushabh-v>.

  • |Enhancement| preprocessing.OneHotEncoder's drop_idx_ ndarray

can now contain None, where drop_idx_[i] = None means that no category is dropped for index i. 16585 by Chiara Marmo <cmarmo>.

  • |Enhancement| preprocessing.MaxAbsScaler,

preprocessing.MinMaxScaler, preprocessing.StandardScaler, preprocessing.PowerTransformer, preprocessing.QuantileTransformer, preprocessing.RobustScaler now supports pandas' nullable integer dtype with missing values. 16508 by Thomas Fan_.

  • |Efficiency| preprocessing.OneHotEncoder is now faster at

transforming. 15762 by Thomas Fan_.

  • |Fix| Fix a bug in preprocessing.StandardScaler which was incorrectly

computing statistics when calling partial_fit on sparse inputs. 16466 by Guillaume Lemaitre <glemaitre>.

  • |Fix| Fix a bug in preprocessing.Normalizer with norm='max',

which was not taking the absolute value of the maximum values before normalizing the vectors. 16632 by Maura Pintor <Maupin1991> and Battista Biggio <bbiggio>.

sklearn.semi_supervised ..............................

  • |Fix| semi_supervised.LabelSpreading and

semi_supervised.LabelPropagation avoids divide by zero warnings when normalizing label_distributions_. 15946 by ngshya.

sklearn.svm ..................

  • |Fix| |Efficiency| Improved `libsvm and liblinear` random number

generators used to randomly select coordinates in the coordinate descent algorithms. Platform-dependent C `rand() was used, which is only able to generate numbers up to 32767 on windows platform (see this blog post <https://codeforces.com/blog/entry/61587>_) and also has poor randomization power as suggested by this presentation <https://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful>_. It was replaced with C++11 mt19937, a Mersenne Twister that correctly generates 31bits/63bits random numbers on all platforms. In addition, the crude "modulo" postprocessor used to get a random number in a bounded interval was replaced by the tweaked Lemire method as suggested by this blog post <https://www.pcg-random.org/posts/bounded-rands.html>_. Any model using the svm.libsvm or the svm.liblinear solver, including svm.LinearSVC, svm.LinearSVR, svm.NuSVC, svm.NuSVR, svm.OneClassSVM, svm.SVC, svm.SVR, linear_model.LogisticRegression, is affected. In particular users can expect a better convergence when the number of samples (LibSVM) or the number of features (LibLinear) is large. 13511 by Sylvain Marié <smarie>`.

  • |Fix| Fix use of custom kernel not taking float entries such as string

kernels in svm.SVC and svm.SVR. Note that custom kernels are now expected to validate their input where they previously received valid numeric arrays. 11296 by Alexandre Gramfort_ and Georgi Peev <georgipeev>.

  • |API| svm.SVR and svm.OneClassSVM attributes, probA_ and

probB_, are now deprecated as they were not useful. 15558 by Thomas Fan_.

sklearn.tree ...................

  • |Fix| tree.plot_tree rotate parameter was unused and has been

deprecated. 15806 by Chiara Marmo <cmarmo>.

  • |Fix| Fix support of read-only float32 array input in `predict`,

`decision_path and predict_proba methods of tree.DecisionTreeClassifier, tree.ExtraTreeClassifier and ensemble.GradientBoostingClassifier as well as predict method of tree.DecisionTreeRegressor, tree.ExtraTreeRegressor, and ensemble.GradientBoostingRegressor. 16331 by Alexandre Batisse <batalex>`.

sklearn.utils ....................

  • |MajorFeature| Estimators can now be displayed with a rich html

representation. This can be enabled in Jupyter notebooks by setting display='diagram' in ~sklearn.set_config. The raw html can be returned by using utils.estimator_html_repr. 14180 by Thomas Fan_.

  • |Enhancement| improve error message in utils.validation.column_or_1d.

15926 by Loïc Estève <lesteve>.

  • |Enhancement| add warning in utils.check_array for

pandas sparse DataFrame. 16021 by Rushabh Vasani <rushabh-v>.

  • |Enhancement| utils.check_array now constructs a sparse

matrix from a pandas DataFrame that contains only SparseArray columns. 16728 by Thomas Fan_.

  • |Enhancement| utils.check_array supports pandas'

nullable integer dtype with missing values when force_all_finite is set to False or 'allow-nan' in which case the data is converted to floating point values where pd.NA values are replaced by np.nan. As a consequence, all sklearn.preprocessing transformers that accept numeric inputs with missing values represented as np.nan now also accepts being directly fed pandas dataframes with pd.Int* or pd.Uint* typed columns that use pd.NA as a missing value marker. 16508 by Thomas Fan`_.

  • |API| Passing classes to utils.estimator_checks.check_estimator and

utils.estimator_checks.parametrize_with_checks is now deprecated, and support for classes will be removed in 0.24. Pass instances instead. 17032 by Nicolas Hug_.

  • |API| The private utility _safe_tags in utils.estimator_checks was

removed, hence all tags should be obtained through estimator._get_tags(). Note that Mixins like RegressorMixin must come *before* base classes in the MRO for _get_tags() to work properly. 16950 by Nicolas Hug_.

  • |FIX| utils.all_estimators now only returns public estimators.

15380 by Thomas Fan_.

Miscellaneous .............

  • |MajorFeature| Adds a HTML representation of estimators to be shown in

a jupyter notebook or lab. This visualization is activated by setting the display option in sklearn.set_config. 14180 by Thomas Fan_.

  • |Enhancement| `scikit-learn now works with mypy` without errors.

16726 by Roman Yurchak_.

  • |API| Most estimators now expose a n_features_in_ attribute. This

attribute is equal to the number of features passed to the fit method. See SLEP010 <https://scikit-learn-enhancement-proposals.readthedocs.io/en/latest/slep010/proposal.html>_ for details. 16112 by Nicolas Hug_.

  • |API| Estimators now have a requires_y tags which is False by default

except for estimators that inherit from ~sklearn.base.RegressorMixin or ~sklearn.base.ClassifierMixin. This tag is used to ensure that a proper error message is raised when y was expected but None was passed. 16622 by Nicolas Hug_.

  • |API| The default setting print_changed_only has been changed from False

to True. This means that the repr of estimators is now more concise and only shows the parameters whose default value has been changed when printing an estimator. You can restore the previous behaviour by using sklearn.set_config(print_changed_only=False). Also, note that it is always possible to quickly inspect the parameters of any estimator using est.get_params(deep=False). 17061 by Nicolas Hug_.

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

Abbie Popa, Adrin Jalali, Aleksandra Kocot, Alexandre Batisse, Alexandre Gramfort, Alex Henrie, Alex Itkes, Alex Liang, alexshacked, Alonso Silva Allende, Ana Casado, Andreas Mueller, Angela Ambroz, Ankit810, Arie Pratama Sutiono, Arunav Konwar, Baptiste Maingret, Benjamin Beier Liu, bernie gray, Bharathi Srinivasan, Bharat Raghunathan, Bibhash Chandra Mitra, Brian Wignall, brigi, Brigitta Sipőcz, Carlos H Brandt, CastaChick, castor, cgsavard, Chiara Marmo, Chris Gregory, Christian Kastner, Christian Lorentzen, Corrie Bartelheimer, Daniël van Gelder, Daphne, David Breuer, david-cortes, dbauer9, Divyaprabha M, Edward Qian, Ekaterina Borovikova, ELNS, Emily Taylor, Erich Schubert, Eric Leung, Evgeni Chasnovski, Fabiana, Facundo Ferrín, Fan, Franziska Boenisch, Gael Varoquaux, Gaurav Sharma, Geoffrey Bolmier, Georgi Peev, gholdman1, Gonthier Nicolas, Gregory Morse, Gregory R. Lee, Guillaume Lemaitre, Gui Miotto, Hailey Nguyen, Hanmin Qin, Hao Chun Chang, HaoYin, Hélion du Mas des Bourboux, Himanshu Garg, Hirofumi Suzuki, huangk10, Hugo van Kemenade, Hye Sung Jung, indecisiveuser, inderjeet, J-A16, Jérémie du Boisberranger, Jin-Hwan CHO, JJmistry, Joel Nothman, Johann Faouzi, Jon Haitz Legarreta Gorroño, Juan Carlos Alfaro Jiménez, judithabk6, jumon, Kathryn Poole, Katrina Ni, Kesshi Jordan, Kevin Loftis, Kevin Markham, krishnachaitanya9, Lam Gia Thuan, Leland McInnes, Lisa Schwetlick, lkubin, Loic Esteve, lopusz, lrjball, lucgiffon, lucyleeow, Lucy Liu, Lukas Kemkes, Maciej J Mikulski, Madhura Jayaratne, Magda Zielinska, maikia, Mandy Gu, Manimaran, Manish Aradwad, Maren Westermann, Maria, Mariana Meireles, Marie Douriez, Marielle, Mateusz Górski, mathurinm, Matt Hall, Maura Pintor, mc4229, meyer89, m.fab, Michael Shoemaker, Michał Słapek, Mina Naghshhnejad, mo, Mohamed Maskani, Mojca Bertoncelj, narendramukherjee, ngshya, Nicholas Won, Nicolas Hug, nicolasservel, Niklas, @nkish, Noa Tamir, Oleksandr Pavlyk, olicairns, Oliver Urs Lenz, Olivier Grisel, parsons-kyle-89, Paula, Pete Green, Pierre Delanoue, pspachtholz, Pulkit Mehta, Qizhi Jiang, Quang Nguyen, rachelcjordan, raduspaimoc, Reshama Shaikh, Riccardo Folloni, Rick Mackenbach, Ritchie Ng, Roman Feldbauer, Roman Yurchak, Rory Hartong-Redden, Rüdiger Busche, Rushabh Vasani, Sambhav Kothari, Samesh Lakhotia, Samuel Duan, SanthoshBala18, Santiago M. Mola, Sarat Addepalli, scibol, Sebastian Kießling, SergioDSR, Sergul Aydore, Shiki-H, shivamgargsya, SHUBH CHATTERJEE, Siddharth Gupta, simonamaggio, smarie, Snowhite, stareh, Stephen Blystone, Stephen Marsh, Sunmi Yoon, SylvainLan, talgatomarov, tamirlan1, th0rwas, theoptips, Thomas J Fan, Thomas Li, Thomas Schmitt, Tim Nonner, Tim Vink, Tiphaine Viard, Tirth Patel, Titus Christian, Tom Dupré la Tour, trimeta, Vachan D A, Vandana Iyer, Venkatachalam N, waelbenamara, wconnell, wderose, wenliwyan, Windber, wornbb, Yu-Hang "Maxin" Tang