Version 0.24
scikit-learn Docs · نسخهٔ 5e9184e53cd3 · BSD-3-Clause
============
Version 0.24
For a short description of the main highlights of the release, please refer to sphx_glr_auto_examples_release_highlights_plot_release_highlights_0_24_0.py.
Version 0.24.2
April 2021
Changelog
sklearn.compose ......................
- |Fix|
compose.ColumnTransformer.get_feature_namesdoes not call
get_feature_names on transformers with an empty column selection. 19579 by Thomas Fan_.
sklearn.cross_decomposition ..................................
- |Fix| Fixed a regression in
cross_decomposition.CCA.19646
by Thomas Fan_.
- |Fix|
cross_decomposition.PLSRegressionraises warning for
constant y residuals instead of a StopIteration error. 19922 by Thomas Fan_.
sklearn.decomposition ............................
- |Fix| Fixed a bug in
decomposition.KernelPCA's
`inverse_transform. 19732 by Kei Ishikawa <kstoneriv3>`.
sklearn.ensemble .......................
- |Fix| Fixed a bug in
ensemble.HistGradientBoostingRegressorfit
with sample_weight parameter and least_absolute_deviation loss function. 19407 by Vadim Ushtanit <vadim-ushtanit>.
sklearn.feature_extraction .................................
- |Fix| Fixed a bug to support multiple strings for a category when
sparse=False in feature_extraction.DictVectorizer. 19982 by Guillaume Lemaitre <glemaitre>.
sklearn.gaussian_process ...............................
- |Fix| Avoid explicitly forming inverse covariance matrix in
gaussian_process.GaussianProcessRegressor when set to output standard deviation. With certain covariance matrices this inverse is unstable to compute explicitly. Calling Cholesky solver mitigates this issue in computation. 19939 by Ian Halvic <iwhalvic>.
- |Fix| Avoid division by zero when scaling constant target in
gaussian_process.GaussianProcessRegressor. It was due to a std. dev. equal to 0. Now, such case is detected and the std. dev. is affected to 1 avoiding a division by zero and thus the presence of NaN values in the normalized target. 19703 by sobkevich, Boris Villazón-Terrazas <boricles> and Alexandr Fonari <afonari>.
sklearn.linear_model ...........................
- |Fix|: Fixed a bug in
linear_model.LogisticRegression: the
sample_weight object is not modified anymore. 19182 by Yosuke KOBAYASHI <m7142yosuke>.
sklearn.metrics ......................
- |Fix|
metrics.top_k_accuracy_scorenow supports multiclass
problems where only two classes appear in y_true and all the classes are specified in labels. 19721 by Joris Clement <flyingdutchman23>.
sklearn.model_selection ..............................
- |Fix|
model_selection.RandomizedSearchCVand
model_selection.GridSearchCV now correctly show the score for single metrics and verbose > 2. 19659 by Thomas Fan_.
- |Fix| Some values in the
cv_results_attribute of
model_selection.HalvingRandomSearchCV and model_selection.HalvingGridSearchCV were not properly converted to numpy arrays. 19211 by Nicolas Hug_.
- |Fix| The
fitmethod of the successive halving parameter search
(model_selection.HalvingGridSearchCV, and model_selection.HalvingRandomSearchCV) now correctly handles the groups parameter. 19847 by Xiaoyu Chai <xiaoyuchai>.
sklearn.multioutput ..........................
- |Fix|
multioutput.MultiOutputRegressornow works with estimators
that dynamically define predict during fitting, such as ensemble.StackingRegressor. 19308 by Thomas Fan_.
sklearn.preprocessing ............................
- |Fix| Validate the constructor parameter
handle_unknownin
preprocessing.OrdinalEncoder to only allow for 'error' and 'use_encoded_value' strategies. 19234 by Guillaume Lemaitre <glemaitre>.
- |Fix| Fix encoder categories having dtype='S'
preprocessing.OneHotEncoder and preprocessing.OrdinalEncoder. 19727 by Andrew Delong <andrewdelong>.
- |Fix|
preprocessing.OrdinalEncoder.transformcorrectly handles
unknown values for string dtypes. 19888 by Thomas Fan_.
- |Fix|
preprocessing.OneHotEncoder.fitno longer alters thedrop
parameter. 19924 by Thomas Fan_.
sklearn.semi_supervised ..............................
- |Fix| Avoid NaN during label propagation in
~sklearn.semi_supervised.LabelPropagation. 19271 by Zhaowei Wang <ThuWangzw>.
sklearn.tree ...................
- |Fix| Fix a bug in
fitoftree.BaseDecisionTreethat caused
segmentation faults under certain conditions. fit now deep copies the Criterion object to prevent shared concurrent accesses. 19580 by Samuel Brice <samdbrice> and Alex Adamson <aadamson> and Wil Yegelwel <wyegelwel>.
sklearn.utils ....................
- |Fix| Better contains the CSS provided by
utils.estimator_html_repr
by giving CSS ids to the html representation. 19417 by Thomas Fan_.
Version 0.24.1
January 2021
Packaging
The 0.24.0 scikit-learn wheels were not working with MacOS <1.15 due to libomp. The version of libomp used to build the wheels was too recent for older macOS versions. This issue has been fixed for 0.24.1 scikit-learn wheels. Scikit-learn wheels published on PyPI.org now officially support macOS 10.13 and later.
Changelog
sklearn.metrics ......................
- |Fix| Fix numerical stability bug that could happen in
metrics.adjusted_mutual_info_score and metrics.mutual_info_score with NumPy 1.20+. 19179 by Thomas Fan_.
sklearn.semi_supervised ..............................
- |Fix|
semi_supervised.SelfTrainingClassifieris now accepting
meta-estimator (e.g. ensemble.StackingClassifier). The validation of this estimator is done on the fitted estimator, once we know the existence of the method predict_proba. 19126 by Guillaume Lemaitre <glemaitre>.
Version 0.24.0
December 2020
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|
decomposition.KernelPCAbehaviour is now more consistent
between 32-bits and 64-bits data when the kernel has small positive eigenvalues.
- |Fix|
decomposition.TruncatedSVDbecomes deterministic by exposing
a random_state parameter.
- |Fix|
linear_model.Perceptronwhenpenalty='elasticnet'.
- |Fix| Change in the random sampling procedures for the center initialization
of cluster.KMeans.
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 ...................
- |Fix|
base.BaseEstimator.get_paramsnow will raise an
AttributeError if a parameter cannot be retrieved as an instance attribute. Previously it would return None. 17448 by Juan Carlos Alfaro Jiménez <alfaro96>.
sklearn.calibration ..........................
- |Efficiency|
calibration.CalibratedClassifierCV.fitnow supports
parallelization via joblib.Parallel using argument n_jobs. 17107 by Julien Jerphanion <jjerphan>.
- |Enhancement| Allow
calibration.CalibratedClassifierCVuse with
prefit pipeline.Pipeline where data is not X is not array-like, sparse matrix or dataframe at the start. 17546 by Lucy Liu <lucyleeow>.
- |Enhancement| Add
ensembleparameter to
calibration.CalibratedClassifierCV, which enables implementation of calibration via an ensemble of calibrators (current method) or just one calibrator using all the data (similar to the built-in feature of sklearn.svm estimators with the probabilities=True parameter). 17856 by Lucy Liu <lucyleeow> and Andrea Esuli <aesuli>.
sklearn.cluster ......................
- |Enhancement|
cluster.AgglomerativeClusteringhas a new parameter
compute_distances. When set to True, distances between clusters are computed and stored in the distances_ attribute even when the parameter distance_threshold is not used. This new parameter is useful to produce dendrogram visualizations, but introduces a computational and memory overhead. 17984 by Michael Riedmann <mriedmann>, Emilie Delattre <EmilieDel>, and Francesco Casalegno <FrancescoCasalegno>.
- |Enhancement|
cluster.SpectralClusteringand
cluster.spectral_clustering have a new keyword argument verbose. When set to True, additional messages will be displayed which can aid with debugging. 18052 by Sean O. Stalley <sstalley>.
- |Enhancement| Added
cluster.kmeans_plusplusas public function.
Initialization by KMeans++ can now be called separately to generate initial cluster centroids. 17937 by g-walsh
- |API|
cluster.MiniBatchKMeansattributes,counts_and
init_size_, are deprecated and will be removed in 1.1 (renaming of 0.26). 17864 by Jérémie du Boisberranger <jeremiedbb>.
sklearn.compose ......................
- |Fix|
compose.ColumnTransformerwill skip transformers the
column selector is a list of bools that are False. 17616 by Thomas Fan_.
- |Fix|
compose.ColumnTransformernow displays the remainder in the
diagram display. 18167 by Thomas Fan_.
- |Fix|
compose.ColumnTransformerenforces strict count and order
of column names between fit and transform by raising an error instead of a warning, following the deprecation cycle. 18256 by Madhura Jayratne <madhuracj>.
sklearn.covariance .........................
- |API| Deprecates
cv_alphas_in favor ofcv_results_['alphas']and
grid_scores_ in favor of split scores in cv_results_ in covariance.GraphicalLassoCV. cv_alphas_ and grid_scores_ will be removed in version 1.1 (renaming of 0.26). 16392 by Thomas Fan_.
sklearn.cross_decomposition ..................................
- |Fix| Fixed a bug in
cross_decomposition.PLSSVDwhich would
sometimes return components in the reversed order of importance. 17095 by Nicolas Hug_.
- |Fix| Fixed a bug in
cross_decomposition.PLSSVD,
cross_decomposition.CCA, and cross_decomposition.PLSCanonical, which would lead to incorrect predictions for est.transform(Y) when the training data is single-target. 17095 by Nicolas Hug_.
- |Fix| Increases the stability of
cross_decomposition.CCA18746
by Thomas Fan_.
- |API| The bounds of the
n_componentsparameter is now restricted:
- into
[1, min(n_samples, n_features, n_targets)], for
cross_decomposition.PLSSVD, cross_decomposition.CCA, and cross_decomposition.PLSCanonical.
- into
[1, n_features]orcross_decomposition.PLSRegression.
An error will be raised in 1.1 (renaming of 0.26). 17095 by Nicolas Hug_.
- |API| For
cross_decomposition.PLSSVD,
cross_decomposition.CCA, and cross_decomposition.PLSCanonical, the x_scores_ and y_scores_ attributes were deprecated and will be removed in 1.1 (renaming of 0.26). They can be retrieved by calling transform on the training data. The norm_y_weights attribute will also be removed. 17095 by Nicolas Hug_.
- |API| For
cross_decomposition.PLSRegression,
cross_decomposition.PLSCanonical, cross_decomposition.CCA, and cross_decomposition.PLSSVD, the x_mean_, y_mean_, x_std_, and y_std_ attributes were deprecated and will be removed in 1.1 (renaming of 0.26). 18768 by Maren Westermann <marenwestermann>.
- |Fix|
decomposition.TruncatedSVDbecomes deterministic by using the
random_state. It controls the weights' initialization of the underlying ARPACK solver. #18302 by Gaurav Desai <gauravkdesai> and Ivan Panico <FollowKenny>.
sklearn.datasets .......................
- |Feature|
datasets.fetch_openmlnow validates md5 checksum of arff
files downloaded or cached to ensure data integrity. 14800 by Shashank Singh <shashanksingh28> and Joel Nothman_.
- |Enhancement|
datasets.fetch_openmlnow allows argumentas_frame
to be 'auto', which tries to convert returned data to pandas DataFrame unless data is sparse. 17396 by Jiaxiang <fujiaxiang>.
- |Enhancement|
datasets.fetch_covtypenow supports the optional
argument as_frame; when it is set to True, the returned Bunch object's data and frame members are pandas DataFrames, and the target member is a pandas Series. 17491 by Alex Liang <tianchuliang>.
- |Enhancement|
datasets.fetch_kddcup99now supports the optional
argument as_frame; when it is set to True, the returned Bunch object's data and frame members are pandas DataFrames, and the target member is a pandas Series. 18280 by Alex Liang <tianchuliang> and Guillaume Lemaitre_.
- |Enhancement|
datasets.fetch_20newsgroups_vectorizednow supports
loading as a pandas `DataFrame by setting as_frame=True. 17499 by Brigitta Sipőcz <bsipocz> and Guillaume Lemaitre`_.
- |API| The default value of
as_frameindatasets.fetch_openmlis
changed from False to 'auto'. 17610 by Jiaxiang <fujiaxiang>.
sklearn.decomposition ............................
- |API| For
decomposition.NMF,
the init value, when 'init=None' and n_components <= min(n_samples, n_features) will be changed from 'nndsvd' to 'nndsvda' in 1.1 (renaming of 0.26). 18525 by Chiara Marmo <cmarmo>.
- |Enhancement|
decomposition.FactorAnalysisnow supports the optional
argument rotation, which can take the value None, 'varimax' or 'quartimax'. 11064 by Jona Sassenhagen <jona-sassenhagen>.
- |Enhancement|
decomposition.NMFnow supports the optional parameter
regularization, which can take the values None, 'components', 'transformation' or 'both', in accordance with decomposition.NMF.non_negative_factorization. 17414 by Bharat Raghunathan <bharatr21>.
- |Fix|
decomposition.KernelPCAbehaviour is now more consistent
between 32-bits and 64-bits data input when the kernel has small positive eigenvalues. Small positive eigenvalues were not correctly discarded for 32-bits data. 18149 by Sylvain Marié <smarie>.
- |Fix| Fix
decomposition.SparseCodersuch that it follows
scikit-learn API and supports cloning. The attribute components_ is deprecated in 0.24 and will be removed in 1.1 (renaming of 0.26). This attribute was redundant with the dictionary attribute and constructor parameter. 17679 by Xavier Dupré <sdpython>.
- |Fix|
decomposition.TruncatedSVD.fit_transformconsistently returns
the same as decomposition.TruncatedSVD.fit followed by decomposition.TruncatedSVD.transform. 18528 by Albert Villanova del Moral <albertvillanova> and Ruifeng Zheng <zhengruifeng>.
sklearn.discriminant_analysis ....................................
- |Enhancement|
discriminant_analysis.LinearDiscriminantAnalysiscan
now use custom covariance estimate by setting the covariance_estimator parameter. 14446 by Hugo Richard <hugorichard>.
sklearn.ensemble .......................
- |MajorFeature|
ensemble.HistGradientBoostingRegressorand
ensemble.HistGradientBoostingClassifier now have native support for categorical features with the categorical_features parameter. 18394 by Nicolas Hug_ and Thomas Fan_.
- |Feature|
ensemble.HistGradientBoostingRegressorand
ensemble.HistGradientBoostingClassifier now support the method staged_predict, which allows monitoring of each stage. 16985 by Hao Chun Chang <haochunchang>.
- |Efficiency| break cyclic references in the tree nodes used internally in
ensemble.HistGradientBoostingRegressor and ensemble.HistGradientBoostingClassifier to allow for the timely garbage collection of large intermediate datastructures and to improve memory usage in fit. 18334 by Olivier Grisel_ Nicolas Hug_, Thomas Fan_ and Andreas Müller_.
- |Efficiency| Histogram initialization is now done in parallel in
ensemble.HistGradientBoostingRegressor and ensemble.HistGradientBoostingClassifier which results in speed improvement for problems that build a lot of nodes on multicore machines. 18341 by Olivier Grisel_, Nicolas Hug_, Thomas Fan_, and Egor Smirnov <SmirnovEgorRu>.
- |Fix| Fixed a bug in
ensemble.HistGradientBoostingRegressor and ensemble.HistGradientBoostingClassifier which can now accept data with uint8 dtype in predict. 18410 by Nicolas Hug_.
- |API| The parameter `
n_classes_` is now deprecated in
ensemble.GradientBoostingRegressor and returns 1. 17702 by Simona Maggio <simonamaggio>.
- |API| Mean absolute error ('mae') is now deprecated for the parameter
`criterion in ensemble.GradientBoostingRegressor and ensemble.GradientBoostingClassifier. 18326 by Madhura Jayaratne <madhuracj>`.
sklearn.exceptions .........................
- |API|
exceptions.ChangedBehaviorWarningand
exceptions.NonBLASDotWarning are deprecated and will be removed in 1.1 (renaming of 0.26). 17804 by Adrin Jalali_.
sklearn.feature_extraction .................................
- |Enhancement|
feature_extraction.DictVectorizeraccepts multiple
values for one categorical feature. 17367 by Peng Yu <yupbank> and Chiara Marmo <cmarmo>.
- |Fix|
feature_extraction.text.CountVectorizerraises an issue if a
custom token pattern which captures more than one group is provided. 15427 by Gangesh Gudmalwar <ggangesh> and Erin R Hoffman <hoffm386>.
sklearn.feature_selection ................................
- |Feature| Added
feature_selection.SequentialFeatureSelector
which implements forward and backward sequential feature selection. 6545 by Sebastian Raschka_ and 17159 by Nicolas Hug_.
- |Feature| A new parameter
importance_getterwas added to
feature_selection.RFE, feature_selection.RFECV and feature_selection.SelectFromModel, allowing the user to specify an attribute name/path or a callable for extracting feature importance from the estimator. 15361 by Venkatachalam N <venkyyuvy>.
- |Efficiency| Reduce memory footprint in
feature_selection.mutual_info_classif and feature_selection.mutual_info_regression by calling neighbors.KDTree for counting nearest neighbors. 17878 by Noel Rogers <noelano>.
- |Enhancement|
feature_selection.RFEsupports the option for the
number of n_features_to_select to be given as a float representing the percentage of features to select. 17090 by Lisa Schwetlick <lschwetlick> and Marija Vlajic Wheeler <marijavlajic>.
sklearn.gaussian_process ...............................
- |Enhancement| A new method
gaussian_process.kernel._check_bounds_params is called after fitting a Gaussian Process and raises a `ConvergenceWarning if the bounds of the hyperparameters are too tight. 12638 by Sylvain Lannuzel <SylvainLan>`.
sklearn.impute .....................
- |Feature|
impute.SimpleImputernow supports a list of strings
when `strategy='most_frequent' or strategy='constant'. 17526 by Ayako YAGI <yagi-3> and Juan Carlos Alfaro Jiménez <alfaro96>`.
- |Feature| Added method
impute.SimpleImputer.inverse_transformto
revert imputed data to original when instantiated with `add_indicator=True. 17612 by Srimukh Sripada <d3b0unce>`.
- |Fix| replace the default values in
impute.IterativeImputer
of min_value and max_value parameters to -np.inf and np.inf, respectively instead of None. However, the behaviour of the class does not change since None was defaulting to these values already. 16493 by Darshan N <DarshanGowda0>.
- |Fix|
impute.IterativeImputerwill not attempt to set the
estimator's random_state attribute, allowing to use it with more external classes. 15636 by David Cortes <david-cortes>.
- |Efficiency|
impute.SimpleImputeris now faster withobjectdtype array.
when strategy='most_frequent' in ~sklearn.impute.SimpleImputer. 18987 by David Katz <DavidKatz-il>.
sklearn.inspection .........................
- |Feature|
inspection.partial_dependenceand
inspection.plot_partial_dependence now support calculating and plotting Individual Conditional Expectation (ICE) curves controlled by the `kind parameter. 16619 by Madhura Jayratne <madhuracj>`.
- |Feature| Add
sample_weightparameter to
inspection.permutation_importance. 16906 by Roei Kahny <RoeiKa>.
- |API| Positional arguments are deprecated in
inspection.PartialDependenceDisplay.plot and will error in 1.1 (renaming of 0.26). 18293 by Thomas Fan_.
sklearn.isotonic .......................
- |Feature| Expose fitted attributes `
X_thresholds_andy_thresholds_`
that hold the de-duplicated interpolation thresholds of an isotonic.IsotonicRegression instance for model inspection purpose. 16289 by Masashi Kishimoto <kishimoto-banana> and Olivier Grisel <ogrisel>.
- |Enhancement|
isotonic.IsotonicRegressionnow accepts 2d array with
1 feature as input array. 17379 by Jiaxiang <fujiaxiang>.
- |Fix| Add tolerance when determining duplicate X values to prevent
inf values from being predicted by isotonic.IsotonicRegression. 18639 by Lucy Liu <lucyleeow>.
sklearn.kernel_approximation ...................................
- |Feature| Added class
kernel_approximation.PolynomialCountSketch
which implements the Tensor Sketch algorithm for polynomial kernel feature map approximation. 13003 by Daniel López Sánchez <lopeLH>.
- |Efficiency|
kernel_approximation.Nystroemnow supports
parallelization via joblib.Parallel using argument n_jobs. 18545 by Laurenz Reitsam <LaurenzReitsam>.
sklearn.linear_model ...........................
- |Feature|
linear_model.LinearRegressionnow forces coefficients
to be all positive when `positive is set to True. 17578 by Joseph Knox <jknox13>, Nelle Varoquaux <NelleV> and Chiara Marmo <cmarmo>`.
- |Enhancement|
linear_model.RidgeCVnow supports finding an optimal
regularization value alpha for each target separately by setting `alpha_per_target=True. This is only supported when using the default efficient leave-one-out cross-validation scheme cv=None. 6624 by Marijn van Vliet <wmvanvliet>`.
- |Fix| Fixes bug in
linear_model.TheilSenRegressorwhere
predict and score would fail when fit_intercept=False and there was one feature during fitting. 18121 by Thomas Fan_.
- |Fix| Fixes bug in
linear_model.ARDRegressionwherepredict
was raising an error when normalize=True and return_std=True because X_offset_ and X_scale_ were undefined. 18607 by fhaselbeck <fhaselbeck>.
- |Fix| Added the missing
l1_ratioparameter in
linear_model.Perceptron, to be used when penalty='elasticnet'. This changes the default from 0 to 0.15. 18622 by Haesun Park <rickiepark>.
sklearn.manifold .......................
- |Efficiency| Fixed
10493. Improve Local Linear Embedding (LLE)
that raised MemoryError exception when used with large inputs. 17997 by Bertrand Maisonneuve <bmaisonn>.
- |Enhancement| Add
square_distancesparameter tomanifold.TSNE,
which provides backward compatibility during deprecation of legacy squaring behavior. Distances will be squared by default in 1.1 (renaming of 0.26), and this parameter will be removed in 1.3. 17662 by Joshua Newton <joshuacwnewton>.
- |Fix|
manifold.MDSnow correctly sets its_pairwiseattribute.
18278 by Thomas Fan_.
sklearn.metrics ......................
- |Feature| Added
metrics.cluster.pair_confusion_matriximplementing
the confusion matrix arising from pairs of elements from two clusterings. 17412 by Uwe F Mayer <ufmayer>.
- |Feature| new metric
metrics.top_k_accuracy_score. It's a
generalization of metrics.top_k_accuracy_score, the difference is that a prediction is considered correct as long as the true label is associated with one of the k highest predicted scores. metrics.accuracy_score is the special case of k = 1. 16625 by Geoffrey Bolmier <gbolmier>.
- |Feature| Added
metrics.det_curveto compute Detection Error Tradeoff
curve classification metric. 10591 by Jeremy Karnowski <jkarnows> and Daniel Mohns <dmohns>.
- |Feature| Added
metrics.plot_det_curveand
metrics.DetCurveDisplay to ease the plot of DET curves. 18176 by Guillaume Lemaitre <glemaitre>.
- |Feature| Added
metrics.mean_absolute_percentage_errormetric and
the associated scorer for regression problems. 10708 fixed with the PR 15007 by Ashutosh Hathidara <ashutosh1919>. The scorer and some practical test cases were taken from PR 10711 by Mohamed Ali Jamaoui <mohamed-ali>.
- |Feature| Added
metrics.rand_scoreimplementing the (unadjusted)
Rand index. 17412 by Uwe F Mayer <ufmayer>.
- |Feature|
metrics.plot_confusion_matrixnow supports making colorbar
optional in the matplotlib plot by setting colorbar=False. 17192 by Avi Gupta <avigupta2612>
- |Enhancement| Add
sample_weightparameter to
metrics.median_absolute_error. 17225 by Lucy Liu <lucyleeow>.
- |Enhancement| Add
pos_labelparameter in
metrics.plot_precision_recall_curve in order to specify the positive class to be used when computing the precision and recall statistics. 17569 by Guillaume Lemaitre <glemaitre>.
- |Enhancement| Add
pos_labelparameter in
metrics.plot_roc_curve in order to specify the positive class to be used when computing the roc auc statistics. 17651 by Clara Matos <claramatos>.
- |Fix| Fixed a bug in
metrics.classification_report which was raising AttributeError when called with output_dict=True for 0-length values. 17777 by Shubhanshu Mishra <napsternxg>.
- |Fix| Fixed a bug in
metrics.classification_report which was raising AttributeError when called with output_dict=True for 0-length values. 17777 by Shubhanshu Mishra <napsternxg>.
- |Fix| Fixed a bug in
metrics.jaccard_score which recommended the zero_division parameter when called with no true or predicted samples. 17826 by Richard Decal <crypdick> and Joseph Willard <josephwillard>
- |Fix| bug in
metrics.hinge_losswhere error occurs when
`y_true is missing some labels that are provided explicitly in the labels parameter. 17935 by Cary Goltermann <Ultramann>`.
- |Fix| Fix scorers that accept a pos_label parameter and compute their metrics
from values returned by decision_function or predict_proba. Previously, they would return erroneous values when pos_label was not corresponding to classifier.classes_[1]. This is especially important when training classifiers directly with string labeled target classes. 18114 by Guillaume Lemaitre <glemaitre>.
- |Fix| Fixed bug in
metrics.plot_confusion_matrixwhere error occurs
when y_true contains labels that were not previously seen by the classifier while the labels and display_labels parameters are set to None. 18405 by Thomas J. Fan <thomasjpfan> and Yakov Pchelintsev <kyouma>.
sklearn.model_selection ..............................
- |MajorFeature| Added (experimental) parameter search estimators
model_selection.HalvingRandomSearchCV and model_selection.HalvingGridSearchCV which implement Successive Halving, and can be used as a drop-in replacements for model_selection.RandomizedSearchCV and model_selection.GridSearchCV. 13900 by Nicolas Hug_, Joel Nothman_ and Andreas Müller_.
- |Feature|
model_selection.RandomizedSearchCVand
model_selection.GridSearchCV now have the method `score_samples 17478 by Teon Brooks <teonbrooks> and Mohamed Maskani <maskani-moh>`.
- |Enhancement|
model_selection.TimeSeriesSplithas two new keyword
arguments test_size and gap. test_size allows the out-of-sample time series length to be fixed for all folds. gap removes a fixed number of samples between the train and test set on each fold. 13204 by Kyle Kosic <kykosic>.
- |Enhancement|
model_selection.permutation_test_scoreand
model_selection.validation_curve now accept fit_params to pass additional estimator parameters. 18527 by Gaurav Dhingra <gxyd>, Julien Jerphanion <jjerphan> and Amanda Dsouza <amy12xx>.
- |Enhancement|
model_selection.cross_val_score,
model_selection.cross_validate, model_selection.GridSearchCV, and model_selection.RandomizedSearchCV allows estimator to fail scoring and replace the score with error_score. If error_score="raise", the error will be raised. 18343 by Guillaume Lemaitre_ and Devi Sandeep <dsandeep0138>.
- |Enhancement|
model_selection.learning_curvenow accept fit_params
to pass additional estimator parameters. 18595 by Amanda Dsouza <amy12xx>.
- |Fix| Fixed the
lenofmodel_selection.ParameterSamplerwhen
all distributions are lists and n_iter is more than the number of unique parameter combinations. 18222 by Nicolas Hug_.
- |Fix| A fix to raise warning when one or more CV splits of
model_selection.GridSearchCV and model_selection.RandomizedSearchCV results in non-finite scores. 18266 by Subrat Sahu <subrat93>, Nirvan <Nirvan101> and Arthur Book <ArthurBook>.
- |Enhancement|
model_selection.GridSearchCV,
model_selection.RandomizedSearchCV and model_selection.cross_validate support scoring being a callable returning a dictionary of multiple metric names/values association. 15126 by Thomas Fan_.
sklearn.multiclass .........................
- |Enhancement|
multiclass.OneVsOneClassifiernow accepts
the inputs with missing values. Hence, estimators which can handle missing values (may be a pipeline with imputation step) can be used as a estimator for multiclass wrappers. 17987 by Venkatachalam N <venkyyuvy>.
- |Fix| A fix to allow
multiclass.OutputCodeClassifierto accept
sparse input data in its fit and predict methods. The check for validity of the input is now delegated to the base estimator. 17233 by Zolisa Bleki <zoj613>.
sklearn.multioutput ..........................
- |Enhancement|
multioutput.MultiOutputClassifierand
multioutput.MultiOutputRegressor now accepts the inputs with missing values. Hence, estimators which can handle missing values (may be a pipeline with imputation step, HistGradientBoosting estimators) can be used as a estimator for multiclass wrappers. 17987 by Venkatachalam N <venkyyuvy>.
- |Fix| A fix to accept tuples for the `
order` parameter
in multioutput.ClassifierChain. 18124 by Gus Brocchini <boldloop> and Amanda Dsouza <amy12xx>.
sklearn.naive_bayes ..........................
- |Enhancement| Adds a parameter
min_categoriesto
naive_bayes.CategoricalNB that allows a minimum number of categories per feature to be specified. This allows categories unseen during training to be accounted for. 16326 by George Armstrong <gwarmstrong>.
- |API| The attributes `
coef_andintercept_` are now deprecated in
naive_bayes.MultinomialNB, naive_bayes.ComplementNB, naive_bayes.BernoulliNB and naive_bayes.CategoricalNB, and will be removed in v1.1 (renaming of 0.26). 17427 by Juan Carlos Alfaro Jiménez <alfaro96>.
sklearn.neighbors ........................
- |Efficiency| Speed up `
seuclidean,wminkowski,mahalanobis` and
`haversine metrics in neighbors.DistanceMetric by avoiding unexpected GIL acquiring in Cython when setting n_jobs>1 in neighbors.KNeighborsClassifier, neighbors.KNeighborsRegressor, neighbors.RadiusNeighborsClassifier, neighbors.RadiusNeighborsRegressor, metrics.pairwise_distances and by validating data out of loops. 17038 by Wenbo Zhao <webber26232>`.
- |Efficiency|
neighbors.NeighborsBasebenefits of an improved
algorithm = 'auto' heuristic. In addition to the previous set of rules, now, when the number of features exceeds 15, brute is selected, assuming the data intrinsic dimensionality is too high for tree-based methods. 17148 by Geoffrey Bolmier <gbolmier>.
- |Fix|
neighbors.BinaryTree
will raise a ValueError when fitting on data array having points with different dimensions. 18691 by Chiara Marmo <cmarmo>.
- |Fix|
neighbors.NearestCentroidwith a numericalshrink_threshold
will raise a ValueError when fitting on data with all constant features. 18370 by Trevor Waite <trewaite>.
- |Fix| In methods
radius_neighborsand
radius_neighbors_graph of neighbors.NearestNeighbors, neighbors.RadiusNeighborsClassifier, neighbors.RadiusNeighborsRegressor, and neighbors.RadiusNeighborsTransformer, using sort_results=True now correctly sorts the results even when fitting with the "brute" algorithm. 18612 by Tom Dupre la Tour_.
sklearn.neural_network .............................
- |Efficiency| Neural net training and prediction are now a little faster.
17603, 17604, 17606, 17608, 17609, 17633, 17661, 17932 by Alex Henrie <alexhenrie>.
- |Enhancement| Avoid converting float32 input to float64 in
neural_network.BernoulliRBM. 16352 by Arthur Imbert <Henley13>.
- |Enhancement| Support 32-bit computations in
neural_network.MLPClassifier and neural_network.MLPRegressor. 17759 by Srimukh Sripada <d3b0unce>.
- |Fix| Fix method
neural_network.MLPClassifier.fit
not iterating to `max_iter if warm started. 18269 by Norbert Preining <norbusan> and Guillaume Lemaitre <glemaitre>`.
sklearn.pipeline .......................
- |Enhancement| References to transformers passed through `
transformer_weights`
to pipeline.FeatureUnion that aren't present in `transformer_list will raise a ValueError. 17876 by Cary Goltermann <Ultramann>`.
- |Fix| A slice of a
pipeline.Pipelinenow inherits the parameters of
the original pipeline (memory and verbose). 18429 by Albert Villanova del Moral <albertvillanova> and Paweł Biernat <pwl>.
sklearn.preprocessing ............................
- |Feature|
preprocessing.OneHotEncodernow supports missing
values by treating them as a category. 17317 by Thomas Fan_.
- |Feature| Add a new `
handle_unknown` parameter with a
`use_encoded_value option, along with a new unknown_value parameter, to preprocessing.OrdinalEncoder to allow unknown categories during transform and set the encoded value of the unknown categories. 17406 by Felix Wick <FelixWick> and 18406 by Nicolas Hug`_.
- |Feature| Add `
clipparameter topreprocessing.MinMaxScaler`,
which clips the transformed values of test data to `feature_range. 17833 by Yashika Sharma <yashika51>`.
- |Feature| Add `
sample_weight` parameter to
preprocessing.StandardScaler. Allows setting individual weights for each sample. 18510 and 18447 and 16066 and 18682 by Maria Telenczuk <maikia> and Albert Villanova <albertvillanova> and panpiort8 and Alex Gramfort <agramfort>.
- |Enhancement| Verbose output of
model_selection.GridSearchCVhas
been improved for readability. 16935 by :user:Raghav Rajagopalan <raghavrv> and Chiara Marmo <cmarmo>.
- |Enhancement| Add `
unit_variancetopreprocessing.RobustScaler`,
which scales output data such that normally distributed features have a variance of 1. 17193 by Lucy Liu <lucyleeow> and Mabel Villalba <mabelvj>.
- |Enhancement| Add
dtypeparameter to
preprocessing.KBinsDiscretizer. 16335 by Arthur Imbert <Henley13>.
- |Fix| Raise error on
sklearn.preprocessing.OneHotEncoder.inverse_transform when handle_unknown='error' and drop=None for samples encoded as all zeros. 14982 by Kevin Winata <kwinata>.
sklearn.semi_supervised ..............................
- |MajorFeature| Added
semi_supervised.SelfTrainingClassifier, a
meta-classifier that allows any supervised classifier to function as a semi-supervised classifier that can learn from unlabeled data. 11682 by Oliver Rausch <orausch> and Patrice Becker <pr0duktiv>.
- |Fix| Fix incorrect encoding when using unicode string dtypes in
preprocessing.OneHotEncoder and preprocessing.OrdinalEncoder. 15763 by Thomas Fan_.
sklearn.svm ..................
- |Enhancement| invoke SciPy BLAS API for SVM kernel function in `
fit`,
`predict and related methods of svm.SVC, svm.NuSVC, svm.SVR, svm.NuSVR, svm.OneClassSVM. 16530 by Shuhua Fan <jim0421>`.
sklearn.tree ...................
- |Feature|
tree.DecisionTreeRegressornow supports the new splitting
criterion `'poisson' useful for modeling count data. 17386 by Christian Lorentzen <lorentzenchr>`.
- |Enhancement|
tree.plot_treenow uses colors from the matplotlib
configuration settings. 17187 by Andreas Müller_.
- |API| The parameter `
X_idx_sorted` is now deprecated in
tree.DecisionTreeClassifier.fit and tree.DecisionTreeRegressor.fit, and has no effect. 17614 by Juan Carlos Alfaro Jiménez <alfaro96>.
sklearn.utils ....................
- |Enhancement| Add `
check_methods_sample_order_invariance` to
~utils.estimator_checks.check_estimator, which checks that estimator methods are invariant if applied to the same dataset with different sample order 17598 by Jason Ngo <ngojason9>.
- |Enhancement| Add support for weights in
utils.sparse_func.incr_mean_variance_axis. By Maria Telenczuk <maikia> and Alex Gramfort <agramfort>.
- |Fix| Raise ValueError with clear error message in
utils.check_array
for sparse DataFrames with mixed types. 17992 by Thomas J. Fan <thomasjpfan> and Alex Shacked <alexshacked>.
- |Fix| Allow serialized tree based models to be unpickled on a machine
with different endianness. 17644 by Qi Zhang <qzhang90>.
- |Fix| Check that we raise proper error when axis=1 and the
dimensions do not match in utils.sparse_func.incr_mean_variance_axis. By Alex Gramfort <agramfort>.
Miscellaneous .............
- |Enhancement| Calls to `
repr` are now faster
when print_changed_only=True, especially with meta-estimators. 18508 by Nathan C. <Xethan>.
Thanks to everyone who has contributed to the maintenance and improvement of the project since version 0.23, including:
Abo7atm, Adam Spannbauer, Adrin Jalali, adrinjalali, Agamemnon Krasoulis, Akshay Deodhar, Albert Villanova del Moral, Alessandro Gentile, Alex Henrie, Alex Itkes, Alex Liang, Alexander Lenail, alexandracraciun, Alexandre Gramfort, alexshacked, Allan D Butler, Amanda Dsouza, amy12xx, Anand Tiwari, Anderson Nelson, Andreas Mueller, Ankit Choraria, Archana Subramaniyan, Arthur Imbert, Ashutosh Hathidara, Ashutosh Kushwaha, Atsushi Nukariya, Aura Munoz, AutoViz and Auto_ViML, Avi Gupta, Avinash Anakal, Ayako YAGI, barankarakus, barberogaston, beatrizsmg, Ben Mainye, Benjamin Bossan, Benjamin Pedigo, Bharat Raghunathan, Bhavika Devnani, Biprateep Dey, bmaisonn, Bo Chang, Boris Villazón-Terrazas, brigi, Brigitta Sipőcz, Bruno Charron, Byron Smith, Cary Goltermann, Cat Chenal, CeeThinwa, chaitanyamogal, Charles Patel, Chiara Marmo, Christian Kastner, Christian Lorentzen, Christoph Deil, Christos Aridas, Clara Matos, clmbst, Coelhudo, crispinlogan, Cristina Mulas, Daniel López, Daniel Mohns, darioka, Darshan N, david-cortes, Declan O'Neill, Deeksha Madan, Elizabeth DuPre, Eric Fiegel, Eric Larson, Erich Schubert, Erin Khoo, Erin R Hoffman, eschibli, Felix Wick, fhaselbeck, Forrest Koch, Francesco Casalegno, Frans Larsson, Gael Varoquaux, Gaurav Desai, Gaurav Sheni, genvalen, Geoffrey Bolmier, George Armstrong, George Kiragu, Gesa Stupperich, Ghislain Antony Vaillant, Gim Seng, Gordon Walsh, Gregory R. Lee, Guillaume Chevalier, Guillaume Lemaitre, Haesun Park, Hannah Bohle, Hao Chun Chang, Harry Scholes, Harsh Soni, Henry, Hirofumi Suzuki, Hitesh Somani, Hoda1394, Hugo Le Moine, hugorichard, indecisiveuser, Isuru Fernando, Ivan Wiryadi, j0rd1smit, Jaehyun Ahn, Jake Tae, James Hoctor, Jan Vesely, Jeevan Anand Anne, JeroenPeterBos, JHayes, Jiaxiang, Jie Zheng, Jigna Panchal, jim0421, Jin Li, Joaquin Vanschoren, Joel Nothman, Jona Sassenhagen, Jonathan, Jorge Gorbe Moya, Joseph Lucas, Joshua Newton, Juan Carlos Alfaro Jiménez, Julien Jerphanion, Justin Huber, Jérémie du Boisberranger, Kartik Chugh, Katarina Slama, kaylani2, Kendrick Cetina, Kenny Huynh, Kevin Markham, Kevin Winata, Kiril Isakov, kishimoto, Koki Nishihara, Krum Arnaudov, Kyle Kosic, Lauren Oldja, Laurenz Reitsam, Lisa Schwetlick, Louis Douge, Louis Guitton, Lucy Liu, Madhura Jayaratne, maikia, Manimaran, Manuel López-Ibáñez, Maren Westermann, Maria Telenczuk, Mariam-ke, Marijn van Vliet, Markus Löning, Martin Scheubrein, Martina G. Vilas, Martina Megasari, Mateusz Górski, mathschy, mathurinm, Matthias Bussonnier, Max Del Giudice, Michael, Milan Straka, Muoki Caleb, N. Haiat, Nadia Tahiri, Ph. D, Naoki Hamada, Neil Botelho, Nicolas Hug, Nils Werner, noelano, Norbert Preining, oj_lappi, Oleh Kozynets, Olivier Grisel, Pankaj Jindal, Pardeep Singh, Parthiv Chigurupati, Patrice Becker, Pete Green, pgithubs, Poorna Kumar, Prabakaran Kumaresshan, Probinette4, pspachtholz, pwalchessen, Qi Zhang, rachel fischoff, Rachit Toshniwal, Rafey Iqbal Rahman, Rahul Jakhar, Ram Rachum, RamyaNP, rauwuckl, Ravi Kiran Boggavarapu, Ray Bell, Reshama Shaikh, Richard Decal, Rishi Advani, Rithvik Rao, Rob Romijnders, roei, Romain Tavenard, Roman Yurchak, Ruby Werman, Ryotaro Tsukada, sadak, Saket Khandelwal, Sam, Sam Ezebunandu, Sam Kimbinyi, Sarah Brown, Saurabh Jain, Sean O. Stalley, Sergio, Shail Shah, Shane Keller, Shao Yang Hong, Shashank Singh, Shooter23, Shubhanshu Mishra, simonamaggio, Soledad Galli, Srimukh Sripada, Stephan Steinfurt, subrat93, Sunitha Selvan, Swier, Sylvain Marié, SylvainLan, t-kusanagi2, Teon L Brooks, Terence Honles, Thijs van den Berg, Thomas J Fan, Thomas J. Fan, Thomas S Benjamin, Thomas9292, Thorben Jensen, tijanajovanovic, Timo Kaufmann, tnwei, Tom Dupré la Tour, Trevor Waite, ufmayer, Umberto Lupo, Venkatachalam N, Vikas Pandey, Vinicius Rios Fuck, Violeta, watchtheblur, Wenbo Zhao, willpeppo, xavier dupré, Xethan, Xue Qianming, xun-tang, yagi-3, Yakov Pchelintsev, Yashika Sharma, Yi-Yan Ge, Yue Wu, Yutaro Ikeda, Zaccharie Ramzi, zoj613, Zhao Feng.