Talip7/scikit-learn-issues-multilabel huggingface dataset:
Agglomerative clustering training error for seuclidean/mahalanobis affinity and single linkage

### Describe the bug

When trying Agglomerative clustering model training with the affinity as 'seuclidean' or 'mahalanobis' and the linkage as 'single' the training fails. The same affinity values along with other linkage such as 'average' options executes for model training. There's no specification given for this issue. Also, in the code I can see the handling for the single linkage is different and there is some cython code which is not accessible.

### Steps/Code to Reproduce

```

from sklearn.cluster import AgglomerativeClustering
from sklearn.datasets import load_iris
model = AgglomerativeClustering(affinity='mahalanobis', linkage='average')
data = load_iris(as_frame=True)['data']
model.fit(data)

```

### Expected Results

No error should be thrown sig

### Actual Results

![image](https://github.com/scikit-learn/scikit-learn/assets/69189799/c3da5d93-b215-4fd8-8610-a4c8ce632f8d)


### Versions

```shell
System:
    python: 3.8.17 (default, Jul  5 2023, 21:04:15)  [GCC 11.2.0]
executable: /home/albint/miniconda3/envs/myenv/bin/python
   machine: Linux-5.15.0-78-generic-x86_64-with-glibc2.17

Python dependencies:
      sklearn: 1.3.0
          pip: 23.1.2
   setuptools: 67.8.0
        numpy: 1.24.4
        scipy: 1.10.1
       Cython: 3.0.0
       pandas: 2.0.3
   matplotlib: 3.7.2
       joblib: 1.3.1
threadpoolctl: 3.2.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /home/albint/miniconda3/envs/myenv/lib/python3.8/site-packages/numpy.libs/libopenblas64_p-r0-15028c96.3.21.so
        version: 0.3.21
threading_layer: pthreads
   architecture: Haswell

       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /home/albint/miniconda3/envs/myenv/lib/python3.8/site-packages/scipy.libs/libopenblasp-r0-41284840.3.18.so
        version: 0.3.18
threading_layer: pthreads
   architecture: Haswell

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libgomp
       filepath: /home/albint/miniconda3/envs/myenv/lib/python3.8/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
```

COMMENT:
> First, the documentation for `affinity` is outdated and incorrect (note that the keyword is also **deprecated**), whereas the documentation for `metric` _more accurate_ but still not complete. What's missing is that when `connectivity=None` and `linkage="single"` (and `affinity!="precomputed"`), any valid pairwise distance metric (i.e. `metric in sklearn.metrics.pairwise._VALID_METRICS`) works.


It is my understanding that @Micky774 has split this problem into three distinct categories. I claim this. View my PR here:

- #29935 

I will continue with the other categories sequentially.

Labels: Bug, help wanted
Agglomerative clustering training error for seuclidean/mahalanobis affinity and single linkage

### Describe the bug

When trying Agglomerative clustering model training with the affinity as 'seuclidean' or 'mahalanobis' and the linkage as 'single' the training fails. The same affinity values along with other linkage such as 'average' options executes for model training. There's no specification given for this issue. Also, in the code I can see the handling for the single linkage is different and there is some cython code which is not accessible.

### Steps/Code to Reproduce

```

from sklearn.cluster import AgglomerativeClustering
from sklearn.datasets import load_iris
model = AgglomerativeClustering(affinity='mahalanobis', linkage='average')
data = load_iris(as_frame=True)['data']
model.fit(data)

```

### Expected Results

No error should be thrown sig

### Actual Results

![image](https://github.com/scikit-learn/scikit-learn/assets/69189799/c3da5d93-b215-4fd8-8610-a4c8ce632f8d)


### Versions

```shell
System:
    python: 3.8.17 (default, Jul  5 2023, 21:04:15)  [GCC 11.2.0]
executable: /home/albint/miniconda3/envs/myenv/bin/python
   machine: Linux-5.15.0-78-generic-x86_64-with-glibc2.17

Python dependencies:
      sklearn: 1.3.0
          pip: 23.1.2
   setuptools: 67.8.0
        numpy: 1.24.4
        scipy: 1.10.1
       Cython: 3.0.0
       pandas: 2.0.3
   matplotlib: 3.7.2
       joblib: 1.3.1
threadpoolctl: 3.2.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /home/albint/miniconda3/envs/myenv/lib/python3.8/site-packages/numpy.libs/libopenblas64_p-r0-15028c96.3.21.so
        version: 0.3.21
threading_layer: pthreads
   architecture: Haswell

       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /home/albint/miniconda3/envs/myenv/lib/python3.8/site-packages/scipy.libs/libopenblasp-r0-41284840.3.18.so
        version: 0.3.18
threading_layer: pthreads
   architecture: Haswell

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libgomp
       filepath: /home/albint/miniconda3/envs/myenv/lib/python3.8/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
```

COMMENT:
> Second, the support for general pairwise distance metrics can actually be extended to even when connectivity!=None and linkage!="single" if we ditch the use of paired_distances and use the underlying distance metric directly, though it may a be a bit tricky to ensure no performance regression. This indeed must happen once we deprecate paired_distances (https://github.com/scikit-learn/scikit-learn/issues/26982).

@Micky774 this sounds like it would required a PR of its own. Should you create an issue?

Labels: Bug, help wanted
Agglomerative clustering training error for seuclidean/mahalanobis affinity and single linkage

### Describe the bug

When trying Agglomerative clustering model training with the affinity as 'seuclidean' or 'mahalanobis' and the linkage as 'single' the training fails. The same affinity values along with other linkage such as 'average' options executes for model training. There's no specification given for this issue. Also, in the code I can see the handling for the single linkage is different and there is some cython code which is not accessible.

### Steps/Code to Reproduce

```

from sklearn.cluster import AgglomerativeClustering
from sklearn.datasets import load_iris
model = AgglomerativeClustering(affinity='mahalanobis', linkage='average')
data = load_iris(as_frame=True)['data']
model.fit(data)

```

### Expected Results

No error should be thrown sig

### Actual Results

![image](https://github.com/scikit-learn/scikit-learn/assets/69189799/c3da5d93-b215-4fd8-8610-a4c8ce632f8d)


### Versions

```shell
System:
    python: 3.8.17 (default, Jul  5 2023, 21:04:15)  [GCC 11.2.0]
executable: /home/albint/miniconda3/envs/myenv/bin/python
   machine: Linux-5.15.0-78-generic-x86_64-with-glibc2.17

Python dependencies:
      sklearn: 1.3.0
          pip: 23.1.2
   setuptools: 67.8.0
        numpy: 1.24.4
        scipy: 1.10.1
       Cython: 3.0.0
       pandas: 2.0.3
   matplotlib: 3.7.2
       joblib: 1.3.1
threadpoolctl: 3.2.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /home/albint/miniconda3/envs/myenv/lib/python3.8/site-packages/numpy.libs/libopenblas64_p-r0-15028c96.3.21.so
        version: 0.3.21
threading_layer: pthreads
   architecture: Haswell

       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /home/albint/miniconda3/envs/myenv/lib/python3.8/site-packages/scipy.libs/libopenblasp-r0-41284840.3.18.so
        version: 0.3.18
threading_layer: pthreads
   architecture: Haswell

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libgomp
       filepath: /home/albint/miniconda3/envs/myenv/lib/python3.8/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
```

COMMENT:
Hi, can I work on this issue? I’m new to sklearn contributions and would like to take this up.

Labels: Bug, help wanted
Add test weighted huber in (old) gradient boosting

The case of Huber loss function with sample weights is not tested, see https://github.com/scikit-learn/scikit-learn/pull/26278#discussion_r1279891117, i.e.
```python
GradientBoostingRegressor(loss="huber").fit(X, y, samples_weights=w)
```

COMMENT:
Maybe tested?
https://github.com/scikit-learn/scikit-learn/blob/38a06e4be504f3971d109d6741b8b4c7192d7323/sklearn/ensemble/tests/test_gradient_boosting.py#L1147-L1155

Labels: Easy, Moderate, help wanted, module:ensemble, module:test-suite
Add test weighted huber in (old) gradient boosting

The case of Huber loss function with sample weights is not tested, see https://github.com/scikit-learn/scikit-learn/pull/26278#discussion_r1279891117, i.e.
```python
GradientBoostingRegressor(loss="huber").fit(X, y, samples_weights=w)
```

COMMENT:
Indeed, false alarm. Thanks for pointing it out.

Labels: Easy, Moderate, help wanted, module:ensemble, module:test-suite
Make cross_val_score accept multi-metric scoring

I'm not sure why we deliberately exclude multi-metric scoring in `cross_val_score`. `cross_validate` (which `cross_val_score` calls, supports it, and we could simply return the multi-metric scores calculated by it.

This is our `cross_val_score`:

https://github.com/scikit-learn/scikit-learn/blob/405a5a09503a7f2cd241f8a5b1a1d2368dcc2676/sklearn/model_selection/_validation.py#L576-L591

COMMENT:
ping @jnothman. I am almost sure that you have the answer to this one. I supposed that we did not want to change the type of output. We currently output an array and multi-score would not agree with such an output without breaking change?

Labels: API, Needs Decision, module:metrics
The copy button on install copies an extensive comman including env activation

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/install.html

Above link will lead you to the sklearn downlanding for link . 
when you link copy link button it will copy 
`python3 -m venv sklearn-venvpython -m venv sklearn-venvpython -m venv sklearn-venvsource sklearn-venv/bin/activatesource sklearn-venv/bin/activatesklearn-venv\Scripts\activatepip install -U scikit-learnpip install -U scikit-learnpip install -U scikit-learnpip3 install -U scikit-learnconda create -n sklearn-env -c conda-forge scikit-learnconda activate sklearn-env`

instead of  `pip3 install -U scikit-learn`

if this is the issue so please issue i want to create a pull request for it and tell in which file this issue reside
Thanks

### Suggest a potential alternative/fix

By resoving above issue

COMMENT:
cc @ArturoAmorQ

Labels: Documentation
The copy button on install copies an extensive comman including env activation

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/install.html

Above link will lead you to the sklearn downlanding for link . 
when you link copy link button it will copy 
`python3 -m venv sklearn-venvpython -m venv sklearn-venvpython -m venv sklearn-venvsource sklearn-venv/bin/activatesource sklearn-venv/bin/activatesklearn-venv\Scripts\activatepip install -U scikit-learnpip install -U scikit-learnpip install -U scikit-learnpip3 install -U scikit-learnconda create -n sklearn-env -c conda-forge scikit-learnconda activate sklearn-env`

instead of  `pip3 install -U scikit-learn`

if this is the issue so please issue i want to create a pull request for it and tell in which file this issue reside
Thanks

### Suggest a potential alternative/fix

By resoving above issue

COMMENT:
@adrinjalali   can you tell me where can i find the code for this issue I want to create PR

Labels: Documentation
The copy button on install copies an extensive comman including env activation

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/install.html

Above link will lead you to the sklearn downlanding for link . 
when you link copy link button it will copy 
`python3 -m venv sklearn-venvpython -m venv sklearn-venvpython -m venv sklearn-venvsource sklearn-venv/bin/activatesource sklearn-venv/bin/activatesklearn-venv\Scripts\activatepip install -U scikit-learnpip install -U scikit-learnpip install -U scikit-learnpip3 install -U scikit-learnconda create -n sklearn-env -c conda-forge scikit-learnconda activate sklearn-env`

instead of  `pip3 install -U scikit-learn`

if this is the issue so please issue i want to create a pull request for it and tell in which file this issue reside
Thanks

### Suggest a potential alternative/fix

By resoving above issue

COMMENT:
Yep apparently the directive is copying all the instructions from the different OS.
Not sure about the fix here.

Labels: Documentation
The copy button on install copies an extensive comman including env activation

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/install.html

Above link will lead you to the sklearn downlanding for link . 
when you link copy link button it will copy 
`python3 -m venv sklearn-venvpython -m venv sklearn-venvpython -m venv sklearn-venvsource sklearn-venv/bin/activatesource sklearn-venv/bin/activatesklearn-venv\Scripts\activatepip install -U scikit-learnpip install -U scikit-learnpip install -U scikit-learnpip3 install -U scikit-learnconda create -n sklearn-env -c conda-forge scikit-learnconda activate sklearn-env`

instead of  `pip3 install -U scikit-learn`

if this is the issue so please issue i want to create a pull request for it and tell in which file this issue reside
Thanks

### Suggest a potential alternative/fix

By resoving above issue

COMMENT:
@glemaitre I want to know in which file the code is written for the above issue code?

Labels: Documentation
The copy button on install copies an extensive comman including env activation

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/install.html

Above link will lead you to the sklearn downlanding for link . 
when you link copy link button it will copy 
`python3 -m venv sklearn-venvpython -m venv sklearn-venvpython -m venv sklearn-venvsource sklearn-venv/bin/activatesource sklearn-venv/bin/activatesklearn-venv\Scripts\activatepip install -U scikit-learnpip install -U scikit-learnpip install -U scikit-learnpip3 install -U scikit-learnconda create -n sklearn-env -c conda-forge scikit-learnconda activate sklearn-env`

instead of  `pip3 install -U scikit-learn`

if this is the issue so please issue i want to create a pull request for it and tell in which file this issue reside
Thanks

### Suggest a potential alternative/fix

By resoving above issue

COMMENT:
@MuhammadNizamani you can try to look for the test around it in the project and find the file.

Labels: Documentation
The copy button on install copies an extensive comman including env activation

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/install.html

Above link will lead you to the sklearn downlanding for link . 
when you link copy link button it will copy 
`python3 -m venv sklearn-venvpython -m venv sklearn-venvpython -m venv sklearn-venvsource sklearn-venv/bin/activatesource sklearn-venv/bin/activatesklearn-venv\Scripts\activatepip install -U scikit-learnpip install -U scikit-learnpip install -U scikit-learnpip3 install -U scikit-learnconda create -n sklearn-env -c conda-forge scikit-learnconda activate sklearn-env`

instead of  `pip3 install -U scikit-learn`

if this is the issue so please issue i want to create a pull request for it and tell in which file this issue reside
Thanks

### Suggest a potential alternative/fix

By resoving above issue

COMMENT:
Maybe @tuscland may have an idea on how to solve this issue.

Labels: Documentation
The copy button on install copies an extensive comman including env activation

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/install.html

Above link will lead you to the sklearn downlanding for link . 
when you link copy link button it will copy 
`python3 -m venv sklearn-venvpython -m venv sklearn-venvpython -m venv sklearn-venvsource sklearn-venv/bin/activatesource sklearn-venv/bin/activatesklearn-venv\Scripts\activatepip install -U scikit-learnpip install -U scikit-learnpip install -U scikit-learnpip3 install -U scikit-learnconda create -n sklearn-env -c conda-forge scikit-learnconda activate sklearn-env`

instead of  `pip3 install -U scikit-learn`

if this is the issue so please issue i want to create a pull request for it and tell in which file this issue reside
Thanks

### Suggest a potential alternative/fix

By resoving above issue

COMMENT:
Hi all,
It would be useful to see exactly where the snippet comes from.
If a change to the documentation is possible, I suggest the snippet is split in as many blocks as needed.

Labels: Documentation
The copy button on install copies an extensive comman including env activation

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/install.html

Above link will lead you to the sklearn downlanding for link . 
when you link copy link button it will copy 
`python3 -m venv sklearn-venvpython -m venv sklearn-venvpython -m venv sklearn-venvsource sklearn-venv/bin/activatesource sklearn-venv/bin/activatesklearn-venv\Scripts\activatepip install -U scikit-learnpip install -U scikit-learnpip install -U scikit-learnpip3 install -U scikit-learnconda create -n sklearn-env -c conda-forge scikit-learnconda activate sklearn-env`

instead of  `pip3 install -U scikit-learn`

if this is the issue so please issue i want to create a pull request for it and tell in which file this issue reside
Thanks

### Suggest a potential alternative/fix

By resoving above issue

COMMENT:
The snippet is from this page: https://scikit-learn.org/stable/install.html

Which comes from this rst file: https://raw.githubusercontent.com/scikit-learn/scikit-learn/main/doc/install.rst

Labels: Documentation
The copy button on install copies an extensive comman including env activation

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/install.html

Above link will lead you to the sklearn downlanding for link . 
when you link copy link button it will copy 
`python3 -m venv sklearn-venvpython -m venv sklearn-venvpython -m venv sklearn-venvsource sklearn-venv/bin/activatesource sklearn-venv/bin/activatesklearn-venv\Scripts\activatepip install -U scikit-learnpip install -U scikit-learnpip install -U scikit-learnpip3 install -U scikit-learnconda create -n sklearn-env -c conda-forge scikit-learnconda activate sklearn-env`

instead of  `pip3 install -U scikit-learn`

if this is the issue so please issue i want to create a pull request for it and tell in which file this issue reside
Thanks

### Suggest a potential alternative/fix

By resoving above issue

COMMENT:
Hello Tim, I take a look at this.

Labels: Documentation
[PLSRegression] The standard scikit interface should have the argument in lowercase "y" not uppercase "Y"

### Describe the bug

The standard scikit interface should have the argument in lowercase "y" not uppercase "Y". Would you please modify it?

[[https://github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py#L622](https://urldefense.com/v3/__https:/github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py*L622__;Iw!!OzAIPA!HpZIZynDig4VRjHXL6okypqqpe44CBO0ltsalU3v7vfpWdUqghoJSzun4kIJK72EuyflVXKZZEcLic5jD0n-KvEP$)](https://github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py#L622)

### Steps/Code to Reproduce

Please see the above link.

### Expected Results

Change the  lowercase "y" instead of uppercase "Y".

### Actual Results

 lowercase "y"

### Versions

```shell
Scikit-learn 1.3.0
```

COMMENT:
Can I work on this issue ?

Labels: Moderate, API, help wanted
[PLSRegression] The standard scikit interface should have the argument in lowercase "y" not uppercase "Y"

### Describe the bug

The standard scikit interface should have the argument in lowercase "y" not uppercase "Y". Would you please modify it?

[[https://github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py#L622](https://urldefense.com/v3/__https:/github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py*L622__;Iw!!OzAIPA!HpZIZynDig4VRjHXL6okypqqpe44CBO0ltsalU3v7vfpWdUqghoJSzun4kIJK72EuyflVXKZZEcLic5jD0n-KvEP$)](https://github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py#L622)

### Steps/Code to Reproduce

Please see the above link.

### Expected Results

Change the  lowercase "y" instead of uppercase "Y".

### Actual Results

 lowercase "y"

### Versions

```shell
Scikit-learn 1.3.0
```

COMMENT:
I don't think I'd mind renaming `Y` to `y` everywhere through a deprecation cycle. WDYT @scikit-learn/core-devs 

@shivamks1998 this is not an easy issue really, and needs discussion.

Labels: Moderate, API, help wanted
[PLSRegression] The standard scikit interface should have the argument in lowercase "y" not uppercase "Y"

### Describe the bug

The standard scikit interface should have the argument in lowercase "y" not uppercase "Y". Would you please modify it?

[[https://github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py#L622](https://urldefense.com/v3/__https:/github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py*L622__;Iw!!OzAIPA!HpZIZynDig4VRjHXL6okypqqpe44CBO0ltsalU3v7vfpWdUqghoJSzun4kIJK72EuyflVXKZZEcLic5jD0n-KvEP$)](https://github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py#L622)

### Steps/Code to Reproduce

Please see the above link.

### Expected Results

Change the  lowercase "y" instead of uppercase "Y".

### Actual Results

 lowercase "y"

### Versions

```shell
Scikit-learn 1.3.0
```

COMMENT:
Ok

Labels: Moderate, API, help wanted
[PLSRegression] The standard scikit interface should have the argument in lowercase "y" not uppercase "Y"

### Describe the bug

The standard scikit interface should have the argument in lowercase "y" not uppercase "Y". Would you please modify it?

[[https://github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py#L622](https://urldefense.com/v3/__https:/github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py*L622__;Iw!!OzAIPA!HpZIZynDig4VRjHXL6okypqqpe44CBO0ltsalU3v7vfpWdUqghoJSzun4kIJK72EuyflVXKZZEcLic5jD0n-KvEP$)](https://github.com/scikit-learn/scikit-learn/blob/7f9bad99d6e0a3e8ddf92a7e5561245224dab102/sklearn/cross_decomposition/_pls.py#L622)

### Steps/Code to Reproduce

Please see the above link.

### Expected Results

Change the  lowercase "y" instead of uppercase "Y".

### Actual Results

 lowercase "y"

### Versions

```shell
Scikit-learn 1.3.0
```

COMMENT:
PLS is typically introduced and used in contexts where the target is a matrix of shape `(num_samples, num_targets)`, hence the use of capital `Y`. It's true that they support single targets, but it's not the primary use-case.

I'm not sure it's worth changing / deprecating personally, although I wouldn't fight against it either.

Labels: Moderate, API, help wanted