<commit_before>.. include:: _contributors.rst

.. currentmodule:: sklearn

.. _changes_0_22:

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.

- :class:`decomposition.SparseCoder`,
  :class:`decomposition.DictionaryLearning`, and
  :class:`decomposition.MiniBatchDictionaryLearning` |Fix|
- :class:`decomposition.SparseCoder` with `algorithm='lasso_lars'` |Fix|
- :class:`decomposition.SparsePCA` where `normalize_components` has no effect
  due to deprecation.

- :class:`linear_model.Ridge` when `X` is sparse. |Fix|

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|,
    |Fix| or |API| (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:
    :pr:`123456` by :user:`<NAME> <joeongithub>`.
    where 123456 is the *pull request* number, not the issue number.

:mod:`sklearn.base`
...................

- |API| From version 0.24 :meth:`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.
  :pr:`14464` by `<NAME>`_.

:mod:`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). :pr:`13575`
  by :user:`<NAME> <wdevazelhes>`.

:mod:`sklearn.datasets`
.......................

- |Feature| :func:`datasets.fetch_openml` now supports heterogeneous data using pandas
  by setting `as_frame=True`. :pr:`13902` by `<NAME>an`_.

- |Enhancement| The parameter `return_X_y` was added to
  :func:`datasets.fetch_20newsgroups` and :func:`datasets.fetch_olivetti_faces`
  . :pr:`14259` by :user:`<NAME> <souravsingh>`.

:mod:`sklearn.decomposition`
............................

- |Fix| :func:`decomposition.sparse_encode()` now passes the `max_iter` to the
  underlying `LassoLars` when `algorithm='lasso_lars'`. :issue:`12650` by
  `Adrin Jalali`_.

- |Enhancement| :func:`decomposition.dict_learning()` and
  :func:`decomposition.dict_learning_online()` now accept `method_max_iter` and
  pass it to `sparse_encode`. :issue:`12650` by `Adrin Jalali`_.

- |Enhancement| :class:`decomposition.SparseCoder`,
  :class:`decomposition.DictionaryLearning`, and
  :class:`decomposition.MiniBatchDictionaryLearning` now take a
  `transform_max_iter` parameter and pass it to either
  :func:`decomposition.dict_learning()` or
  :func:`decomposition.sparse_encode()`. :issue:`12650` by `Adrin Jalali`_.

- |Enhancement| :class:`decomposition.IncrementalPCA` now accepts sparse
  matrices as input, converting them to dense in batches thereby avoiding the
  need to store the entire dense matrix at once.
  :pr:`13960` by :user:`<NAME> <scottgigante>`.

:mod:`sklearn.ensemble`
.......................

- |Feature| :class:`ensemble.HistGradientBoostingClassifier` and
  :class:`ensemble.HistGradientBoostingRegressor` have an additional
  parameter called `warm_start` that enables warm starting. :pr:`14012` by
  :user:`<NAME> <johannfaouzi>`.

- |Fix| :class:`ensemble.HistGradientBoostingClassifier` and
  :class:`ensemble.HistGradientBoostingRegressor` now bin the training and
  validation data separately to avoid any data leak. :pr:`13933` by
  `<NAME>`_.

- |Fix| :func:`ensemble.VotingClassifier.predict_proba` will no longer be
  present when `voting='hard'`. :pr:`14287` by `<NAME>`_.

- |Enhancement| :class:`ensemble.HistGradientBoostingClassifier` the training
  loss or score is now monitored on a class-wise stratified subsample to
  preserve the class balance of the original training set. :pr:`14194`
  by :user:`<NAME> <johannfaouzi>`.

- |Fix| Run by default
  :func:`utils.estimator_checks.check_estimator` on both
  :class:`ensemble.VotingClassifier` and :class:`ensemble.VotingRegressor`. It
  leads to solve issues regarding shape consistency during `predict` which was
  failing when the underlying estimators were not outputting consistent array
  dimensions. Note that it should be replaced by refactoring the common tests
  in the future.
  :pr:`14305` by :user:`<NAME> <glemaitre>`.

