Talip7/scikit-learn-issues-multilabel huggingface dataset:
Make `_check_n_features` and `_check_feature_names` public

Since we are moving, `_check_n_features` and `_check_feature_names` into a new module, I'm wondering if we should make them public as well.

I can imagine some people that don't want to use `validate_data` but still want to set `self.n_features_in_` or `self.feature_names_in_`.

COMMENT:
Hi! I’m new to scikit-learn and open-source.  
I’m trying to understand this issue — can someone explain what needs to be done in simple terms?

Labels: Easy, Documentation, help wanted
Make `_check_n_features` and `_check_feature_names` public

Since we are moving, `_check_n_features` and `_check_feature_names` into a new module, I'm wondering if we should make them public as well.

I can imagine some people that don't want to use `validate_data` but still want to set `self.n_features_in_` or `self.feature_names_in_`.

COMMENT:
I don't think we need to make them public at this point, and the remaining places can probably use `validate_data` of sorts. So this issue can be closed.

Labels: Easy, Documentation, help wanted
Expose `verbose_feature_names_out` in `make_union`

### Describe the workflow you want to enable

```python
from sklearn.pipeline import make_union

feature_union = make_union(..., verbose_feature_names_out=False)
```

### Describe your proposed solution

Add a keyword arg like in `make_column_transformer`

### Describe alternatives you've considered, if relevant

Explicitly defining with `FeatureUnion`

### Additional context

Would be a convenience

COMMENT:
Hi, I'd be interested in working on this feature request.

Labels: New Feature
Expose `verbose_feature_names_out` in `make_union`

### Describe the workflow you want to enable

```python
from sklearn.pipeline import make_union

feature_union = make_union(..., verbose_feature_names_out=False)
```

### Describe your proposed solution

Add a keyword arg like in `make_column_transformer`

### Describe alternatives you've considered, if relevant

Explicitly defining with `FeatureUnion`

### Additional context

Would be a convenience

COMMENT:
The option already exists in `FeatureUnion` so it would make sense to expose it in `make_union`.

+1 for a PR. I could not spot any such open PR by doing a quick search.

Labels: New Feature
Expose `verbose_feature_names_out` in `make_union`

### Describe the workflow you want to enable

```python
from sklearn.pipeline import make_union

feature_union = make_union(..., verbose_feature_names_out=False)
```

### Describe your proposed solution

Add a keyword arg like in `make_column_transformer`

### Describe alternatives you've considered, if relevant

Explicitly defining with `FeatureUnion`

### Additional context

Would be a convenience

COMMENT:
Hi @ogrisel,
I've raised a PR addressing this issue: #30406

Looking forward to your feedback!

Labels: New Feature
HTML display rendering poorly in vscode "Dark High Contrast" color theme

### Describe the bug

When I use vscode, I use the "Dark High Contrast" theme, as my eyes are tired. In this mode, some of the estimator names are not visible in the HTML display

### Steps/Code to Reproduce

Execute the following code in a vscode (for instance a cell)
```python
# %%
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import PCA
from sklearn.ensemble import HistGradientBoostingRegressor

pipe = make_pipeline(PCA(), HistGradientBoostingRegressor())
pipe
```

### Expected Results

