Talip7/scikit-learn-issues-multilabel huggingface dataset:
RidgeCV doesn't allow `alpha=0`

### Describe the bug

RidgeCV doesn't allow any alphas to be 0, despite the underlying `Ridge` linear model allowing such behavior.

### Steps/Code to Reproduce

```python
from sklearn.datasets import load_diabetes
from sklearn.linear_model import RidgeCV
X, y = load_diabetes(return_X_y=True)
clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
```

### Expected Results

No error thrown

### Actual Results

```python-traceback
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_18064/1693855650.py in <module>
      2 from sklearn.linear_model import RidgeCV
      3 X, y = load_diabetes(return_X_y=True)
----> 4 clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
      5 clf.score(X, y)

r:\work\scikit-learn\sklearn\linear_model\_ridge.py in fit(self, X, y, sample_weight)
   2147             if n_alphas != 1:
   2148                 for index, alpha in enumerate(self.alphas):
-> 2149                     alpha = check_scalar_alpha(alpha, f"alphas[{index}]")
   2150             else:
   2151                 self.alphas[0] = check_scalar_alpha(self.alphas[0], "alphas")

r:\work\scikit-learn\sklearn\utils\validation.py in check_scalar(x, name, target_type, min_val, max_val, include_boundaries)
   1466     )
   1467     if min_val is not None and comparison_operator(x, min_val):
-> 1468         raise ValueError(
   1469             f"{name} == {x}, must be"
   1470             f" {'>=' if include_boundaries in ('left', 'both') else '>'} {min_val}."

ValueError: alphas[0] == 0, must be > 0.0.
```

### Versions

```shell
System:
    python: 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
executable: R:\ProgramFiles\anaconda3\envs\scikit-dev\python.exe
   machine: Windows-10-10.0.19043-SP0

Python dependencies:
      sklearn: 1.1.dev0
          pip: 21.2.4
   setuptools: 58.0.4
        numpy: 1.21.5
        scipy: 1.7.3
       Cython: 0.29.26
       pandas: 1.3.5
   matplotlib: 3.5.1
       joblib: 1.1.0
threadpoolctl: 3.0.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: R:\ProgramFiles\anaconda3\envs\scikit-dev\Lib\site-packages\numpy\.libs\libopenblas.XWYDX2IKJW2NMTWSFYNGFUWKQU3LYTCZ.gfortran-win_amd64.dll
        version: 0.3.17
threading_layer: pthreads
   architecture: Zen
    num_threads: 12

       user_api: openmp
   internal_api: openmp
         prefix: vcomp
       filepath: C:\Windows\System32\vcomp140.dll
        version: None
    num_threads: 12
```

COMMENT:
@ogrisel @lorentzenchr Wondering what your thoughts are on this

Labels: Bug, module:linear_model
RidgeCV doesn't allow `alpha=0`

### Describe the bug

RidgeCV doesn't allow any alphas to be 0, despite the underlying `Ridge` linear model allowing such behavior.

### Steps/Code to Reproduce

```python
from sklearn.datasets import load_diabetes
from sklearn.linear_model import RidgeCV
X, y = load_diabetes(return_X_y=True)
clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
```

### Expected Results

No error thrown

### Actual Results

```python-traceback
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_18064/1693855650.py in <module>
      2 from sklearn.linear_model import RidgeCV
      3 X, y = load_diabetes(return_X_y=True)
----> 4 clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
      5 clf.score(X, y)

r:\work\scikit-learn\sklearn\linear_model\_ridge.py in fit(self, X, y, sample_weight)
   2147             if n_alphas != 1:
   2148                 for index, alpha in enumerate(self.alphas):
-> 2149                     alpha = check_scalar_alpha(alpha, f"alphas[{index}]")
   2150             else:
   2151                 self.alphas[0] = check_scalar_alpha(self.alphas[0], "alphas")

r:\work\scikit-learn\sklearn\utils\validation.py in check_scalar(x, name, target_type, min_val, max_val, include_boundaries)
   1466     )
   1467     if min_val is not None and comparison_operator(x, min_val):
-> 1468         raise ValueError(
   1469             f"{name} == {x}, must be"
   1470             f" {'>=' if include_boundaries in ('left', 'both') else '>'} {min_val}."

ValueError: alphas[0] == 0, must be > 0.0.
```

### Versions