- |Efficiency| :func:`ensemble.MissingIndicator.fit_transform` the
  _get_missing_features_info function is now called once when calling
  fit_transform for MissingIndicator class. :pr:`14356` by :user:
  `<NAME> <harsh020>`.

- |Fix| :class:`ensemble.AdaBoostClassifier` computes probabilities based on
  the decision function as in the literature. Thus, `predict` and
  `predict_proba` give consistent results.
  :pr:`14114` by :user:`<NAME> <glemaitre>`.

:mod:`sklearn.gaussian_process`
...............................

- |API| From version 0.24 :meth:`Kernel.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.
  :pr:`14464` by `<NAME>`_.

:mod:`sklearn.linear_model`
...........................

- |Enhancement| :class:`linear_model.BayesianRidge` now accepts hyperparameters
  ``alpha_init`` and ``lambda_init`` which can be used to set the initial value
  of the maximization procedure in :term:`fit`.
  :pr:`13618` by :user:`<NAME> <c56pony>`.

- |Fix| :class:`linear_model.Ridge` now correctly fits an intercept when `X` is
  sparse, `solver="auto"` and `fit_intercept=True`, because the default solver
  in this configuration has changed to `sparse_cg`, which can fit an intercept
  with sparse data. :pr:`13995` by :user:`<NAME> <jeromedockes>`.

- |Efficiency| The 'liblinear' logistic regression solver is now faster and
  requires less memory.
  :pr:`14108`, :pr:`14170` by :user:`<NAME> <alexhenrie>`.

- |Fix| :class:`linear_model.Ridge` with `solver='sag'` now accepts F-ordered
  and non-contiguous arrays and makes a conversion instead of failing.
  :pr:`14458` by :user:`<NAME> <glemaitre>`.<commit_msg>DOC add what's new entry for #13146<commit_after>.. include:: _contributors.rst

.. currentmodule:: sklearn

.. _changes_0_22:

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.

- :class:`decomposition.SparseCoder`,
  :class:`decomposition.DictionaryLearning`, and
  :class:`decomposition.MiniBatchDictionaryLearning` |Fix|
- :class:`decomposition.SparseCoder` with `algorithm='lasso_lars'` |Fix|
- :class:`decomposition.SparsePCA` where `normalize_components` has no effect
  due to deprecation.

- :class:`linear_model.Ridge` when `X` is sparse. |Fix|

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|,
    |Fix| or |API| (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:
    :pr:`123456` by :user:`<NAME> <joeongithub>`.
    where 123456 is the *pull request* number, not the issue number.

:mod:`sklearn.base`
...................

- |API| From version 0.24 :meth:`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.
  :pr:`14464` by `<NAME>`_.

