Skip to content

Commit

Permalink
Merge branch 'main' into submodulev3
Browse files Browse the repository at this point in the history
  • Loading branch information
adam2392 committed Feb 23, 2024
2 parents 33039e2 + fe718a8 commit 94517a3
Show file tree
Hide file tree
Showing 50 changed files with 905 additions and 333 deletions.
2 changes: 1 addition & 1 deletion build_tools/azure/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ scikit_learn_install() {
python setup.py develop
fi

ccache -s
ccache -s || echo "ccache not installed, skipping ccache statistics"
}

main() {
Expand Down
29 changes: 0 additions & 29 deletions build_tools/azure/install_win.sh

This file was deleted.

26 changes: 12 additions & 14 deletions build_tools/azure/python_nogil_lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@
--index-url https://d1yxz45j0ypngg.cloudfront.net/
--extra-index-url https://pypi.org/simple

contourpy==1.0.7
# via
# -r /scikit-learn/build_tools/azure/python_nogil_requirements.txt
# matplotlib
cycler==0.11.0
contourpy==1.1.1
# via matplotlib
cycler==0.12.1
# via matplotlib
cython==0.29.33
cython==3.0.8
# via -r /scikit-learn/build_tools/azure/python_nogil_requirements.txt
exceptiongroup==1.1.2
exceptiongroup==1.2.0
# via pytest
execnet==2.0.2
# via pytest-xdist
fonttools==4.42.0
fonttools==4.49.0
# via matplotlib
iniconfig==2.0.0
# via pytest
joblib==1.3.1
joblib==1.3.2
# via -r /scikit-learn/build_tools/azure/python_nogil_requirements.txt
kiwisolver==1.4.4
# via matplotlib
Expand All @@ -35,29 +33,29 @@ numpy==1.24.0
# contourpy
# matplotlib
# scipy
packaging==23.1
packaging==23.2
# via
# matplotlib
# pytest
pillow==9.5.0
# via matplotlib
pluggy==1.2.0
pluggy==1.4.0
# via pytest
pyparsing==3.1.1
# via matplotlib
pytest==7.4.0
pytest==8.0.1
# via
# -r /scikit-learn/build_tools/azure/python_nogil_requirements.txt
# pytest-xdist
pytest-xdist==3.3.1
pytest-xdist==3.5.0
# via -r /scikit-learn/build_tools/azure/python_nogil_requirements.txt
python-dateutil==2.8.2
# via matplotlib
scipy==1.9.3
# via -r /scikit-learn/build_tools/azure/python_nogil_requirements.txt
six==1.16.0
# via python-dateutil
threadpoolctl==3.2.0
threadpoolctl==3.3.0
# via -r /scikit-learn/build_tools/azure/python_nogil_requirements.txt
tomli==2.0.1
# via pytest
3 changes: 0 additions & 3 deletions build_tools/azure/python_nogil_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# the latest cython will be picked up from PyPI, rather than the one from the
# python-nogil index
matplotlib
# 2023-07-15 contourpy 1.1 needs meson which needs a recent pybind version
# which is not available for python/nogil ...
contourpy<1.1
numpy
scipy
cython
Expand Down
2 changes: 1 addition & 1 deletion build_tools/azure/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
architecture: 'x86'
displayName: Use 32 bit System Python
condition: and(succeeded(), eq(variables['PYTHON_ARCH'], '32'))
- bash: ./build_tools/azure/install_win.sh
- bash: ./build_tools/azure/install.sh
displayName: 'Install'
- bash: ./build_tools/azure/test_script.sh
displayName: 'Test Library'
Expand Down
10 changes: 7 additions & 3 deletions doc/modules/calibration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,14 @@ by showing the number of samples in each predicted probability bin.

.. currentmodule:: sklearn.linear_model

:class:`LogisticRegression` returns well calibrated predictions by default as it has a
:class:`LogisticRegression` is more likely to return well calibrated predictions by itself as it has a
canonical link function for its loss, i.e. the logit-link for the :ref:`log_loss`.
This leads to the so-called **balance property**, see [8]_ and
:ref:`Logistic_regression`.
In the unpenalized case, this leads to the so-called **balance property**, see [8]_ and :ref:`Logistic_regression`.
In the plot above, data is generated according to a linear mechanism, which is
consistent with the :class:`LogisticRegression` model (the model is 'well specified'),
and the value of the regularization parameter `C` is tuned to be
appropriate (neither too strong nor too low). As a consequence, this model returns
accurate predictions from its `predict_proba` method.
In contrast to that, the other shown models return biased probabilities; with
different biases per model.

Expand Down
10 changes: 9 additions & 1 deletion doc/modules/ensemble.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ are not yet supported, for instance some loss functions.

.. topic:: Examples:

* :ref:`sphx_glr_auto_examples_inspection_plot_partial_dependence.py`
* :ref:`sphx_glr_auto_examples_inspection_plot_partial_dependence.py`
* :ref:`sphx_glr_auto_examples_ensemble_plot_forest_hist_grad_boosting_comparison.py`

Usage
^^^^^
Expand Down Expand Up @@ -129,6 +130,8 @@ Note that for technical reasons, using a callable as a scorer is significantly s
than using the loss. By default, early-stopping is performed if there are at least
10,000 samples in the training set, using the validation loss.

.. _nan_support_hgbt:

Missing values support
^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -167,6 +170,10 @@ If no missing values were encountered for a given feature during training,
then samples with missing values are mapped to whichever child has the most
samples.

.. topic:: Examples:

* :ref:`sphx_glr_auto_examples_ensemble_plot_hgbt_regression.py`

.. _sw_hgbdt:

Sample weight support
Expand Down Expand Up @@ -331,6 +338,7 @@ Also, monotonic constraints are not supported for multiclass classification.
.. topic:: Examples:

* :ref:`sphx_glr_auto_examples_ensemble_plot_monotonic_constraints.py`
* :ref:`sphx_glr_auto_examples_ensemble_plot_hgbt_regression.py`

.. _interaction_cst_hgbt:

Expand Down
2 changes: 1 addition & 1 deletion doc/modules/linear_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ orthogonal matching pursuit can approximate the optimum solution vector with a
fixed number of non-zero elements:

.. math::
\underset{w}{\operatorname{arg\,min\,}} ||y - Xw||_2^2 \text{ subject to } ||w||_0 \leq n_{\text{nonzero\_coefs}}
\underset{w}{\operatorname{arg\,min\,}} ||y - Xw||_2^2 \text{ subject to } ||w||_0 \leq n_{\text{nonzero_coefs}}
Alternatively, orthogonal matching pursuit can target a specific error instead
of a specific number of non-zero coefficients. This can be expressed as:
Expand Down
4 changes: 2 additions & 2 deletions doc/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ <h4 class="sk-landing-subheader text-white font-italic mb-3">Machine Learning in
and <a href="supervised_learning.html#supervised-learning">more...</a></p>
</div>
<div class="overflow-hidden mx-2 text-center flex-fill">
<a href="auto_examples/ensemble/plot_adaboost_regression.html" aria-label="Regression">
<img src="_images/sphx_glr_plot_adaboost_regression_thumb.png" class="sk-index-img" alt="Decision Tree Regression with AdaBoost">
<a href="auto_examples/ensemble/plot_hgbt_regression.html" aria-label="Regression">
<img src="_images/sphx_glr_plot_hgbt_regression_002.png" class="sk-index-img" alt="Decision Tree Regression with HGBT">
</a>
</div>
<a href="auto_examples/index.html#examples" class="sk-btn-primary btn text-white btn-block" role="button">Examples</a>
Expand Down
13 changes: 13 additions & 0 deletions doc/whats_new/v1.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,24 @@ Changelog
:mod:`sklearn.linear_model`
...........................

- |Fix| :class:`linear_model.ElasticNet`, :class:`linear_model.ElasticNetCV`,
:class:`linear_model.Lasso` and :class:`linear_model.LassoCV` now explicitly don't
accept large sparse data formats. :pr:`27576` by :user:`Stefanie Senger
<StefanieSenger>`.

- |API| :class:`linear_model.RidgeCV` and :class:`linear_model.RidgeClassifierCV`
will now allow `alpha=0` when `cv != None`, which is consistent with
:class:`linear_model.Ridge` and :class:`linear_model.RidgeClassifier`.
:pr:`28425` by :user:`Lucy Liu <lucyleeow>`.

:mod:`sklearn.manifold`
.......................

- |API| Deprecates `n_iter` in favor of `max_iter` in :class:`manifold.TSNE`.
`n_iter` will be removed in version 1.7. This makes :class:`manifold.TSNE`
consistent with the rest of the estimators. :pr:`28471` by
:user:`Lucy Liu <lucyleeow>`

:mod:`sklearn.metrics`
......................

Expand Down
4 changes: 4 additions & 0 deletions examples/ensemble/plot_adaboost_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
regressor. As the number of boosts is increased the regressor can fit more
detail.
See :ref:`sphx_glr_auto_examples_ensemble_plot_hgbt_regression.py` for an
example showcasing the benefits of using more efficient regression models such
as :class:`~ensemble.HistGradientBoostingRegressor`.
.. [1] `H. Drucker, "Improving Regressors using Boosting Techniques", 1997.
<https://citeseerx.ist.psu.edu/doc_view/pid/8d49e2dedb817f2c3330e74b63c5fc86d2399ce3>`_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
the predicted value. RFs, on the other hand, are based on bagging and use a
majority vote to predict the outcome.
For more information on ensemble models, see the :ref:`User Guide <ensemble>`.
See the :ref:`User Guide <ensemble>` for more information on ensemble models or
see :ref:`sphx_glr_auto_examples_ensemble_plot_hgbt_regression.py` for an
example showcasing some other features of HGBT models.
"""

# Author: Arturo Amor <david-arturo.amor-quiroz@inria.fr>
Expand Down
4 changes: 4 additions & 0 deletions examples/ensemble/plot_gradient_boosting_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
We will work with the Ames Iowa Housing dataset which consists of numerical
and categorical features, where the houses' sales prices is the target.
See :ref:`sphx_glr_auto_examples_ensemble_plot_hgbt_regression.py` for an
example showcasing some other features of
:class:`~ensemble.HistGradientBoostingRegressor`.
"""

# %%
Expand Down
4 changes: 3 additions & 1 deletion examples/ensemble/plot_gradient_boosting_quantile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
=====================================================
This example shows how quantile regression can be used to create prediction
intervals.
intervals. See :ref:`sphx_glr_auto_examples_ensemble_plot_hgbt_regression.py`
for an example showcasing some other features of
:class:`~ensemble.HistGradientBoostingRegressor`.
"""

Expand Down
5 changes: 4 additions & 1 deletion examples/ensemble/plot_gradient_boosting_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
and 500 regression trees of depth 4.
Note: For larger datasets (n_samples >= 10000), please refer to
:class:`~sklearn.ensemble.HistGradientBoostingRegressor`.
:class:`~sklearn.ensemble.HistGradientBoostingRegressor`. See
:ref:`sphx_glr_auto_examples_ensemble_plot_hgbt_regression.py` for an example
showcasing some other advantages of
:class:`~ensemble.HistGradientBoostingRegressor`.
"""

Expand Down
Loading

0 comments on commit 94517a3

Please sign in to comment.