```shell
System:
    python: 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
executable: R:\ProgramFiles\anaconda3\envs\scikit-dev\python.exe
   machine: Windows-10-10.0.19043-SP0

Python dependencies:
      sklearn: 1.1.dev0
          pip: 21.2.4
   setuptools: 58.0.4
        numpy: 1.21.5
        scipy: 1.7.3
       Cython: 0.29.26
       pandas: 1.3.5
   matplotlib: 3.5.1
       joblib: 1.1.0
threadpoolctl: 3.0.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: R:\ProgramFiles\anaconda3\envs\scikit-dev\Lib\site-packages\numpy\.libs\libopenblas.XWYDX2IKJW2NMTWSFYNGFUWKQU3LYTCZ.gfortran-win_amd64.dll
        version: 0.3.17
threading_layer: pthreads
   architecture: Zen
    num_threads: 12

       user_api: openmp
   internal_api: openmp
         prefix: vcomp
       filepath: C:\Windows\System32\vcomp140.dll
        version: None
    num_threads: 12
```

COMMENT:
Or maybe we could just improve the documentation to explain why it's needed, no?

Labels: Bug, module:linear_model
RidgeCV doesn't allow `alpha=0`

### Describe the bug

RidgeCV doesn't allow any alphas to be 0, despite the underlying `Ridge` linear model allowing such behavior.

### Steps/Code to Reproduce

```python
from sklearn.datasets import load_diabetes
from sklearn.linear_model import RidgeCV
X, y = load_diabetes(return_X_y=True)
clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
```

### Expected Results

No error thrown

### Actual Results

```python-traceback
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_18064/1693855650.py in <module>
      2 from sklearn.linear_model import RidgeCV
      3 X, y = load_diabetes(return_X_y=True)
----> 4 clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
      5 clf.score(X, y)

r:\work\scikit-learn\sklearn\linear_model\_ridge.py in fit(self, X, y, sample_weight)
   2147             if n_alphas != 1:
   2148                 for index, alpha in enumerate(self.alphas):
-> 2149                     alpha = check_scalar_alpha(alpha, f"alphas[{index}]")
   2150             else:
   2151                 self.alphas[0] = check_scalar_alpha(self.alphas[0], "alphas")

r:\work\scikit-learn\sklearn\utils\validation.py in check_scalar(x, name, target_type, min_val, max_val, include_boundaries)
   1466     )
   1467     if min_val is not None and comparison_operator(x, min_val):
-> 1468         raise ValueError(
   1469             f"{name} == {x}, must be"
   1470             f" {'>=' if include_boundaries in ('left', 'both') else '>'} {min_val}."

ValueError: alphas[0] == 0, must be > 0.0.
```

### Versions

```shell
System:
    python: 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
executable: R:\ProgramFiles\anaconda3\envs\scikit-dev\python.exe
   machine: Windows-10-10.0.19043-SP0

Python dependencies:
      sklearn: 1.1.dev0
          pip: 21.2.4
   setuptools: 58.0.4
        numpy: 1.21.5
        scipy: 1.7.3
       Cython: 0.29.26
       pandas: 1.3.5
   matplotlib: 3.5.1
       joblib: 1.1.0
threadpoolctl: 3.0.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: R:\ProgramFiles\anaconda3\envs\scikit-dev\Lib\site-packages\numpy\.libs\libopenblas.XWYDX2IKJW2NMTWSFYNGFUWKQU3LYTCZ.gfortran-win_amd64.dll
        version: 0.3.17
threading_layer: pthreads
   architecture: Zen
    num_threads: 12

       user_api: openmp
   internal_api: openmp
         prefix: vcomp
       filepath: C:\Windows\System32\vcomp140.dll
        version: None
    num_threads: 12
```

COMMENT:
I would prefer to avoid introducing some hard coded tiny `EPS > 0`. As a user, if I specify `alpha=0`, I expect that to hold exactly. Therefore, improving documentation (and error message?) seems best to me.

Labels: Bug, module:linear_model
RidgeCV doesn't allow `alpha=0`

### Describe the bug

RidgeCV doesn't allow any alphas to be 0, despite the underlying `Ridge` linear model allowing such behavior.

### Steps/Code to Reproduce

```python
from sklearn.datasets import load_diabetes
from sklearn.linear_model import RidgeCV
X, y = load_diabetes(return_X_y=True)
clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
```

### Expected Results

No error thrown

### Actual Results

