<commit_before>.. include:: _contributors.rst

.. currentmodule:: sklearn

.. _changes_0_20:

Version 0.20 (under 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.IncrementalPCA` in Python 2 (bug fix)
- :class:`isotonic.IsotonicRegression` (bug fix)
- :class:`linear_model.ARDRegression` (bug fix)
- :class:`linear_model.OrthogonalMatchingPursuit` (bug fix)
- :class:`metrics.roc_auc_score` (bug fix)
- :class:`metrics.roc_curve` (bug fix)
- :class:`neural_network.BaseMultilayerPerceptron` (bug fix)
- :class:`neural_network.MLPRegressor` (bug fix)
- :class:`neural_network.MLPClassifier` (bug 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
---------

Support for Python 3.3 has been officially dropped.

New features
............

Classifiers and regressors

- :class:`ensemble.GradientBoostingClassifier` and
  :class:`ensemble.GradientBoostingRegressor` now support early stopping
  via ``n_iter_no_change``, ``validation_fraction`` and ``tol``. :issue:`7071`
  by `Raghav RV`_

- Added :class:`naive_bayes.ComplementNB`, which implements the Complement
  Naive Bayes classifier described in Rennie et al. (2003).
  :issue:`8190` by :user:`<NAME> <airalcorn2>`.

Preprocessing

- Added :class:`preprocessing.CategoricalEncoder`, which allows to encode
  categorical features as a numeric array, either using a one-hot (or
  dummy) encoding scheme or by converting to ordinal integers.
  Compared to the existing :class:`OneHotEncoder`, this new class handles
  encoding of all feature types (also handles string-valued features) and
  derives the categories based on the unique values in the features instead of
  the maximum value in the features. :issue:`9151` by
  :user:`<NAME> <vighneshbirodkar>` and `<NAME>`_.

- Added :class:`preprocessing.PowerTransformer`, which implements the Box-Cox
  power transformation, allowing users to map data from any distribution to a
  Gaussian distribution. This is useful as a variance-stabilizing transformation
  in situations where normality and homoscedasticity are desirable.
  :issue:`10210` by :user:`<NAME> <ericchang00>` and
  :user:`<NAME> <maniteja123>`.


Model evaluation

- Added the :func:`metrics.balanced_accuracy_score` metric and a corresponding
  ``'balanced_accuracy'`` scorer for binary classification.
  :issue:`8066` by :user:`xyguo` and :user:`<NAME> <dalmia>`.

- Added :class:`multioutput.RegressorChain` for multi-target
  regression. :issue:`9257` by :user:`<NAME> <thechargedneutron>`.

- Added the :class:`preprocessing.TransformedTargetRegressor` which transforms
  the target y before fitting a regression model. The predictions are mapped
  back to the original space via an inverse transform. :issue:`9041` by
  `<NAME>`_ and :user:`<NAME> <glemaitre>`.

Enhancements
............

Classifiers and regressors

- In :class:`gaussian_process.GaussianProcessRegressor`, method ``predict``
  is faster when using ``return_std=True`` in particular more when called
  several times in a row. :issue:`9234` by :user:`andrewww <andrewww>`
  and :user:`<NAME> <minghui-liu>`.

- Add `named_estimators_` parameter in
  :class:`ensemble.VotingClassifier` to access fitted
  estimators. :issue:`9157` by :user:`<NAME> <herilalaina>`.

- Add `var_smoothing` parameter in
  :class:`naive_bayes.GaussianNB` to give a precise control over
  variances calculation. :issue:`9681` by :user:`<NAME> <Mottl>`.

- Add `n_iter_no_change` parameter in
  :class:`neural_network.BaseMultilayerPerceptron`,
  :class:`neural_network.MLPRegressor`, and
  :class:`neural_network.MLPClassifier` to give control over
  maximum number of epochs to not meet ``tol`` improvement.
  :issue:`9456` by :user:`<NAME> <nnadeau>`.

- A parameter ``check_inverse`` was added to
  :class:`preprocessing.FunctionTransformer` to ensure that ``func`` and
  ``inverse_func`` are the inverse of each other.
  :issue:`9399` by :user:`<NAME> <glemaitre>`.

- Add `sample_weight` parameter to the fit method of
  :class:`linear_model.BayesianRidge` for weighted linear regression.
  :issue:`10111` by :user:`<NAME> <pstjohn>`.

Model evaluation and meta-estimators

- A scorer based on :func:`metrics.brier_score_loss` is also available.
  :issue:`9521` by :user:`<NAME> <qinhanmin2014>`.

- The default of ``iid`` parameter of :class:`model_selection.GridSearchCV`
  and :class:`model_selection.RandomizedSearchCV` will change from ``True`` to
  ``False`` in version 0.22 to correspond to the standard definition of
  cross-validation, and the parameter will be removed in version 0.24
  altogether. This parameter is of greatest practical significance where the
  sizes of different test sets in cross-validation were very unequal, i.e. in
  group-based CV strategies. :issue:`9085` by :user:`<NAME> <ldirer>`
  and `<NAME>`_.

Metrics

- :func:`metrics.roc_auc_score` now supports binary ``y_true`` other than
  ``{0, 1}`` or ``{-1, 1}``. :issue:`9828` by :user:`<NAME> <qinhanmin2014>`.

Linear, kernelized and related models

- Deprecate ``random_state`` parameter in :class:`svm.OneClassSVM` as the
  underlying implementation is not random.
  :issue:`9497` by :user:`<NAME> <albertcthomas>`.

Miscellaneous

- Add ``filename`` attribute to datasets that have a CSV file.
  :issue:`9101` by :user:`alex-33 <alex-33>`
  and :user:`<NAME> <maskani-moh>`.

Bug fixes
.........

Classifiers and regressors

- Fixed a bug in :class:`isotonic.IsotonicRegression` which incorrectly
  combined weights when fitting a model to data involving points with
  identical X values.
  :issue:`9432` by :user:`<NAME> <dallascard>`

- Fixed a bug in :class:`neural_network.BaseMultilayerPerceptron`,
  :class:`neural_network.MLPRegressor`, and
  :class:`neural_network.MLPClassifier` with new ``n_iter_no_change``
  parameter now at 10 from previously hardcoded 2.
  :issue:`9456` by :user:`<NAME> <nnadeau>`.

- Fixed a bug in :class:`neural_network.MLPRegressor` where fitting
  quit unexpectedly early due to local minima or fluctuations.
  :issue:`9456` by :user:`<NAME> <nnadeau>`

- Fixed a bug in :class:`naive_bayes.GaussianNB` which incorrectly raised
  error for prior list which summed to 1.
  :issue:`10005` by :user:`<NAME> <gxyd>`.

- Fixed a bug in :class:`linear_model.OrthogonalMatchingPursuit` that was
  broken when setting ``normalize=False``.
  :issue:`10071` by `<NAME>`_.

- Fixed a bug in :class:`linear_model.ARDRegression` which caused incorrectly
  updated estimates for the standard deviation and the coefficients.
  :issue:`10153` by :user:`<NAME> <jdoepfert>`.

- Fixed a bug when fitting :class:`ensemble.GradientBoostingClassifier` or
  :class:`ensemble.GradientBoostingRegressor` with ``warm_start=True`` which
  previously raised a segmentation fault due to a non-conversion of CSC matrix
  into CSR format expected by ``decision_function``. Similarly, Fortran-ordered
  arrays are converted to C-ordered arrays in the dense case. :issue:`9991` by
  :user:`<NAME> <glemaitre>`.

Decomposition, manifold learning and clustering

- Fix for uninformative error in :class:`decomposition.IncrementalPCA`:
  now an error is raised if the number of components is larger than the
  chosen batch size. The ``n_components=None`` case was adapted accordingly.
  :issue:`6452`. By :user:`<NAME> <wallygauze>`.

- Fixed a bug where the ``partial_fit`` method of
  :class:`decomposition.IncrementalPCA` used integer division instead of float
  division on Python 2 versions. :issue:`9492` by
  :user:`<NAME> <jrbourbeau>`.

- Fixed a bug where the ``fit`` method of
  :class:`cluster.AffinityPropagation` stored cluster
  centers as 3d array instead of 2d array in case of non-convergence. For the<commit_msg>DOC Added entry for #9579 to Whats New (#10312)<commit_after>.. include:: _contributors.rst

.. currentmodule:: sklearn

.. _changes_0_20:

Version 0.20 (under 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.IncrementalPCA` in Python 2 (bug fix)
- :class:`isotonic.IsotonicRegression` (bug fix)
- :class:`linear_model.ARDRegression` (bug fix)
- :class:`linear_model.OrthogonalMatchingPursuit` (bug fix)
- :class:`metrics.roc_auc_score` (bug fix)
- :class:`metrics.roc_curve` (bug fix)
- :class:`neural_network.BaseMultilayerPerceptron` (bug fix)
- :class:`neural_network.MLPRegressor` (bug fix)
- :class:`neural_network.MLPClassifier` (bug 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
---------

Support for Python 3.3 has been officially dropped.

New features
............

Classifiers and regressors

- :class:`ensemble.GradientBoostingClassifier` and
  :class:`ensemble.GradientBoostingRegressor` now support early stopping
  via ``n_iter_no_change``, ``validation_fraction`` and ``tol``. :issue:`7071`
  by `Raghav RV`_

- Added :class:`naive_bayes.ComplementNB`, which implements the Complement
  Naive Bayes classifier described in Rennie et al. (2003).
  :issue:`8190` by :user:`<NAME> <airalcorn2>`.

Preprocessing

- Added :class:`preprocessing.CategoricalEncoder`, which allows to encode
  categorical features as a numeric array, either using a one-hot (or
  dummy) encoding scheme or by converting to ordinal integers.
  Compared to the existing :class:`OneHotEncoder`, this new class handles
  encoding of all feature types (also handles string-valued features) and
  derives the categories based on the unique values in the features instead of
  the maximum value in the features. :issue:`9151` by
  :user:`<NAME> <vighneshbirodkar>` and `<NAME>`_.

- Added :class:`preprocessing.PowerTransformer`, which implements the Box-Cox
  power transformation, allowing users to map data from any distribution to a
  Gaussian distribution. This is useful as a variance-stabilizing transformation
  in situations where normality and homoscedasticity are desirable.
  :issue:`10210` by :user:`<NAME> <ericchang00>` and
  :user:`<NAME> <maniteja123>`.


Model evaluation

- Added the :func:`metrics.balanced_accuracy_score` metric and a corresponding
  ``'balanced_accuracy'`` scorer for binary classification.
  :issue:`8066` by :user:`xyguo` and :user:`<NAME> <dalmia>`.

- Added :class:`multioutput.RegressorChain` for multi-target
  regression. :issue:`9257` by :user:`<NAME> <thechargedneutron>`.

- Added the :class:`preprocessing.TransformedTargetRegressor` which transforms
  the target y before fitting a regression model. The predictions are mapped
  back to the original space via an inverse transform. :issue:`9041` by
  `<NAME>`_ and :user:`<NAME> <glemaitre>`.

Enhancements
............

Classifiers and regressors

- In :class:`gaussian_process.GaussianProcessRegressor`, method ``predict``
  is faster when using ``return_std=True`` in particular more when called
  several times in a row. :issue:`9234` by :user:`andrewww <andrewww>`
  and :user:`<NAME> <minghui-liu>`.

- Add `named_estimators_` parameter in
  :class:`ensemble.VotingClassifier` to access fitted
  estimators. :issue:`9157` by :user:`<NAME>arison <herilalaina>`.

- Add `var_smoothing` parameter in
  :class:`naive_bayes.GaussianNB` to give a precise control over
  variances calculation. :issue:`9681` by :user:`<NAME> <Mottl>`.

- Add `n_iter_no_change` parameter in
  :class:`neural_network.BaseMultilayerPerceptron`,
  :class:`neural_network.MLPRegressor`, and
  :class:`neural_network.MLPClassifier` to give control over
  maximum number of epochs to not meet ``tol`` improvement.
  :issue:`9456` by :user:`<NAME> <nnadeau>`.

- A parameter ``check_inverse`` was added to
  :class:`preprocessing.FunctionTransformer` to ensure that ``func`` and
  ``inverse_func`` are the inverse of each other.
  :issue:`9399` by :user:`<NAME> <glemaitre>`.

- Add `sample_weight` parameter to the fit method of
  :class:`linear_model.BayesianRidge` for weighted linear regression.
  :issue:`10111` by :user:`<NAME> <pstjohn>`.

Model evaluation and meta-estimators

- A scorer based on :func:`metrics.brier_score_loss` is also available.
  :issue:`9521` by :user:`<NAME> <qinhanmin2014>`.

- The default of ``iid`` parameter of :class:`model_selection.GridSearchCV`
  and :class:`model_selection.RandomizedSearchCV` will change from ``True`` to
  ``False`` in version 0.22 to correspond to the standard definition of
  cross-validation, and the parameter will be removed in version 0.24
  altogether. This parameter is of greatest practical significance where the
  sizes of different test sets in cross-validation were very unequal, i.e. in
  group-based CV strategies. :issue:`9085` by :user:`<NAME> <ldirer>`
  and `<NAME>`_.

Metrics

- :func:`metrics.roc_auc_score` now supports binary ``y_true`` other than
  ``{0, 1}`` or ``{-1, 1}``. :issue:`9828` by :user:`<NAME> <qinhanmin2014>`.

Linear, kernelized and related models

- Deprecate ``random_state`` parameter in :class:`svm.OneClassSVM` as the
  underlying implementation is not random.
  :issue:`9497` by :user:`<NAME> <albertcthomas>`.

Miscellaneous

- Add ``filename`` attribute to datasets that have a CSV file.
  :issue:`9101` by :user:`alex-33 <alex-33>`
  and :user:`<NAME> <maskani-moh>`.

Bug fixes
.........

Classifiers and regressors

- Fixed a bug in :class:`isotonic.IsotonicRegression` which incorrectly
  combined weights when fitting a model to data involving points with
  identical X values.
  :issue:`9432` by :user:`<NAME> <dallascard>`

- Fixed a bug in :class:`neural_network.BaseMultilayerPerceptron`,
  :class:`neural_network.MLPRegressor`, and
  :class:`neural_network.MLPClassifier` with new ``n_iter_no_change``
  parameter now at 10 from previously hardcoded 2.
  :issue:`9456` by :user:`<NAME> <nnadeau>`.

- Fixed a bug in :class:`neural_network.MLPRegressor` where fitting
  quit unexpectedly early due to local minima or fluctuations.
  :issue:`9456` by :user:`<NAME> <nnadeau>`

- Fixed a bug in :class:`naive_bayes.GaussianNB` which incorrectly raised
  error for prior list which summed to 1.
  :issue:`10005` by :user:`<NAME> <gxyd>`.

- Fixed a bug in :class:`linear_model.OrthogonalMatchingPursuit` that was
  broken when setting ``normalize=False``.
  :issue:`10071` by `<NAME>`_.

- Fixed a bug in :class:`linear_model.ARDRegression` which caused incorrectly
  updated estimates for the standard deviation and the coefficients.
  :issue:`10153` by :user:`<NAME> <jdoepfert>`.

- Fixed a bug when fitting :class:`ensemble.GradientBoostingClassifier` or
  :class:`ensemble.GradientBoostingRegressor` with ``warm_start=True`` which
  previously raised a segmentation fault due to a non-conversion of CSC matrix
  into CSR format expected by ``decision_function``. Similarly, Fortran-ordered
  arrays are converted to C-ordered arrays in the dense case. :issue:`9991` by
  :user:`<NAME> <glemaitre>`.

- Fixed a bug in :class:`neighbors.NearestNeighbors` where fitting a
  NearestNeighbors model fails when a) the distance metric used is a
  callable and b) the input to the NearestNeighbors model is sparse.
  :issue:`9199` by :user:`<NAME> <tttthomasssss>`.

Decomposition, manifold learning and clustering

- Fix for uninformative error in :class:`decomposition.IncrementalPCA`:
  now an error is raised if the number of components is larger than the
  chosen batch size. The ``n_components=None`` case was adapted accordingly.
  :issue:`6452`. By :user:`<NAME> <wallygauze>`.

- Fixed a bug where the ``partial_fit`` method of
  :class:`decomposition.IncrementalPCA` used integer division instead of float
  division on Python 2 versions. :issue:`9492` by
  :user:`<NAME> <jrbourbeau>`.

- Fixed a bug where the ``fit`` method of
  :class:`cluster.AffinityPropagation` stored cluster
  centers as 3d array instead of 2d array in case of non-convergence. For the
{'fraction_non_alphanumeric': 0.11923100248650616, 'fraction_numerical': 0.020316574686154405, 'mean_word_length': 5.007285974499089, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3913489', 'n_tokens_mistral': 5467, 'n_tokens_neox': 5050, 'n_words': 1753}