Talip7/scikit-learn-issues-multilabel huggingface dataset:
DOC Update wikipedia article for scikit-learn

### Describe the issue linked to the documentation

The [wikipedia article on scikit-learn](https://en.wikipedia.org/wiki/Scikit-learn) covers its basic history, development, and features, but there are a few areas where additional details could enhance the content

Notice that this is not an issue for our internal documentation (and therefore cannot be fixed by a PR), but it is documentation nevertheless.

### Suggest a potential alternative/fix

We can potentially get inspired by other projects wikipedia articles, such as [XGBoost](https://en.wikipedia.org/wiki/XGBoost), but some axis that can be added to the article are:

- [x] The [wiki article for TensorFlow](https://en.wikipedia.org/wiki/TensorFlow) has an `Applications` section. We can do the same using our [Testimonials](https://scikit-learn.org/stable/testimonials/testimonials.html) as inspiration.

- [ ] Update the `Version history` section and add more recent developments and features as per the [release highlights](https://scikit-learn.org/stable/auto_examples/release_highlights/index.html).

- [x] Add an `Awards` section to mention e.g. [this Open Source Software Award](https://blog.scikit-learn.org/press/frenchaward/) or [this price for innovation](https://www.inria.fr/en/2019-inria-french-academy-sciences-dassault-systemes-innovation-prize-scikit-learn-success-story).

- [ ] Mention additional metrics, e.g. the [2021](https://www.kaggle.com/kaggle-survey-2021) and [2022](https://www.kaggle.com/kaggle-survey-2022) kaggle surveys question regarding which machine learning frameworks are used by data scientists on a regular basis?

The priority should be to update the English version, but not limited to it. In any case, this issue will be considered as solved once all the above points are addressed for said language. Because of that, if you have contributed to the article, please keep the community posted by commenting on this issue.

COMMENT:
Discussion posted as well in https://en.wikipedia.org/wiki/Talk:Scikit-learn#Update_and_add_more_information

Labels: Documentation
DOC Update wikipedia article for scikit-learn

### Describe the issue linked to the documentation

The [wikipedia article on scikit-learn](https://en.wikipedia.org/wiki/Scikit-learn) covers its basic history, development, and features, but there are a few areas where additional details could enhance the content

Notice that this is not an issue for our internal documentation (and therefore cannot be fixed by a PR), but it is documentation nevertheless.

### Suggest a potential alternative/fix

We can potentially get inspired by other projects wikipedia articles, such as [XGBoost](https://en.wikipedia.org/wiki/XGBoost), but some axis that can be added to the article are:

- [x] The [wiki article for TensorFlow](https://en.wikipedia.org/wiki/TensorFlow) has an `Applications` section. We can do the same using our [Testimonials](https://scikit-learn.org/stable/testimonials/testimonials.html) as inspiration.

- [ ] Update the `Version history` section and add more recent developments and features as per the [release highlights](https://scikit-learn.org/stable/auto_examples/release_highlights/index.html).

- [x] Add an `Awards` section to mention e.g. [this Open Source Software Award](https://blog.scikit-learn.org/press/frenchaward/) or [this price for innovation](https://www.inria.fr/en/2019-inria-french-academy-sciences-dassault-systemes-innovation-prize-scikit-learn-success-story).

- [ ] Mention additional metrics, e.g. the [2021](https://www.kaggle.com/kaggle-survey-2021) and [2022](https://www.kaggle.com/kaggle-survey-2022) kaggle surveys question regarding which machine learning frameworks are used by data scientists on a regular basis?

The priority should be to update the English version, but not limited to it. In any case, this issue will be considered as solved once all the above points are addressed for said language. Because of that, if you have contributed to the article, please keep the community posted by commenting on this issue.

COMMENT:
Hey! I replied to you in the Talk subpage of the wiki article, but want to mention here as well that I added the "Applications" section. Now, we can change the links in that section to the corresponding testimonials. Will do in a couple of days.

Labels: Documentation
DOC Update wikipedia article for scikit-learn

### Describe the issue linked to the documentation

The [wikipedia article on scikit-learn](https://en.wikipedia.org/wiki/Scikit-learn) covers its basic history, development, and features, but there are a few areas where additional details could enhance the content

Notice that this is not an issue for our internal documentation (and therefore cannot be fixed by a PR), but it is documentation nevertheless.

### Suggest a potential alternative/fix

We can potentially get inspired by other projects wikipedia articles, such as [XGBoost](https://en.wikipedia.org/wiki/XGBoost), but some axis that can be added to the article are:

- [x] The [wiki article for TensorFlow](https://en.wikipedia.org/wiki/TensorFlow) has an `Applications` section. We can do the same using our [Testimonials](https://scikit-learn.org/stable/testimonials/testimonials.html) as inspiration.

- [ ] Update the `Version history` section and add more recent developments and features as per the [release highlights](https://scikit-learn.org/stable/auto_examples/release_highlights/index.html).

- [x] Add an `Awards` section to mention e.g. [this Open Source Software Award](https://blog.scikit-learn.org/press/frenchaward/) or [this price for innovation](https://www.inria.fr/en/2019-inria-french-academy-sciences-dassault-systemes-innovation-prize-scikit-learn-success-story).

- [ ] Mention additional metrics, e.g. the [2021](https://www.kaggle.com/kaggle-survey-2021) and [2022](https://www.kaggle.com/kaggle-survey-2022) kaggle surveys question regarding which machine learning frameworks are used by data scientists on a regular basis?

The priority should be to update the English version, but not limited to it. In any case, this issue will be considered as solved once all the above points are addressed for said language. Because of that, if you have contributed to the article, please keep the community posted by commenting on this issue.

COMMENT:
Excellent, thanks @Arslan2003!

Labels: Documentation
Unclear information in Explained variance

### Describe the issue linked to the documentation

Hi, the text in Explained variance page is somewhat unclear, so I want to propose a clearer text. On line 1005, the detail says this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that it does not account for systematic offsets in the prediction. Most often the R^2 score should be preferred."



### Suggest a potential alternative/fix

I propose to change it like this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that **R^2 score also accounts for systematic offsets in the prediction (i.e., the intercept of the linear function). This means that R^2 score changes with different systematic offsets, whereas  Explained Variance does not.** Most often the R^2 score should be preferred."

COMMENT:
Hi @KormiSK, would you like to open a PR to improve this passage ?

Labels: Documentation
Unclear information in Explained variance

### Describe the issue linked to the documentation

Hi, the text in Explained variance page is somewhat unclear, so I want to propose a clearer text. On line 1005, the detail says this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that it does not account for systematic offsets in the prediction. Most often the R^2 score should be preferred."



### Suggest a potential alternative/fix

I propose to change it like this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that **R^2 score also accounts for systematic offsets in the prediction (i.e., the intercept of the linear function). This means that R^2 score changes with different systematic offsets, whereas  Explained Variance does not.** Most often the R^2 score should be preferred."

COMMENT:
Hi, I would like to work on this.

Labels: Documentation
Unclear information in Explained variance

### Describe the issue linked to the documentation

Hi, the text in Explained variance page is somewhat unclear, so I want to propose a clearer text. On line 1005, the detail says this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that it does not account for systematic offsets in the prediction. Most often the R^2 score should be preferred."



### Suggest a potential alternative/fix

I propose to change it like this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that **R^2 score also accounts for systematic offsets in the prediction (i.e., the intercept of the linear function). This means that R^2 score changes with different systematic offsets, whereas  Explained Variance does not.** Most often the R^2 score should be preferred."

COMMENT:
@jeremiedbb Hi, it only took me like 40 minutes to figure out how but here it is: #30919. Thank you for the suggestion, I learned something new today.

Labels: Documentation
Unclear information in Explained variance

### Describe the issue linked to the documentation

Hi, the text in Explained variance page is somewhat unclear, so I want to propose a clearer text. On line 1005, the detail says this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that it does not account for systematic offsets in the prediction. Most often the R^2 score should be preferred."



### Suggest a potential alternative/fix

I propose to change it like this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that **R^2 score also accounts for systematic offsets in the prediction (i.e., the intercept of the linear function). This means that R^2 score changes with different systematic offsets, whereas  Explained Variance does not.** Most often the R^2 score should be preferred."

COMMENT:
#30919 was closed without merging but the suggested improvements discussed in the PR still make sense to me. If someone else wants to start a new PR while taking the discussion of #30919 into account, please feel free to do so.

Labels: Documentation
Unclear information in Explained variance

### Describe the issue linked to the documentation

Hi, the text in Explained variance page is somewhat unclear, so I want to propose a clearer text. On line 1005, the detail says this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that it does not account for systematic offsets in the prediction. Most often the R^2 score should be preferred."



### Suggest a potential alternative/fix

I propose to change it like this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that **R^2 score also accounts for systematic offsets in the prediction (i.e., the intercept of the linear function). This means that R^2 score changes with different systematic offsets, whereas  Explained Variance does not.** Most often the R^2 score should be preferred."

COMMENT:
Hi, I have read through this issue and the discussion in the related PR #30919. As requested by @ogrisel, I would like to open a new PR that incorporates the feedback from that discussion. Can you please assign this to me.

Labels: Documentation
Unclear information in Explained variance

### Describe the issue linked to the documentation

Hi, the text in Explained variance page is somewhat unclear, so I want to propose a clearer text. On line 1005, the detail says this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that it does not account for systematic offsets in the prediction. Most often the R^2 score should be preferred."



### Suggest a potential alternative/fix

I propose to change it like this:

> "The Explained Variance score is similar to the R^2 score, with the notable difference that **R^2 score also accounts for systematic offsets in the prediction (i.e., the intercept of the linear function). This means that R^2 score changes with different systematic offsets, whereas  Explained Variance does not.** Most often the R^2 score should be preferred."

COMMENT:
Hi, I've been trying to debug these CI failures. I believe I've fixed the documentation formatting, but some of the core tests are still failing. Since my change was only in a docstring, I'm not sure why these tests would be affected.

Could a maintainer please take a look and let me know if this is a known issue or if I've made a mistake? Any guidance would be greatly appreciated.

Labels: Documentation
The `alpha` parameter for lasso regression can only be a `float`

### Describe the issue linked to the documentation

https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html#sklearn.linear_model.Lasso

The line "If an array is passed, penalties are assumed to be specific to the targets. Hence they must correspond in number." is found under the "Notes" section. However, in the parameters section and the source, alpha is listed as *float, default=1.0*

### Suggest a potential alternative/fix

The line should be deleted. Better yet, allow `alpha` to be an array, like for https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Ridge.html.

COMMENT:
Thanks for the report @kxiao1. Indeed this line was added by mistake as the result of a too quick copy-paste and should be removed. Would you be interested in making a PR ?

> Better yet, allow alpha to be an array

There have been long standing discussions where a consensus was never really reached afaik (see for instance https://github.com/scikit-learn/scikit-learn/issues/11566).

Labels: Documentation
RFC Make `n_outputs_` consistent across regressors

The scikit-learn API defines `classes_` as part of the API for classifier.

A similar handy thing for regressor models, IMO, would be to know if it was fit on a single or multioutput target. Currently, some regressors expose the `n_outputs_` parameter, but other not. One can infer from the `intercept_` or `coef_` the number of target for liner model.

So I'm wondering if we could extend the API by extending `n_outputs_` for all regressors the same way we have `classes_` for classifiers?

Note that the tags do not help here because they inform whether or not an estimator is supporting multioutput.

COMMENT:
+1

Labels: API, RFC
RFC Make `n_outputs_` consistent across regressors

The scikit-learn API defines `classes_` as part of the API for classifier.

A similar handy thing for regressor models, IMO, would be to know if it was fit on a single or multioutput target. Currently, some regressors expose the `n_outputs_` parameter, but other not. One can infer from the `intercept_` or `coef_` the number of target for liner model.

So I'm wondering if we could extend the API by extending `n_outputs_` for all regressors the same way we have `classes_` for classifiers?

Note that the tags do not help here because they inform whether or not an estimator is supporting multioutput.

COMMENT:
I'm +0.75 on the proposal, but it'll take some time for third party estimators to catch up and define `n_outputs_`. 

How should `n_outputs_` be defined if `predict` outputs a shape of `(n_samples,)` compared to `(n_samples, 1)`?

Labels: API, RFC
RFC Make `n_outputs_` consistent across regressors

The scikit-learn API defines `classes_` as part of the API for classifier.

A similar handy thing for regressor models, IMO, would be to know if it was fit on a single or multioutput target. Currently, some regressors expose the `n_outputs_` parameter, but other not. One can infer from the `intercept_` or `coef_` the number of target for liner model.

So I'm wondering if we could extend the API by extending `n_outputs_` for all regressors the same way we have `classes_` for classifiers?

Note that the tags do not help here because they inform whether or not an estimator is supporting multioutput.

COMMENT:
> I'm +0.75 on the proposal, but it'll take some time for third party estimators to catch up and define n_outputs_.

We can strive to be consistent in scikit-learn first. Then, give a couple of version to become compliant via the estimator checks.

> How should n_outputs_ be defined if predict outputs a shape of (n_samples,) compared to (n_samples, 1)?

In both cases, it would be `n_outputs_ = 1`.

Labels: API, RFC
RFC Make `n_outputs_` consistent across regressors

The scikit-learn API defines `classes_` as part of the API for classifier.

A similar handy thing for regressor models, IMO, would be to know if it was fit on a single or multioutput target. Currently, some regressors expose the `n_outputs_` parameter, but other not. One can infer from the `intercept_` or `coef_` the number of target for liner model.

So I'm wondering if we could extend the API by extending `n_outputs_` for all regressors the same way we have `classes_` for classifiers?

Note that the tags do not help here because they inform whether or not an estimator is supporting multioutput.

COMMENT:
Hello @glemaitre
 
Would you happen to be looking for any contributors to work on this?

Labels: API, RFC
RFC Make `n_outputs_` consistent across regressors

The scikit-learn API defines `classes_` as part of the API for classifier.

A similar handy thing for regressor models, IMO, would be to know if it was fit on a single or multioutput target. Currently, some regressors expose the `n_outputs_` parameter, but other not. One can infer from the `intercept_` or `coef_` the number of target for liner model.

So I'm wondering if we could extend the API by extending `n_outputs_` for all regressors the same way we have `classes_` for classifiers?

Note that the tags do not help here because they inform whether or not an estimator is supporting multioutput.

COMMENT:
I think that we need to have a better consensus before to go ahead

Labels: API, RFC
RFC Make `n_outputs_` consistent across regressors

The scikit-learn API defines `classes_` as part of the API for classifier.

A similar handy thing for regressor models, IMO, would be to know if it was fit on a single or multioutput target. Currently, some regressors expose the `n_outputs_` parameter, but other not. One can infer from the `intercept_` or `coef_` the number of target for liner model.

So I'm wondering if we could extend the API by extending `n_outputs_` for all regressors the same way we have `classes_` for classifiers?

Note that the tags do not help here because they inform whether or not an estimator is supporting multioutput.

COMMENT:
I'm trying to understand the motivation for exposing `n_outputs_` (as defined by `self.n_outputs_ = y.shape[1]`)  across all regressors. Is there a use case where this attribute provides additional information to users that they don't already know?

Also, a few of the tree classifiers (for example `RandomForestClassifier`) also expose `n_outputs_`, so it doesn't seem to be just a regressor thing.

Labels: API, RFC
RFC Make `n_outputs_` consistent across regressors

The scikit-learn API defines `classes_` as part of the API for classifier.

A similar handy thing for regressor models, IMO, would be to know if it was fit on a single or multioutput target. Currently, some regressors expose the `n_outputs_` parameter, but other not. One can infer from the `intercept_` or `coef_` the number of target for liner model.

So I'm wondering if we could extend the API by extending `n_outputs_` for all regressors the same way we have `classes_` for classifiers?

Note that the tags do not help here because they inform whether or not an estimator is supporting multioutput.

COMMENT:
> Is there a use case where this attribute provides additional information to users that they don't already know?

The primary use case is to know what `predict` returns without having to give it input. For example, if you have a function that accepts a certain shape of data, you can check if `estimator.predict` is compatible by looking at `estimator.n_outputs_`.

> so it doesn't seem to be just a regressor thing.

Yes, classifiers can have `n_outputs_` if their `type_of_target` is `multiclass-multioutput` or `multilabel-indicator`.

Labels: API, RFC
RFC Make `n_outputs_` consistent across regressors

The scikit-learn API defines `classes_` as part of the API for classifier.

A similar handy thing for regressor models, IMO, would be to know if it was fit on a single or multioutput target. Currently, some regressors expose the `n_outputs_` parameter, but other not. One can infer from the `intercept_` or `coef_` the number of target for liner model.

So I'm wondering if we could extend the API by extending `n_outputs_` for all regressors the same way we have `classes_` for classifiers?

Note that the tags do not help here because they inform whether or not an estimator is supporting multioutput.

COMMENT:
I'm +0.99 on this. I've never had the chance to dive deep into the n_outputs_ outside of linear and tree submodule within sklearn, but my impression was it was not very well supported, and sort of sporadicly defined. For context, I also very much like the `classes_` fitted parameter because it tells me exactly what I should expect, and helps debugging. So having the `n_outputs_` would be similarly helpful I imagine. 

The only difference is that `n_outputs_` should be defined for all regressors, but could also be defined for some classifiers, so should all classifiers default to `n_outputs_ == 1` since a lot do something like binary classification?

>> How should n_outputs_ be defined if predict outputs a shape of (n_samples,) compared to (n_samples, 1)? 
> In both cases, it would be n_outputs_ = 1.`

Would this result in any weird bugs? E.g. `assert model.n_outputs_ == df.shape[1]`. I guess addressable with good documentation?

**tldr: open questions around edge cases for (n_samples, ) vs (n_samples, 1), and how to handle classifiers**

Labels: API, RFC
StandardScaler is `stateless`

### Describe the bug

The StandardScaler seems to be stateless in version 1.6.1. But fit changes the state of the StandardScaler if I got it correctly. 

### Steps/Code to Reproduce

```
StandardScaler()._get_tags()["stateless"]
```

### Expected Results

False

### Actual Results

True

### Versions

```shell
System:
    python: 3.10.14 (main, Jul 18 2024, 22:40:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]
executable: ****/python
   machine: macOS-15.2-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.1
          pip: 24.1.2
   setuptools: 71.0.3
        numpy: 1.26.4
        scipy: 1.13.1
       Cython: 3.0.11
       pandas: 2.2.3
   matplotlib: 3.9.2
       joblib: 1.4.2
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: ****.dylib
        version: 0.3.23.dev
threading_layer: pthreads
   architecture: armv8

       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: *****
        version: 0.3.27
threading_layer: pthreads
   architecture: neoversen1

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: *****
        version: None
```

COMMENT:
Hello @benHeid,

thanks for reporting.

I have checked and would also think it is a bug. This code returned `False` up until version 1.5.2 and since version 1.6 it does return `True`:

```python
from sklearn.preprocessing import StandardScaler, MinMaxScaler
print(StandardScaler()._get_tags()["stateless"])
print(MinMaxScaler()._get_tags()["stateless"])
```

As a workaround please use the `"requires_fit"` tag, which is supposed to replace the `"stateless"` tag.

The issue is related to #30327.

Labels: Bug, Regression