```python-traceback
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_18064/1693855650.py in <module>
      2 from sklearn.linear_model import RidgeCV
      3 X, y = load_diabetes(return_X_y=True)
----> 4 clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
      5 clf.score(X, y)

r:\work\scikit-learn\sklearn\linear_model\_ridge.py in fit(self, X, y, sample_weight)
   2147             if n_alphas != 1:
   2148                 for index, alpha in enumerate(self.alphas):
-> 2149                     alpha = check_scalar_alpha(alpha, f"alphas[{index}]")
   2150             else:
   2151                 self.alphas[0] = check_scalar_alpha(self.alphas[0], "alphas")

r:\work\scikit-learn\sklearn\utils\validation.py in check_scalar(x, name, target_type, min_val, max_val, include_boundaries)
   1466     )
   1467     if min_val is not None and comparison_operator(x, min_val):
-> 1468         raise ValueError(
   1469             f"{name} == {x}, must be"
   1470             f" {'>=' if include_boundaries in ('left', 'both') else '>'} {min_val}."

ValueError: alphas[0] == 0, must be > 0.0.
```

### Versions

```shell
System:
    python: 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
executable: R:\ProgramFiles\anaconda3\envs\scikit-dev\python.exe
   machine: Windows-10-10.0.19043-SP0

Python dependencies:
      sklearn: 1.1.dev0
          pip: 21.2.4
   setuptools: 58.0.4
        numpy: 1.21.5
        scipy: 1.7.3
       Cython: 0.29.26
       pandas: 1.3.5
   matplotlib: 3.5.1
       joblib: 1.1.0
threadpoolctl: 3.0.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: R:\ProgramFiles\anaconda3\envs\scikit-dev\Lib\site-packages\numpy\.libs\libopenblas.XWYDX2IKJW2NMTWSFYNGFUWKQU3LYTCZ.gfortran-win_amd64.dll
        version: 0.3.17
threading_layer: pthreads
   architecture: Zen
    num_threads: 12

       user_api: openmp
   internal_api: openmp
         prefix: vcomp
       filepath: C:\Windows\System32\vcomp140.dll
        version: None
    num_threads: 12
```