:mod:`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). :pr:`13575`
  by :user:`<NAME> <wdevazelhes>`.

:mod:`sklearn.datasets`
.......................

- |Feature| :func:`datasets.fetch_openml` now supports heterogeneous data using pandas
  by setting `as_frame=True`. :pr:`13902` by `Th<NAME>`_.

- |Enhancement| The parameter `return_X_y` was added to
  :func:`datasets.fetch_20newsgroups` and :func:`datasets.fetch_olivetti_faces`
  . :pr:`14259` by :user:`<NAME> <souravsingh>`.

:mod:`sklearn.decomposition`
............................

- |Fix| :func:`decomposition.sparse_encode()` now passes the `max_iter` to the
  underlying `LassoLars` when `algorithm='lasso_lars'`. :issue:`12650` by
  `Adrin Jalali`_.

- |Enhancement| :func:`decomposition.dict_learning()` and
  :func:`decomposition.dict_learning_online()` now accept `method_max_iter` and
  pass it to `sparse_encode`. :issue:`12650` by `<NAME>`_.

- |Enhancement| :class:`decomposition.SparseCoder`,
  :class:`decomposition.DictionaryLearning`, and
  :class:`decomposition.MiniBatchDictionaryLearning` now take a
  `transform_max_iter` parameter and pass it to either
  :func:`decomposition.dict_learning()` or
  :func:`decomposition.sparse_encode()`. :issue:`12650` by `Adrin Jalali`_.

- |Enhancement| :class:`decomposition.IncrementalPCA` now accepts sparse
  matrices as input, converting them to dense in batches thereby avoiding the
  need to store the entire dense matrix at once.
  :pr:`13960` by :user:`<NAME> <scottgigante>`.

:mod:`sklearn.ensemble`
.......................

- |Feature| :class:`ensemble.HistGradientBoostingClassifier` and
  :class:`ensemble.HistGradientBoostingRegressor` have an additional
  parameter called `warm_start` that enables warm starting. :pr:`14012` by
  :user:`<NAME> <johannfaouzi>`.

- |Fix| :class:`ensemble.HistGradientBoostingClassifier` and
  :class:`ensemble.HistGradientBoostingRegressor` now bin the training and
  validation data separately to avoid any data leak. :pr:`13933` by
  `<NAME>`_.

- |Fix| :func:`ensemble.VotingClassifier.predict_proba` will no longer be
  present when `voting='hard'`. :pr:`14287` by `<NAME>`_.

- |Enhancement| :class:`ensemble.HistGradientBoostingClassifier` the training
  loss or score is now monitored on a class-wise stratified subsample to
  preserve the class balance of the original training set. :pr:`14194`
  by :user:`<NAME> <johannfaouzi>`.

- |Fix| Run by default
  :func:`utils.estimator_checks.check_estimator` on both
  :class:`ensemble.VotingClassifier` and :class:`ensemble.VotingRegressor`. It
  leads to solve issues regarding shape consistency during `predict` which was
  failing when the underlying estimators were not outputting consistent array
  dimensions. Note that it should be replaced by refactoring the common tests
  in the future.
  :pr:`14305` by :user:`<NAME> <glemaitre>`.

- |Efficiency| :func:`ensemble.MissingIndicator.fit_transform` the
  _get_missing_features_info function is now called once when calling
  fit_transform for MissingIndicator class. :pr:`14356` by :user:
  `<NAME> <harsh020>`.

- |Fix| :class:`ensemble.AdaBoostClassifier` computes probabilities based on
  the decision function as in the literature. Thus, `predict` and
  `predict_proba` give consistent results.
  :pr:`14114` by :user:`<NAME> <glemaitre>`.

:mod:`sklearn.gaussian_process`
...............................

- |API| From version 0.24 :meth:`Kernel.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.
  :pr:`14464` by `<NAME>`_.

:mod:`sklearn.inspection`
.........................

- |MajorFeature| :func:`inspection.permutation_importance` has been added to
  measure the importance of each feature in an arbitrary trained model with
  respect to a given scoring function. :issue:`13146` by `<NAME>`_.

:mod:`sklearn.linear_model`
...........................

- |Enhancement| :class:`linear_model.BayesianRidge` now accepts hyperparameters
  ``alpha_init`` and ``lambda_init`` which can be used to set the initial value
  of the maximization procedure in :term:`fit`.
  :pr:`13618` by :user:`<NAME> <c56pony>`.

- |Fix| :class:`linear_model.Ridge` now correctly fits an intercept when `X` is
  sparse, `solver="auto"` and `fit_intercept=True`, because the default solver
  in this configuration has changed to `sparse_cg`, which can fit an intercept
  with sparse data. :pr:`13995` by :user:`<NAME> <jeromedockes>`.

- |Efficiency| The 'liblinear' logistic regression solver is now faster and
  requires less memory.
  :pr:`14108`, :pr:`14170` by :user:`<NAME> <alexhenrie>`.

- |Fix| :class:`linear_model.Ridge` with `solver='sag'` now accepts F-ordered
  and non-contiguous arrays and makes a conversion instead of failing.
  :pr:`14458` by :user:`<NAME> <glemaitre>`.
{'fraction_non_alphanumeric': 0.14257367531417653, 'fraction_numerical': 0.020871610200632027, 'mean_word_length': 4.3281127642913075, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3589702', 'n_tokens_mistral': 4521, 'n_tokens_neox': 4153, 'n_words': 1368}