Talip7/scikit-learn-issues-multilabel huggingface dataset:
Duplicate/incomplete dependency information

### Describe the issue linked to the documentation

Scikit-learn dependecies are described in two places:
* [**Installing scikit-learn**](https://scikit-learn.org/stable/install.html)
  https://scikit-learn.org/stable/install.html#installing-the-latest-release
* [**Installing the development version of scikit-learn**](https://scikit-learn.org/stable/developers/advanced_installation.html)
  https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies


### Suggest a potential alternative/fix

I suggest removing the incomplete [Dependencies](https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies) section from _[Installing the development version of scikit-learn](https://scikit-learn.org/stable/developers/advanced_installation.html)_ and referring to the extensive dependency list under _[Installing scikit-learn](https://scikit-learn.org/stable/install.html)_.

COMMENT:
There are actually two lists in the **same page** [Installing the development version of scikit-learn](https://scikit-learn.org/stable/developers/advanced_installation.html):
* The minimum dependencies to be able to build scikit-learn from source are in the [Building from source](https://scikit-learn.org/stable/developers/advanced_installation.html#building-from-source) section:
  > 2. Install a recent version of Python (3.9 or later at the time of writing) for instance using [Condaforge](https://conda-forge.org/download/). Conda-forge provides a conda-based distribution of Python and the most popular scientific libraries.
  >   If you installed Python with conda, we recommend to create a dedicated [conda environment](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) with all the build dependencies of scikit-learn (namely [NumPy](https://numpy.org/), [SciPy](https://www.scipy.org/), [Cython](https://cython.org/), [meson-python](https://mesonbuild.com/meson-python) and [Ninja](https://ninja-build.org/)):
* It is followed by the list I was referring to, part of the [Dependencies](https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies) section.

I ~~was suggesting~~ suggest removing the second list, which is totally redundant and incomplete. Somehow, the two sections need to be merged to have a single list to maintain in this page.

The [Installing scikit-learn](https://scikit-learn.org/stable/install.html) page can be kept as is (with the additional reference to Ninja if needed).

Labels: Documentation
Duplicate/incomplete dependency information

### Describe the issue linked to the documentation

Scikit-learn dependecies are described in two places:
* [**Installing scikit-learn**](https://scikit-learn.org/stable/install.html)
  https://scikit-learn.org/stable/install.html#installing-the-latest-release
* [**Installing the development version of scikit-learn**](https://scikit-learn.org/stable/developers/advanced_installation.html)
  https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies


### Suggest a potential alternative/fix

I suggest removing the incomplete [Dependencies](https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies) section from _[Installing the development version of scikit-learn](https://scikit-learn.org/stable/developers/advanced_installation.html)_ and referring to the extensive dependency list under _[Installing scikit-learn](https://scikit-learn.org/stable/install.html)_.

COMMENT:
Okay I misunderstood a bit what you were suggesting and rereading this page again, I agree with you that the ``Dependencies`` section should be removed. It's indeed not up-to-date and comes after the building instructions so too late.

Labels: Documentation
Duplicate/incomplete dependency information

### Describe the issue linked to the documentation

Scikit-learn dependecies are described in two places:
* [**Installing scikit-learn**](https://scikit-learn.org/stable/install.html)
  https://scikit-learn.org/stable/install.html#installing-the-latest-release
* [**Installing the development version of scikit-learn**](https://scikit-learn.org/stable/developers/advanced_installation.html)
  https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies


### Suggest a potential alternative/fix

I suggest removing the incomplete [Dependencies](https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies) section from _[Installing the development version of scikit-learn](https://scikit-learn.org/stable/developers/advanced_installation.html)_ and referring to the extensive dependency list under _[Installing scikit-learn](https://scikit-learn.org/stable/install.html)_.

COMMENT:
The alternative could be to remove the explicit list of dependencies from the [Building from source](https://scikit-learn.org/stable/developers/advanced_installation.html#building-from-source) section:
```diff
-   If you installed Python with conda, we recommend to create a dedicated
-   `conda environment`_ with all the build dependencies of scikit-learn
-   (namely NumPy_, SciPy_, Cython_, meson-python_ and Ninja_):
+   If you installed Python with conda, we recommend to create a dedicated
+   `conda environment`_ with all the build dependencies of scikit-learn:
```
The exact list of minimal dependencies would follow.

Labels: Documentation
Duplicate/incomplete dependency information

### Describe the issue linked to the documentation

Scikit-learn dependecies are described in two places:
* [**Installing scikit-learn**](https://scikit-learn.org/stable/install.html)
  https://scikit-learn.org/stable/install.html#installing-the-latest-release
* [**Installing the development version of scikit-learn**](https://scikit-learn.org/stable/developers/advanced_installation.html)
  https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies


### Suggest a potential alternative/fix

I suggest removing the incomplete [Dependencies](https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies) section from _[Installing the development version of scikit-learn](https://scikit-learn.org/stable/developers/advanced_installation.html)_ and referring to the extensive dependency list under _[Installing scikit-learn](https://scikit-learn.org/stable/install.html)_.

COMMENT:
> The alternative could be to remove the explicit list of dependencies from the [Building from source](https://scikit-learn.org/stable/developers/advanced_installation.html#building-from-source) section:

I prefer your first suggestion to remove the ``Dependencies`` section. It better improves the readability of the installation page.

Labels: Documentation
Duplicate/incomplete dependency information

### Describe the issue linked to the documentation

Scikit-learn dependecies are described in two places:
* [**Installing scikit-learn**](https://scikit-learn.org/stable/install.html)
  https://scikit-learn.org/stable/install.html#installing-the-latest-release
* [**Installing the development version of scikit-learn**](https://scikit-learn.org/stable/developers/advanced_installation.html)
  https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies


### Suggest a potential alternative/fix

I suggest removing the incomplete [Dependencies](https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies) section from _[Installing the development version of scikit-learn](https://scikit-learn.org/stable/developers/advanced_installation.html)_ and referring to the extensive dependency list under _[Installing scikit-learn](https://scikit-learn.org/stable/install.html)_.

COMMENT:
Will do that.

According to [List of generators producing ninja build files](https://github.com/ninja-build/ninja/wiki/List-of-generators-producing-ninja-build-files#general-purpose):
> [Meson](http://mesonbuild.com/) is another general-purpose build system that generates Ninja scripts; to be precise, it uses Ninja as its default build generator.

Therefore, I understand Ninja is a dependency of Meson. From [mesonbuild/meson/README.md](https://github.com/mesonbuild/meson/blob/master/README.md#dependencies):
> Dependencies
> * [Python](https://python.org/) (version 3.7 or newer)
> * [Ninja](https://ninja-build.org/) (version 1.8.2 or newer)

It shouldn't be necessary to list Ninja as a build dependency of Scikit-learn. Only Meson is a build dependency of Scikit-learn, Ninja is a dependency of Meson.

Example on Ubuntu 22.04:
```console
$ env LANG=C sudo apt install meson 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  ninja-build
The following NEW packages will be installed:
  meson ninja-build
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 630 kB of archives.
After this operation, 3692 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
```

Labels: Documentation
Duplicate/incomplete dependency information

### Describe the issue linked to the documentation

Scikit-learn dependecies are described in two places:
* [**Installing scikit-learn**](https://scikit-learn.org/stable/install.html)
  https://scikit-learn.org/stable/install.html#installing-the-latest-release
* [**Installing the development version of scikit-learn**](https://scikit-learn.org/stable/developers/advanced_installation.html)
  https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies


### Suggest a potential alternative/fix

I suggest removing the incomplete [Dependencies](https://scikit-learn.org/stable/developers/advanced_installation.html#dependencies) section from _[Installing the development version of scikit-learn](https://scikit-learn.org/stable/developers/advanced_installation.html)_ and referring to the extensive dependency list under _[Installing scikit-learn](https://scikit-learn.org/stable/install.html)_.

COMMENT:
I agree that `ninja` is a dependency of `meson(-python)` in theory. And it is for most packaging tools (apt, conda, ...) but for some reason it is not for pip / uv:

```
❯ uv venv tmpvenv
Using CPython 3.13.1
Creating virtual environment at: tmpvenv
Activate with: source tmpvenv/bin/activate


❯ source tmpvenv/bin/activate

tmpvenv ❯ uv pip install meson-python
Using Python 3.13.1 environment at: tmpvenv
Resolved 4 packages in 284ms
Prepared 4 packages in 383ms
Installed 4 packages in 14ms
 + meson==1.7.1
 + meson-python==0.17.1
 + packaging==24.2
 + pyproject-metadata==0.9.1


tmpvenv ❯ uv pip install ninja
Using Python 3.13.1 environment at: tmpvenv
Resolved 1 package in 201ms
Prepared 1 package in 110ms
Installed 1 package in 2ms
 + ninja==1.11.1.4
```

Hence, the pragmatic need to make it an explicit build dependency of scikit-learn.

EDIT: actually, the last line is wrong.

`meson-python` has a specific mechanism to dynamically install `ninja` if needed: https://github.com/mesonbuild/meson-python/pull/175. This is why it's not needed to add `ninja` as an explicit build dependency in our `pyproject.toml`. So let's remove `ninja` from the our list of dependencies in the doc.

Labels: Documentation
python-version: "3.11" # update once build dependencies are available

### Describe the issue linked to the documentation

Not sure what this comment introduced by 1864117 means:
https://github.com/scikit-learn/scikit-learn/blob/efe2b766b6be66a81b69df1e6273a75c21eed088/.github/workflows/wheels.yml#L164

Isn't it itime to update?

* https://scikit-learn.org/stable/install.html#installing-the-latest-release
* https://scikit-learn.org/stable/developers/advanced_installation.html#build-dependencies

### Suggest a potential alternative/fix

Update to 3.12 or 3.13?

COMMENT:
Honestly this is the kind of stuff that is fine leaving as is.

By any means if you find a better way in `setup-python` to have less hard-coded values, feel free to open a PR. It seems like you can use `python-version-file: 'pyproject.toml'` but I am not sure how you can set the Python version in `pyproject.toml`, see [doc](https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-the-python-version-file-input).

The comment probably comes from https://github.com/scikit-learn/scikit-learn/pull/21386. At the time I guess there was an issue with the latest Python version and we felt it was better to set explicitly the Python version.

Can you try to use a more meaningful title for your issue next time 🙏?

Labels: Documentation
python-version: "3.11" # update once build dependencies are available

### Describe the issue linked to the documentation

Not sure what this comment introduced by 1864117 means:
https://github.com/scikit-learn/scikit-learn/blob/efe2b766b6be66a81b69df1e6273a75c21eed088/.github/workflows/wheels.yml#L164

Isn't it itime to update?

* https://scikit-learn.org/stable/install.html#installing-the-latest-release
* https://scikit-learn.org/stable/developers/advanced_installation.html#build-dependencies

### Suggest a potential alternative/fix

Update to 3.12 or 3.13?

COMMENT:
The comment itself was cryptic, hence the cryptic issue title.

Labels: Documentation
python-version: "3.11" # update once build dependencies are available

### Describe the issue linked to the documentation

Not sure what this comment introduced by 1864117 means:
https://github.com/scikit-learn/scikit-learn/blob/efe2b766b6be66a81b69df1e6273a75c21eed088/.github/workflows/wheels.yml#L164

Isn't it itime to update?

* https://scikit-learn.org/stable/install.html#installing-the-latest-release
* https://scikit-learn.org/stable/developers/advanced_installation.html#build-dependencies

### Suggest a potential alternative/fix

Update to 3.12 or 3.13?

COMMENT:
> The comment itself was cryptic, hence the cryptic issue title.

You know I don't think it would have cost you much to have a title like "Do something about somewhat cryptic comment in wheels workflow?" 😉

Labels: Documentation
python-version: "3.11" # update once build dependencies are available

### Describe the issue linked to the documentation

Not sure what this comment introduced by 1864117 means:
https://github.com/scikit-learn/scikit-learn/blob/efe2b766b6be66a81b69df1e6273a75c21eed088/.github/workflows/wheels.yml#L164

Isn't it itime to update?

* https://scikit-learn.org/stable/install.html#installing-the-latest-release
* https://scikit-learn.org/stable/developers/advanced_installation.html#build-dependencies

### Suggest a potential alternative/fix

Update to 3.12 or 3.13?

COMMENT:
"Hi, I'm a new contributor, and I'd like to work on this issue.
Just to confirm, are all the required build dependencies available for Python 3.12 now? If so, I can create a PR to update the Python version."  🙌

Labels: Documentation
python-version: "3.11" # update once build dependencies are available

### Describe the issue linked to the documentation

Not sure what this comment introduced by 1864117 means:
https://github.com/scikit-learn/scikit-learn/blob/efe2b766b6be66a81b69df1e6273a75c21eed088/.github/workflows/wheels.yml#L164

Isn't it itime to update?

* https://scikit-learn.org/stable/install.html#installing-the-latest-release
* https://scikit-learn.org/stable/developers/advanced_installation.html#build-dependencies

### Suggest a potential alternative/fix

Update to 3.12 or 3.13?

COMMENT:
I don't think this is worth doing something about it for now, so I am going to close this one.

Labels: Documentation
⚠️ CI failed on Wheel builder (last failure: Apr 09, 2025) ⚠️

**CI is still failing on [Wheel builder](https://github.com/scikit-learn/scikit-learn/actions/runs/14348546894)** (Apr 09, 2025)

COMMENT:
Doesn't seem like pandas has a free-threaded wheel in [scientific-python-nightly-wheel](https://anaconda.org/scientific-python-nightly-wheels/pandas/files?page=1)

From [build log](https://github.com/scikit-learn/scikit-learn/actions/runs/14211107519/job/39818365908):
```
  + python -m pip install --pre --upgrade --timeout=60 --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple scipy pandas --only-binary :all:
  Looking in indexes: https://pypi.org/simple, https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
  WARNING: Cache entry deserialization failed, entry ignored
  Collecting scipy
    Downloading https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/scipy/1.16.0.dev0/scipy-1.16.0.dev0-cp313-cp313t-win_amd64.whl (40.6 MB)
       --------------------------------------- 40.6/40.6 MB 30.3 MB/s eta 0:00:00
  ERROR: Could not find a version that satisfies the requirement pandas (from versions: none)
  ERROR: No matching distribution found for pandas
```

Labels: Bug
⚠️ CI failed on Wheel builder (last failure: Apr 09, 2025) ⚠️

**CI is still failing on [Wheel builder](https://github.com/scikit-learn/scikit-learn/actions/runs/14348546894)** (Apr 09, 2025)

COMMENT:
Hi! @lesteve  I’d like to contribute a fix here.

Would it be acceptable to update the CI to attempt installing pandas from the nightly index first, and fall back to the stable PyPI version if it's not found?

This way, the wheel builder won’t fail just because a nightly pandas wheel is missing.

Let me know if this direction sounds good?

Labels: Bug
⚠️ CI failed on Wheel builder (last failure: Apr 09, 2025) ⚠️

**CI is still failing on [Wheel builder](https://github.com/scikit-learn/scikit-learn/actions/runs/14348546894)** (Apr 09, 2025)

COMMENT:
I opened an issue in pandas: https://github.com/pandas-dev/pandas/issues/61242

@Shyanil I don't think pandas has a release with Windows free-threaded wheel at least pandas 2.2.3 [PyPI info](https://pypi.org/project/pandas/2.2.3/#files) does not show any wheel with `cp313t-win` in its name.

Labels: Bug
⚠️ CI failed on Linux_Runs.pylatest_conda_forge_mkl (last failure: Mar 31, 2025) ⚠️

**CI failed on [Linux_Runs.pylatest_conda_forge_mkl](https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=75236&view=logs&j=dde5042c-7464-5d47-9507-31bdd2ee0a3a)** (Mar 31, 2025)
- Test Collection Failure

COMMENT:
This happens because this CI is configured to download the datasets, and we often get a 403 on https://ndownloader.figshare.com/files/5975967, possibly because the IP address of the downloader is in a range of deny list of blocked addresses.

Labels: Build / CI
⚠️ CI failed on Linux_Runs.pylatest_conda_forge_mkl (last failure: Mar 31, 2025) ⚠️

**CI failed on [Linux_Runs.pylatest_conda_forge_mkl](https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=75236&view=logs&j=dde5042c-7464-5d47-9507-31bdd2ee0a3a)** (Mar 31, 2025)
- Test Collection Failure

COMMENT:
See: https://github.com/scikit-learn/scikit-learn/issues/30761

Labels: Build / CI
The covariance matrix is incorrect in BayesianRidge

### Describe the bug

The posterior covariance matrix in `BayesianRidge`, attribute `sigma_`,  is incorrect when `n_features > n_samples`. This is because the posterior covariance requires the full svd, while the current code uses the reduced svd.

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.linear_model import BayesianRidge
from sklearn import datasets

# on main
X, y = datasets.make_regression(n_samples=10, n_features=20)
n_features = X.shape[1]
reg = BayesianRidge(fit_intercept=False).fit(X, y)
covariance_matrix = np.linalg.inv(
    reg.lambda_ * np.identity(n_features) + reg.alpha_ * np.dot(X.T, X)
)
np.allclose(reg.sigma_, covariance_matrix)
```

### Expected Results

True

### Actual Results

False

### Versions

```shell
1.7.dev0
```

COMMENT:
Thanks @antoinebaker. Looks like a bug indeed.

Labels: Bug
RFC set up Codespaces to ease contributor experience especially during sprints?

IMO this could be useful as fall-back during sprints, in particular for pesky company Windows laptops, where I (and others for example @adrinjalali and @glemaitre) have been guilty to debug the Windows situation rather than focussing on more important stuff 😅.

Try it on my fork https://github.com/lesteve/scikit-learn

![Image](https://github.com/user-attachments/assets/d0673441-59f5-4abb-b41b-af267602eb64)

Full disclosure: for some reason, this does not work for me on Firefox, I need to use a Chromium-like browser (Vivaldi works for example), maybe due to my addons not sure.

![Image](https://github.com/user-attachments/assets/6ade7d69-626b-4a90-8a7c-67f22e5f65c9)

The setup seems quite maintable see current diff https://github.com/scikit-learn/scikit-learn/compare/main...lesteve:scikit-learn:main. This could be tweaked for example to setup `ccache` if we insist but I think is good enough as is.

I tried it on my fork on a 2-core machine (default):
- build time from scratch: ~7 minutes
- run full test suite: ~13 minutes (with or without `-n2` has similar timings)
- doc `make html-noplot` (i.e. no example) ~9 minutes first time, ~1 minute second time

Pricing: 120 core hours + 15GB storage free per month. With the default 2-core machine, which is probably enough for sprints. See [doc](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts) for more details.

I guess we may want to add light documentation about it somewhere.

- numpy mentions codespaces without much detailed instructions:
  https://numpy.org/doc/2.1/dev/development_environment.html
- scipy does something similar:
  https://docs.scipy.org/doc/scipy/dev/dev_quickstart.html#other-workflows

Previous related conversations:
- devcontainer: https://github.com/scikit-learn/scikit-learn/pull/27743
- gitpod: https://github.com/scikit-learn/scikit-learn/pull/23556

COMMENT:
I know that in PyParis, we spoke with someone in GitHub where they mentioned that ahead of time, we could require some more credits for participants if needed. I would not be against having this solution as a plan B whatever else does not work.

Labels: RFC
RFC set up Codespaces to ease contributor experience especially during sprints?

IMO this could be useful as fall-back during sprints, in particular for pesky company Windows laptops, where I (and others for example @adrinjalali and @glemaitre) have been guilty to debug the Windows situation rather than focussing on more important stuff 😅.

Try it on my fork https://github.com/lesteve/scikit-learn

![Image](https://github.com/user-attachments/assets/d0673441-59f5-4abb-b41b-af267602eb64)

Full disclosure: for some reason, this does not work for me on Firefox, I need to use a Chromium-like browser (Vivaldi works for example), maybe due to my addons not sure.

![Image](https://github.com/user-attachments/assets/6ade7d69-626b-4a90-8a7c-67f22e5f65c9)

The setup seems quite maintable see current diff https://github.com/scikit-learn/scikit-learn/compare/main...lesteve:scikit-learn:main. This could be tweaked for example to setup `ccache` if we insist but I think is good enough as is.

I tried it on my fork on a 2-core machine (default):
- build time from scratch: ~7 minutes
- run full test suite: ~13 minutes (with or without `-n2` has similar timings)
- doc `make html-noplot` (i.e. no example) ~9 minutes first time, ~1 minute second time

Pricing: 120 core hours + 15GB storage free per month. With the default 2-core machine, which is probably enough for sprints. See [doc](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts) for more details.

I guess we may want to add light documentation about it somewhere.

- numpy mentions codespaces without much detailed instructions:
  https://numpy.org/doc/2.1/dev/development_environment.html
- scipy does something similar:
  https://docs.scipy.org/doc/scipy/dev/dev_quickstart.html#other-workflows

Previous related conversations:
- devcontainer: https://github.com/scikit-learn/scikit-learn/pull/27743
- gitpod: https://github.com/scikit-learn/scikit-learn/pull/23556

COMMENT:
I would be happy to have this option, and I would even use it as a plan A for people who come to a spring w/o setting up their machine.

Labels: RFC