COMMENT:
Indeed I think it would be best to expand the [User Guide entry](https://scikit-learn.org/stable/modules/linear_model.html#setting-the-regularization-parameter-leave-one-out-cross-validation) for RidgeCV and link to the User Guide in the actual docstring. I can work on that in a new PR.

Labels: Bug, module:linear_model
RidgeCV doesn't allow `alpha=0`

### Describe the bug

RidgeCV doesn't allow any alphas to be 0, despite the underlying `Ridge` linear model allowing such behavior.

### Steps/Code to Reproduce

```python
from sklearn.datasets import load_diabetes
from sklearn.linear_model import RidgeCV
X, y = load_diabetes(return_X_y=True)
clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
```

### Expected Results

No error thrown

### Actual Results

```python-traceback
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_18064/1693855650.py in <module>
      2 from sklearn.linear_model import RidgeCV
      3 X, y = load_diabetes(return_X_y=True)
----> 4 clf = RidgeCV(alphas=[0, 1e-2, 1e-1, 1]).fit(X, y)
      5 clf.score(X, y)

r:\work\scikit-learn\sklearn\linear_model\_ridge.py in fit(self, X, y, sample_weight)
   2147             if n_alphas != 1:
   2148                 for index, alpha in enumerate(self.alphas):
-> 2149                     alpha = check_scalar_alpha(alpha, f"alphas[{index}]")
   2150             else:
   2151                 self.alphas[0] = check_scalar_alpha(self.alphas[0], "alphas")

r:\work\scikit-learn\sklearn\utils\validation.py in check_scalar(x, name, target_type, min_val, max_val, include_boundaries)
   1466     )
   1467     if min_val is not None and comparison_operator(x, min_val):
-> 1468         raise ValueError(
   1469             f"{name} == {x}, must be"
   1470             f" {'>=' if include_boundaries in ('left', 'both') else '>'} {min_val}."

ValueError: alphas[0] == 0, must be > 0.0.
```

### Versions

```shell
System:
    python: 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
executable: R:\ProgramFiles\anaconda3\envs\scikit-dev\python.exe
   machine: Windows-10-10.0.19043-SP0

Python dependencies:
      sklearn: 1.1.dev0
          pip: 21.2.4
   setuptools: 58.0.4
        numpy: 1.21.5
        scipy: 1.7.3
       Cython: 0.29.26
       pandas: 1.3.5
   matplotlib: 3.5.1
       joblib: 1.1.0
threadpoolctl: 3.0.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: R:\ProgramFiles\anaconda3\envs\scikit-dev\Lib\site-packages\numpy\.libs\libopenblas.XWYDX2IKJW2NMTWSFYNGFUWKQU3LYTCZ.gfortran-win_amd64.dll
        version: 0.3.17
threading_layer: pthreads
   architecture: Zen
    num_threads: 12

       user_api: openmp
   internal_api: openmp
         prefix: vcomp
       filepath: C:\Windows\System32\vcomp140.dll
        version: None
    num_threads: 12
```

COMMENT:
I‘m looking forward to review a PR.

Labels: Bug, module:linear_model
Link to logos in Community section of website

Can we link to the scikit-learn logos in the "Community" section of the website?
Currently, the logos are buried, and I think this might make it easier for users to find it:
https://github.com/scikit-learn/scikit-learn/tree/main/doc/logos

To Do:  
- [x] create a README.md file 
- [x] add branding colors from blog:  https://github.com/scikit-learn/blog
- [x] add images with size info for easy reference:  (Example:  Data Umbrella's:  https://github.com/data-umbrella/info)
- [x] also add Thomas version
- [ ] share with community on social media after PR has been merged

### Examples
- pandas:  https://pandas.pydata.org/about/citing.html
- numpy:  https://github.com/numpy/numpy/tree/main/branding/logo
- matplotlib:  https://matplotlib.org/stable/gallery/misc/logos2.html#
- scipy: https://github.com/scipy/scipy/blob/main/doc/source/_static/logo.svg

COMMENT:
I am okay with adding another link to the logos. I am unsure if we should put it in the footer. Can you describe the reader that wants access to the logos?

Labels: Documentation
Link to logos in Community section of website

Can we link to the scikit-learn logos in the "Community" section of the website?
Currently, the logos are buried, and I think this might make it easier for users to find it:
https://github.com/scikit-learn/scikit-learn/tree/main/doc/logos

To Do:  
- [x] create a README.md file 
- [x] add branding colors from blog:  https://github.com/scikit-learn/blog
- [x] add images with size info for easy reference:  (Example:  Data Umbrella's:  https://github.com/data-umbrella/info)
- [x] also add Thomas version
- [ ] share with community on social media after PR has been merged

### Examples
- pandas:  https://pandas.pydata.org/about/citing.html
- numpy:  https://github.com/numpy/numpy/tree/main/branding/logo
- matplotlib:  https://matplotlib.org/stable/gallery/misc/logos2.html#
- scipy: https://github.com/scipy/scipy/blob/main/doc/source/_static/logo.svg

COMMENT:
@thomasjpfan 
That reader would be me :)
I was looking for a central place to get this info.  It would be easier for others too.

Labels: Documentation
Link to logos in Community section of website

Can we link to the scikit-learn logos in the "Community" section of the website?
Currently, the logos are buried, and I think this might make it easier for users to find it:
https://github.com/scikit-learn/scikit-learn/tree/main/doc/logos

To Do:  
- [x] create a README.md file 
- [x] add branding colors from blog:  https://github.com/scikit-learn/blog
- [x] add images with size info for easy reference:  (Example:  Data Umbrella's:  https://github.com/data-umbrella/info)
- [x] also add Thomas version
- [ ] share with community on social media after PR has been merged

### Examples
- pandas:  https://pandas.pydata.org/about/citing.html
- numpy:  https://github.com/numpy/numpy/tree/main/branding/logo
- matplotlib:  https://matplotlib.org/stable/gallery/misc/logos2.html#
- scipy: https://github.com/scipy/scipy/blob/main/doc/source/_static/logo.svg

COMMENT:
/take

Labels: Documentation
Link to logos in Community section of website

Can we link to the scikit-learn logos in the "Community" section of the website?
Currently, the logos are buried, and I think this might make it easier for users to find it:
https://github.com/scikit-learn/scikit-learn/tree/main/doc/logos

To Do:  
- [x] create a README.md file 
- [x] add branding colors from blog:  https://github.com/scikit-learn/blog
- [x] add images with size info for easy reference:  (Example:  Data Umbrella's:  https://github.com/data-umbrella/info)
- [x] also add Thomas version
- [ ] share with community on social media after PR has been merged

### Examples
- pandas:  https://pandas.pydata.org/about/citing.html
- numpy:  https://github.com/numpy/numpy/tree/main/branding/logo
- matplotlib:  https://matplotlib.org/stable/gallery/misc/logos2.html#
- scipy: https://github.com/scipy/scipy/blob/main/doc/source/_static/logo.svg

COMMENT:
>I am okay with adding another link to the logos. I am unsure if we should put it in the footer. Can you describe the reader that wants access to the logos?

Discussed with @thomasjpfan. I meant "Community" section, instead of "footer" and have updated the issue to reflect this.

Labels: Documentation
Link to logos in Community section of website

Can we link to the scikit-learn logos in the "Community" section of the website?
Currently, the logos are buried, and I think this might make it easier for users to find it:
https://github.com/scikit-learn/scikit-learn/tree/main/doc/logos

To Do:  
- [x] create a README.md file 
- [x] add branding colors from blog:  https://github.com/scikit-learn/blog
- [x] add images with size info for easy reference:  (Example:  Data Umbrella's:  https://github.com/data-umbrella/info)
- [x] also add Thomas version
- [ ] share with community on social media after PR has been merged

### Examples
- pandas:  https://pandas.pydata.org/about/citing.html
- numpy:  https://github.com/numpy/numpy/tree/main/branding/logo
- matplotlib:  https://matplotlib.org/stable/gallery/misc/logos2.html#
- scipy: https://github.com/scipy/scipy/blob/main/doc/source/_static/logo.svg

COMMENT:
Close via #23587.

Labels: Documentation
Error during installation

### Describe the bug

![python_error3](https://user-images.githubusercontent.com/74652470/162145719-2e56415f-bad5-413d-98b6-33dddabcb34b.png)

getting error while installing pycaret

### Steps/Code to Reproduce

pip install pycaret

### Expected Results

failed to build wheels 

### Actual Results

should install 

### Versions

```shell
python 3.10
```

COMMENT:
PyCaret pins scikit-learn to 0.23.2: https://github.com/pycaret/pycaret/blob/16b641a4ce99eb1495477ac6008182d712c73d51/requirements.txt#L7 which does not support Python 3.10.

I suggest using Python 3.8 if you want to use scikit-learn 0.23.2. This way you'll get the wheel [from PyPi](https://pypi.org/project/scikit-learn/0.23.2/#files) and do not need to build it locally.

Labels: Bug, Needs Triage
DOC Improve the docstring of log loss to cover the multiclass case

### Describe the issue linked to the documentation

The docstring of the `log_loss` function (also known as the "cross-entropy loss") only gives the mathematical description of the loss when `y_true` is a binary variable (binary cross-entropy).

### Suggest a potential alternative/fix

We should also give the formula for the multiclass case (categorical cross-entropy) with `y_true` being one-hot encoded as done in:

https://ml-cheatsheet.readthedocs.io/en/latest/loss_functions.html#cross-entropy

![Screenshot from 2022-04-06 11-45-59](https://user-images.githubusercontent.com/89061/161950527-1722b378-44af-4192-8162-d789c1ef2970.png)

for instance.

Actually this formula is given in the user guide:

https://scikit-learn.org/stable/modules/model_evaluation.html#log-loss

I think the docstring should be improved accordingly.

The user guide could also be improved to give a code-snippet example for the multiclass case.

```python
>>> log_loss(
...     np.array([[0, 1, 0], [1, 0, 0]]),
...     np.array([[0.1, 0.8, 0.1], [0.9, 0.1, 0]]),
... )
0.164...
```

COMMENT:
Also we should explicitly mention the common alternative names for this loss:

- Binary cross-entropy for the binary classification case;
- Categorical cross-entropy for the multi-class case (which is a generalization).

Labels: Documentation, Enhancement, module:metrics
DOC Improve the docstring of log loss to cover the multiclass case

### Describe the issue linked to the documentation

The docstring of the `log_loss` function (also known as the "cross-entropy loss") only gives the mathematical description of the loss when `y_true` is a binary variable (binary cross-entropy).

### Suggest a potential alternative/fix

We should also give the formula for the multiclass case (categorical cross-entropy) with `y_true` being one-hot encoded as done in:

https://ml-cheatsheet.readthedocs.io/en/latest/loss_functions.html#cross-entropy

![Screenshot from 2022-04-06 11-45-59](https://user-images.githubusercontent.com/89061/161950527-1722b378-44af-4192-8162-d789c1ef2970.png)

for instance.

Actually this formula is given in the user guide:

https://scikit-learn.org/stable/modules/model_evaluation.html#log-loss

I think the docstring should be improved accordingly.

The user guide could also be improved to give a code-snippet example for the multiclass case.

```python
>>> log_loss(
...     np.array([[0, 1, 0], [1, 0, 0]]),
...     np.array([[0.1, 0.8, 0.1], [0.9, 0.1, 0]]),
... )
0.164...
```

COMMENT:
❓ 
https://scikit-learn.org/stable/modules/model_evaluation.html#log-loss has the multi-class log-loss formula.

What can be improved is to be consistent about summing over the sample, e.g. binary log-loss is given for a single data point, the multiclass one for a whole sample.

Labels: Documentation, Enhancement, module:metrics