sklearn
In Development
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.
multiclass.OutputCodeClassifier.predict
now uses a more efficient pairwise distance reduction. As a consequence, the tie-breaking strategy is different and thus the predicted labels may be different.25196
byGuillaume Lemaitre <glemaitre>
.- The fit_transform method of
decomposition.DictionaryLearning
is more efficient but may produce different results as in previous versions when transform_algorithm is not the same as fit_algorithm and the number of iterations is small.24871
byOmar Salman <OmarManzoor>
.
The get_feature_names_out method of the following classes now raises a NotFittedError if the instance is not fitted. This ensures the error is consistent in all estimators with the get_feature_names_out method.
feature_extraction.text.TfidfTransformer
kernel_approximation.AdditiveChi2Sampler
impute.IterativeImputer
impute.KNNImputer
impute.SimpleImputer
isotonic.IsotonicRegression
preprocessing.Binarizer
preprocessing.MaxAbsScaler
preprocessing.MinMaxScaler
preprocessing.Normalizer
preprocessing.OrdinalEncoder
preprocessing.PowerTransformer
preprocessing.QuantileTransformer
preprocessing.RobustScaler
preprocessing.StandardScaler
The NotFittedError displays an informative message asking to fit the instance with the appropriate arguments.
25294
byJohn Pangas <jpangas>
and25291
,25367
byRahil Parikh <rprkh>
.
- A __sklearn_clone__ protocol is now available to override the default behavior of
base.clone
.24568
by Thomas Fan.
- The sample_weight parameter in predict for
cluster.KMeans.predict
andcluster.MiniBatchKMeans.predict
is now deprecated and will be removed in v1.5.25251
byGleb Levitski <glevv>
.
decomposition.DictionaryLearning
now accepts the parameter callback for consistency with the functiondecomposition.dict_learning
.24871
byOmar Salman <OmarManzoor>
.
- Compute a custom out-of-bag score by passing a callable to
ensemble.RandomForestClassifier
,ensemble.RandomForestRegressor
,ensemble.ExtraTreesClassifier
andensemble.ExtraTreesRegressor
.25177
byTim Head <betatim>
. ensemble.GradientBoostingClassifier
now exposes out-of-bag scores via the oob_scores_ or oob_score_ attributes.24882
byAshwin Mathur <awinml>
.
- Added
exception.InconsistentVersionWarning
which is raised when a scikit-learn estimator is unpickled with a scikit-learn version that is inconsistent with the sckit-learn verion the estimator was pickled with.25297
by Thomas Fan.
- Added the parameter fill_value to
impute.IterativeImputer
.25232
byThijs van Weezel <ValueInvestorThijs>
.
naive_bayes.GaussianNB
does not raise anymore a ZeroDivisionError when the provided sample_weight reduces the problem to a single class in fit.24140
byJonathan Ohayon <Johayon>
andChiara Marmo <cmarmo>
.
pipeline.FeatureUnion
can now use indexing notation (e.g. feature_union["scalar"]) to access transformers by name.25093
by Thomas Fan.pipeline.FeatureUnion
can now access the feature_names_in_ attribute if the X value seen during .fit has a columns attribute and all columns are strings. e.g. when X is a pandas.DataFrame25220
byIan Thompson <it176131>
.
- Adds a feature_name_combiner parameter to
preprocessing.OneHotEncoder
. This specifies a custom callable to create feature names to be returned byget_feature_names_out
. The callable combines input arguments (input_feature, category) to a string.22506
byMario Kostelac <mariokostelac>
. - Added support for sample_weight in
preprocessing.KBinsDiscretizer
. This allows specifying the parameter sample_weight for each sample to be used while fitting. The option is only available when strategy is set to quantile and kmeans.24935
bySeladus <seladus>
,Guillaume Lemaitre <glemaitre>
, andDea María Léon <deamarialeon>
,25257
byGleb Levitski <glevv>
. AdditiveChi2Sampler
is now stateless. The sample_interval_ attribute is deprecated and will be removed in 1.5.25190
byVincent Maladière <Vincent-Maladiere>
.
estimator_checks.check_transformers_unfitted_stateless
has been introduced to ensure stateless transformers don't raise NotFittedError during transform with no prior call to fit or fit_transform.25190
byVincent Maladière <Vincent-Maladiere>
.
Thanks to everyone who has contributed to the maintenance and improvement of the project since version 1.2, including:
TODO: update at the time of the release.