With the "Dark (Visual Studio)" theme, the result is:
![image](https://github.com/user-attachments/assets/1c8d52d4-ce8c-4e8a-a217-fc68be2f2f70)


### Actual Results

However, with the "Dark High Contrast", the result is
![image](https://github.com/user-attachments/assets/a229f0dd-c71f-4744-9733-00a82d5258c0)

Note that the title of the enclosing meta-estimator, here "Pipeline", is not visible

### Versions

```shell
git main of today (last commit: 426e6be923e34f68bc720ae625c8ca258f473265, merge of #30347)

System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /bin/python3
   machine: Linux-6.8.0-49-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.7.dev0
          pip: 24.0
   setuptools: 68.1.2
        numpy: 1.26.4
        scipy: 1.11.4
       Cython: 3.0.11
       pandas: 2.1.4+dfsg
   matplotlib: 3.6.3
       joblib: 1.3.2
threadpoolctl: 3.1.0
```
```

COMMENT:
Uhm I thought that we solve this bug before :). But indeed, we probably don't catch the right variable for the text in the CSS.

Labels: Bug, frontend
HTML display rendering poorly in vscode "Dark High Contrast" color theme

### Describe the bug

When I use vscode, I use the "Dark High Contrast" theme, as my eyes are tired. In this mode, some of the estimator names are not visible in the HTML display

### Steps/Code to Reproduce

Execute the following code in a vscode (for instance a cell)
```python
# %%
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import PCA
from sklearn.ensemble import HistGradientBoostingRegressor

pipe = make_pipeline(PCA(), HistGradientBoostingRegressor())
pipe
```

### Expected Results

With the "Dark (Visual Studio)" theme, the result is:
![image](https://github.com/user-attachments/assets/1c8d52d4-ce8c-4e8a-a217-fc68be2f2f70)


### Actual Results

However, with the "Dark High Contrast", the result is
![image](https://github.com/user-attachments/assets/a229f0dd-c71f-4744-9733-00a82d5258c0)

Note that the title of the enclosing meta-estimator, here "Pipeline", is not visible

### Versions

```shell
git main of today (last commit: 426e6be923e34f68bc720ae625c8ca258f473265, merge of #30347)

System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /bin/python3
   machine: Linux-6.8.0-49-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.7.dev0
          pip: 24.0
   setuptools: 68.1.2
        numpy: 1.26.4
        scipy: 1.11.4
       Cython: 3.0.11
       pandas: 2.1.4+dfsg
   matplotlib: 3.6.3
       joblib: 1.3.2
threadpoolctl: 3.1.0
```
```

COMMENT:
/take

Labels: Bug, frontend
HTML display rendering poorly in vscode "Dark High Contrast" color theme

### Describe the bug

When I use vscode, I use the "Dark High Contrast" theme, as my eyes are tired. In this mode, some of the estimator names are not visible in the HTML display

### Steps/Code to Reproduce

Execute the following code in a vscode (for instance a cell)
```python
# %%
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import PCA
from sklearn.ensemble import HistGradientBoostingRegressor

pipe = make_pipeline(PCA(), HistGradientBoostingRegressor())
pipe
```

### Expected Results

With the "Dark (Visual Studio)" theme, the result is:
![image](https://github.com/user-attachments/assets/1c8d52d4-ce8c-4e8a-a217-fc68be2f2f70)


### Actual Results

However, with the "Dark High Contrast", the result is
![image](https://github.com/user-attachments/assets/a229f0dd-c71f-4744-9733-00a82d5258c0)

Note that the title of the enclosing meta-estimator, here "Pipeline", is not visible

### Versions

```shell
git main of today (last commit: 426e6be923e34f68bc720ae625c8ca258f473265, merge of #30347)

System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /bin/python3
   machine: Linux-6.8.0-49-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.7.dev0
          pip: 24.0
   setuptools: 68.1.2
        numpy: 1.26.4
        scipy: 1.11.4
       Cython: 3.0.11
       pandas: 2.1.4+dfsg
   matplotlib: 3.6.3
       joblib: 1.3.2
threadpoolctl: 3.1.0
```
```

COMMENT:
Thanks Déa!

We recently faced the same problem in skrub and fixed it. I think that the relevant PR is:
https://github.com/skrub-data/skrub/pull/1201

Labels: Bug, frontend
HTML display rendering poorly in vscode "Dark High Contrast" color theme

### Describe the bug

When I use vscode, I use the "Dark High Contrast" theme, as my eyes are tired. In this mode, some of the estimator names are not visible in the HTML display

### Steps/Code to Reproduce

Execute the following code in a vscode (for instance a cell)
```python
# %%
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import PCA
from sklearn.ensemble import HistGradientBoostingRegressor

pipe = make_pipeline(PCA(), HistGradientBoostingRegressor())
pipe
```

### Expected Results

With the "Dark (Visual Studio)" theme, the result is:
![image](https://github.com/user-attachments/assets/1c8d52d4-ce8c-4e8a-a217-fc68be2f2f70)


### Actual Results

However, with the "Dark High Contrast", the result is
![image](https://github.com/user-attachments/assets/a229f0dd-c71f-4744-9733-00a82d5258c0)

Note that the title of the enclosing meta-estimator, here "Pipeline", is not visible

### Versions

```shell
git main of today (last commit: 426e6be923e34f68bc720ae625c8ca258f473265, merge of #30347)

System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /bin/python3
   machine: Linux-6.8.0-49-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.7.dev0
          pip: 24.0
   setuptools: 68.1.2
        numpy: 1.26.4
        scipy: 1.11.4
       Cython: 3.0.11
       pandas: 2.1.4+dfsg
   matplotlib: 3.6.3
       joblib: 1.3.2
threadpoolctl: 3.1.0
```
```

COMMENT:
Actually the bug was in VS Code theme. It has been resolved here: https://github.com/microsoft/vscode/pull/241014

So I'm going to close this issue.

Labels: Bug, frontend
HTML display rendering poorly in vscode "Dark High Contrast" color theme

### Describe the bug

When I use vscode, I use the "Dark High Contrast" theme, as my eyes are tired. In this mode, some of the estimator names are not visible in the HTML display

### Steps/Code to Reproduce

Execute the following code in a vscode (for instance a cell)
```python
# %%
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import PCA
from sklearn.ensemble import HistGradientBoostingRegressor

pipe = make_pipeline(PCA(), HistGradientBoostingRegressor())
pipe
```

### Expected Results

With the "Dark (Visual Studio)" theme, the result is:
![image](https://github.com/user-attachments/assets/1c8d52d4-ce8c-4e8a-a217-fc68be2f2f70)


### Actual Results

However, with the "Dark High Contrast", the result is
![image](https://github.com/user-attachments/assets/a229f0dd-c71f-4744-9733-00a82d5258c0)

Note that the title of the enclosing meta-estimator, here "Pipeline", is not visible

### Versions

```shell
git main of today (last commit: 426e6be923e34f68bc720ae625c8ca258f473265, merge of #30347)

System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /bin/python3
   machine: Linux-6.8.0-49-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.7.dev0
          pip: 24.0
   setuptools: 68.1.2
        numpy: 1.26.4
        scipy: 1.11.4
       Cython: 3.0.11
       pandas: 2.1.4+dfsg
   matplotlib: 3.6.3
       joblib: 1.3.2
threadpoolctl: 3.1.0
```
```

COMMENT:
Just linking to the original issue opened by @glemaitre: https://github.com/microsoft/vscode/issues/241005 

Maybe we keep this issue open until is solved?

Labels: Bug, frontend
HTML display rendering poorly in vscode "Dark High Contrast" color theme

### Describe the bug

When I use vscode, I use the "Dark High Contrast" theme, as my eyes are tired. In this mode, some of the estimator names are not visible in the HTML display

### Steps/Code to Reproduce

Execute the following code in a vscode (for instance a cell)
```python
# %%
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import PCA
from sklearn.ensemble import HistGradientBoostingRegressor

pipe = make_pipeline(PCA(), HistGradientBoostingRegressor())
pipe
```

### Expected Results

With the "Dark (Visual Studio)" theme, the result is:
![image](https://github.com/user-attachments/assets/1c8d52d4-ce8c-4e8a-a217-fc68be2f2f70)


### Actual Results

However, with the "Dark High Contrast", the result is
![image](https://github.com/user-attachments/assets/a229f0dd-c71f-4744-9733-00a82d5258c0)

Note that the title of the enclosing meta-estimator, here "Pipeline", is not visible

### Versions

```shell
git main of today (last commit: 426e6be923e34f68bc720ae625c8ca258f473265, merge of #30347)

System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /bin/python3
   machine: Linux-6.8.0-49-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.7.dev0
          pip: 24.0
   setuptools: 68.1.2
        numpy: 1.26.4
        scipy: 1.11.4
       Cython: 3.0.11
       pandas: 2.1.4+dfsg
   matplotlib: 3.6.3
       joblib: 1.3.2
threadpoolctl: 3.1.0
```
```

COMMENT:
I'm reopening this issue because:
- Upstream VScode has reverted the modification
- The problem appears in many other contexts when the surrounding CSS doesn't behave the way we expect.

Discussing with @glemaitre we are leaning towards using as a fix the trick used in skrub's TableReport which uses javascript to test the color of the surrounding background to make an informed choice.

When someone with frontend knowkledge has time, it would be great!

Labels: Bug, frontend
HTML display rendering poorly in vscode "Dark High Contrast" color theme

### Describe the bug

When I use vscode, I use the "Dark High Contrast" theme, as my eyes are tired. In this mode, some of the estimator names are not visible in the HTML display

### Steps/Code to Reproduce

Execute the following code in a vscode (for instance a cell)
```python
# %%
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import PCA
from sklearn.ensemble import HistGradientBoostingRegressor

pipe = make_pipeline(PCA(), HistGradientBoostingRegressor())
pipe
```

### Expected Results

With the "Dark (Visual Studio)" theme, the result is:
![image](https://github.com/user-attachments/assets/1c8d52d4-ce8c-4e8a-a217-fc68be2f2f70)


### Actual Results

However, with the "Dark High Contrast", the result is
![image](https://github.com/user-attachments/assets/a229f0dd-c71f-4744-9733-00a82d5258c0)

Note that the title of the enclosing meta-estimator, here "Pipeline", is not visible

### Versions

```shell
git main of today (last commit: 426e6be923e34f68bc720ae625c8ca258f473265, merge of #30347)

System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /bin/python3
   machine: Linux-6.8.0-49-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.7.dev0
          pip: 24.0
   setuptools: 68.1.2
        numpy: 1.26.4
        scipy: 1.11.4
       Cython: 3.0.11
       pandas: 2.1.4+dfsg
   matplotlib: 3.6.3
       joblib: 1.3.2
threadpoolctl: 3.1.0
```
```

COMMENT:
Yep, here it is an example that our current implementation is too much dependent on the underlying CSS rule and it is not robust enough.

Let's revisit it. I think that we should use a similar design than in `skrub`: https://github.com/skrub-data/skrub/pull/1201

Labels: Bug, frontend
HTML display rendering poorly in vscode "Dark High Contrast" color theme

### Describe the bug

When I use vscode, I use the "Dark High Contrast" theme, as my eyes are tired. In this mode, some of the estimator names are not visible in the HTML display

### Steps/Code to Reproduce

Execute the following code in a vscode (for instance a cell)
```python
# %%
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import PCA
from sklearn.ensemble import HistGradientBoostingRegressor

pipe = make_pipeline(PCA(), HistGradientBoostingRegressor())
pipe
```

### Expected Results

With the "Dark (Visual Studio)" theme, the result is:
![image](https://github.com/user-attachments/assets/1c8d52d4-ce8c-4e8a-a217-fc68be2f2f70)


### Actual Results

However, with the "Dark High Contrast", the result is
![image](https://github.com/user-attachments/assets/a229f0dd-c71f-4744-9733-00a82d5258c0)

Note that the title of the enclosing meta-estimator, here "Pipeline", is not visible

### Versions

```shell
git main of today (last commit: 426e6be923e34f68bc720ae625c8ca258f473265, merge of #30347)

System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /bin/python3
   machine: Linux-6.8.0-49-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.7.dev0
          pip: 24.0
   setuptools: 68.1.2
        numpy: 1.26.4
        scipy: 1.11.4
       Cython: 3.0.11
       pandas: 2.1.4+dfsg
   matplotlib: 3.6.3
       joblib: 1.3.2
threadpoolctl: 3.1.0
```
```

COMMENT:
I'm happy to try again.

Labels: Bug, frontend
HTML display rendering poorly in vscode "Dark High Contrast" color theme

### Describe the bug

When I use vscode, I use the "Dark High Contrast" theme, as my eyes are tired. In this mode, some of the estimator names are not visible in the HTML display

### Steps/Code to Reproduce

Execute the following code in a vscode (for instance a cell)
```python
# %%
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import PCA
from sklearn.ensemble import HistGradientBoostingRegressor

pipe = make_pipeline(PCA(), HistGradientBoostingRegressor())
pipe
```

### Expected Results

With the "Dark (Visual Studio)" theme, the result is:
![image](https://github.com/user-attachments/assets/1c8d52d4-ce8c-4e8a-a217-fc68be2f2f70)


### Actual Results

However, with the "Dark High Contrast", the result is
![image](https://github.com/user-attachments/assets/a229f0dd-c71f-4744-9733-00a82d5258c0)

Note that the title of the enclosing meta-estimator, here "Pipeline", is not visible

### Versions

```shell
git main of today (last commit: 426e6be923e34f68bc720ae625c8ca258f473265, merge of #30347)

System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /bin/python3
   machine: Linux-6.8.0-49-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.7.dev0
          pip: 24.0
   setuptools: 68.1.2
        numpy: 1.26.4
        scipy: 1.11.4
       Cython: 3.0.11
       pandas: 2.1.4+dfsg
   matplotlib: 3.6.3
       joblib: 1.3.2
threadpoolctl: 3.1.0
```
```

COMMENT:
@DeaMariaLeon thanks!!

Have a look at how it's done in skrub's TableReport

Labels: Bug, frontend
Enhance "Choosing the Right Estimator" Graphic (scikit-learn algorithm cheat sheet)

### Describe the issue linked to the documentation

In its user guide, scikit-learn offers a [Choosing the right estimator](https://scikit-learn.org/stable/machine_learning_map.html) which is an interactive scikit-learn algorithm cheat sheet that is great.


When thinking about new features for [skore](https://github.com/probabl-ai/skore), I thought of enhancing the user guide and have a pedagogical table which, for each estimator, says:
- if it needs to be scaled,
- if it can handle categorical features,
- if it can handle missing data,
- if it holds some randomness (and where / why),
- if it can be paralleled,
- etc (full proper list to be determined).

EDIT:
- The scikit-learn graph / map is great, but not sufficient IMHO because I would like to have, for each estimator, if I need to normalize the data or not, etc -> guidelines for each estimator
- I would like a table that is separate from the map, this is also a cheat sheet but not to appear on the map, maybe at the bottom of the map on the same user guide page

When discussing this with @jeromedockes and @Vincent-Maladiere, they told me about scikit-learn's [estimator tags](https://scikit-learn.org/dev/developers/develop.html#estimator-tags) such as [`is_regressor`](https://scikit-learn.org/dev/modules/generated/sklearn.base.is_regressor.html#sklearn.base.is_regressor). It seems that that knowledge is already partially in the tags.

### Suggest a potential alternative/fix

- Maybe scikit-learn could have a table in the user guide with guidelines for each estimator?
- Maybe scikit-learn could hold more tags? And the table could be built from those tags?

COMMENT:
Pinging @lesteve, @Charlie-XIAO, and @thomasjpfan, as they are more qualified than I am to comment on this. Apologies for the spam!

Labels: Documentation
Enhance "Choosing the Right Estimator" Graphic (scikit-learn algorithm cheat sheet)

### Describe the issue linked to the documentation

In its user guide, scikit-learn offers a [Choosing the right estimator](https://scikit-learn.org/stable/machine_learning_map.html) which is an interactive scikit-learn algorithm cheat sheet that is great.


When thinking about new features for [skore](https://github.com/probabl-ai/skore), I thought of enhancing the user guide and have a pedagogical table which, for each estimator, says:
- if it needs to be scaled,
- if it can handle categorical features,
- if it can handle missing data,
- if it holds some randomness (and where / why),
- if it can be paralleled,
- etc (full proper list to be determined).

EDIT:
- The scikit-learn graph / map is great, but not sufficient IMHO because I would like to have, for each estimator, if I need to normalize the data or not, etc -> guidelines for each estimator
- I would like a table that is separate from the map, this is also a cheat sheet but not to appear on the map, maybe at the bottom of the map on the same user guide page

When discussing this with @jeromedockes and @Vincent-Maladiere, they told me about scikit-learn's [estimator tags](https://scikit-learn.org/dev/developers/develop.html#estimator-tags) such as [`is_regressor`](https://scikit-learn.org/dev/modules/generated/sklearn.base.is_regressor.html#sklearn.base.is_regressor). It seems that that knowledge is already partially in the tags.

### Suggest a potential alternative/fix

- Maybe scikit-learn could have a table in the user guide with guidelines for each estimator?
- Maybe scikit-learn could hold more tags? And the table could be built from those tags?

COMMENT:
IMO, the first thing to do is reduce/precise the scope and try to improve the situation by making incremental PRs.

About improving "Choosing the right estimator" map in a minimal way for example some quick recent thoughts https://github.com/scikit-learn/scikit-learn/issues/30283#issuecomment-2499678724. Better suggestions more than welcome!

See https://github.com/scikit-learn/scikit-learn/issues/7686 for some attempts at improving the map. There is also https://github.com/scikit-learn/scikit-learn/issues/28314.

Labels: Documentation