Talip7/scikit-learn-issues-multilabel huggingface dataset:
Missing documentation on ConvergenceWarning?

### Describe the issue linked to the documentation

Hi!
I was looking to know more about the convergence warning, I found [this link](https://scikit-learn.org/1.5/modules/generated/sklearn.exceptions.ConvergenceWarning.html), which redirects towards sklearn.utils. However, when scrolling in the left pane menu in sklearn.utils, I can't find it. Is it because it's deprecated and don't exist anymore (it's still referenced extensively in the code therefore I don't think so)? Shouldn't this page say so if it's the case?

![image](https://github.com/user-attachments/assets/06e28711-29b7-4238-bfb5-602fd5ae4795)


### Suggest a potential alternative/fix

If not deprecated, it would be nice to put the link directly in this page to the new page.

COMMENT:
Olá @MarieS-WiMLDS I think it would be appropriate to provide more clarification in the documentation. My suggestion would be:

1) Put a link to the ConvergenceWarning in the side navigation panel.

2) And code examples that show how the ConvergenceWarning can arise and what users can do to resolve it.

I am available to contribute.

Labels: Documentation, Needs Triage
Missing documentation on ConvergenceWarning?

### Describe the issue linked to the documentation

Hi!
I was looking to know more about the convergence warning, I found [this link](https://scikit-learn.org/1.5/modules/generated/sklearn.exceptions.ConvergenceWarning.html), which redirects towards sklearn.utils. However, when scrolling in the left pane menu in sklearn.utils, I can't find it. Is it because it's deprecated and don't exist anymore (it's still referenced extensively in the code therefore I don't think so)? Shouldn't this page say so if it's the case?

![image](https://github.com/user-attachments/assets/06e28711-29b7-4238-bfb5-602fd5ae4795)


### Suggest a potential alternative/fix

If not deprecated, it would be nice to put the link directly in this page to the new page.

COMMENT:
`ConvergenceWarning` is in `sklearn.exceptions`, not `sklearn.utils`, and the navbar shows it correctly for me.

![image](https://github.com/user-attachments/assets/584e4fc1-3301-4371-ab9b-bfabd70bb4de)

Labels: Documentation, Needs Triage
Add "mish" activation function to sklearn.neural_network.MLPClassifier and make it the default

### Describe the workflow you want to enable

Currently, the default activation function for `sklearn.neural_network.MLPClassifier` is "relu". However, there are several papers that demonstrate better results with "mish" = (x ⋅ tanh(ln⁡(1 + e^x))) = x ⋅ tanh(softplus(x)).

Some references:
1) According to [Mish: A Self Regularized Non-Monotonic Neural Activation Function](https://arxiv.org/abs/1908.08681v1), mish outperformed all relu variants on CIFAR-10.
2) According to [Optimizing cnn-Bigru performance: Mish activation and comparative analysis with Relu](https://arxiv.org/abs/2405.20503), mish outperformed relu on three different classification datasets.
3) According to [Analyzing Lung Disease Using Highly Effective Deep Learning Techniques](https://www.researchgate.net/publication/340880583_Analyzing_Lung_Disease_Using_Highly_Effective_Deep_Learning_Techniques), mish outperformed relu on a lung lesion dataset, regardless of which optimizer was used (SGD, Adagrad, Adam, etc.).
4) According to [Double-Branch Network with Pyramidal Convolution and Iterative Attention for Hyperspectral Image Classification](https://www.researchgate.net/publication/350701369_Double-Branch_Network_with_Pyramidal_Convolution_and_Iterative_Attention_for_Hyperspectral_Image_Classification), using mish improved accuracy on four hyperspectral image classification datasets.
5) Not an academic paper, but still: https://lessw.medium.com/meet-mish-new-state-of-the-art-ai-activation-function-the-successor-to-relu-846a6d93471f.

### Describe your proposed solution

```
def faster_mish(x):
    # naive implementation: return x * np.tanh(np.log1p(np.exp(x)))
    expx = np.exp(x)
    n = expx * expx + 2 * expx
    # https://cs.stackexchange.com/a/125052
    return np.where(x <= -0.6, x * n / (n + 2), x - 2 * x / (n + 2))
```

### Describe alternatives you've considered, if relevant

Pytorch has implemented mish: https://pytorch.org/docs/stable/generated/torch.nn.Mish.html
However, for my small personal project, I'd like to keep things simple and using sklearn is definitely easier that using pytorch.

### Additional context

I mostly focused on classification, but mish is good for regression too, so it should be the default for `MLPRegressor`, too.

COMMENT:
Our MLP implementation is mostly included for educational / baseline check. For any serious use of a DL / NN based mdoel, please refer to other frameworks dedicated for this purpose. Note that wrappers such as `skorch` let you use them in a scikit-learn pipeline.

Labels: New Feature, Needs Triage
Exception on rendering html empty pipeline

### Describe the bug

Rendering empty pipeline to html fails, and just simply displaying an empty pipeline fails on IPython/Jupyter.

See upstream IPython issue:

https://github.com/ipython/ipython/issues/14568

### Steps/Code to Reproduce

```python
>>> from sklearn.pipeline import Pipeline
>>> pipeline = Pipeline(steps=[])
>>> pipeline
Pipeline(steps=[])
>>> from sklearn.utils._estimator_html_repr import estimator_html_repr
>>> estimator_html_repr(pipeline)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/bussonniermatthias/miniconda3/envs/arm64/lib/python3.12/site-packages/sklearn/utils/_estimator_html_repr.py", line 348, in estimator_html_repr
    check_is_fitted(estimator)
  File "/Users/bussonniermatthias/miniconda3/envs/arm64/lib/python3.12/site-packages/sklearn/utils/validation.py", line 1660, in check_is_fitted
    if not _is_fitted(estimator, attributes, all_or_any):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bussonniermatthias/miniconda3/envs/arm64/lib/python3.12/site-packages/sklearn/utils/validation.py", line 1579, in _is_fitted
    return estimator.__sklearn_is_fitted__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bussonniermatthias/miniconda3/envs/arm64/lib/python3.12/site-packages/sklearn/pipeline.py", line 1096, in __sklearn_is_fitted__
    check_is_fitted(self.steps[-1][1])
                    ~~~~~~~~~~^^^^
IndexError: list index out of range
```

or just in IPython:

```python
# This code fails - EMPTY pipeline is rendered

from sklearn.pipeline import Pipeline

# Create pipeline
pipeline = Pipeline(steps=[])
pipeline
# same error, no need to explicitely call the repr code as it is registerd.
```

### Expected Results

Don't raise in the repr_handler.


### Actual Results

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/bussonniermatthias/miniconda3/envs/arm64/lib/python3.12/site-packages/sklearn/utils/_estimator_html_repr.py", line 348, in estimator_html_repr
    check_is_fitted(estimator)
  File "/Users/bussonniermatthias/miniconda3/envs/arm64/lib/python3.12/site-packages/sklearn/utils/validation.py", line 1660, in check_is_fitted
    if not _is_fitted(estimator, attributes, all_or_any):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bussonniermatthias/miniconda3/envs/arm64/lib/python3.12/site-packages/sklearn/utils/validation.py", line 1579, in _is_fitted
    return estimator.__sklearn_is_fitted__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bussonniermatthias/miniconda3/envs/arm64/lib/python3.12/site-packages/sklearn/pipeline.py", line 1096, in __sklearn_is_fitted__
    check_is_fitted(self.steps[-1][1])
                    ~~~~~~~~~~^^^^
IndexError: list index out of range
```

### Versions

```shell
sklearn: 1.5.2
```

COMMENT:
Hi @adrinjalali,

PR updated and ready for review. Thank you!

Labels: Bug
issue in building from source with Windows64 Python 3.12.7

### Describe the bug

I am currently following the guide on [building from source](https://scikit-learn.org/dev/developers/advanced_installation.html) to create an editable build of scikit-learn. However, I encountered some errors during the process. Any help is highly appriciated.

### Steps/Code to Reproduce
```
pip install wheel numpy scipy cython meson-python ninja
$env:DISTUTILS_USE_SDK = "1"  
& "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
pip install --editable . --verbose --no-build-isolation --config-settings editable-verbose=true 
```

### Expected Results

No error is thrown.

### Actual Results
```
[146/251] Compiling C object sklearn/_loss/_loss.cp312-win_amd64.pyd.p/meson-generated_sklearn__loss__loss.pyx.c.obj
  ninja: build stopped: subcommand failed.
  Activating VS 17.11.2
  INFO: automatically activated MSVC compiler environment
  INFO: autodetecting backend as ninja
  INFO: calculating backend command to run: C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv/Scripts\ninja.EXE
  error: subprocess-exited-with-error

  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv\Scripts\python.exe' 'C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py' prepare_metadata_for_build_editable 'C:\Users\Eden_\AppData\Local\Temp\tmpxaql9nw9'
  cwd: C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn
  Preparing editable metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip is available: 23.2.1 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
```
### Versions

```shell
python : '3.12.7 (tags/v3.12.7:0b05ead, Oct  1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]'
scikit-learn: the latest source code. Unable to obtain the latest source code due to installation issues.
```

COMMENT:
@jeremiedbb might have an idea here. I don't have/use windows. If you're trying to contribute to the project from windows, we strongly recommend using WSL2.

It might also be an issue with `pip` since yours is old.

Labels: Documentation, Build / CI
issue in building from source with Windows64 Python 3.12.7

### Describe the bug

I am currently following the guide on [building from source](https://scikit-learn.org/dev/developers/advanced_installation.html) to create an editable build of scikit-learn. However, I encountered some errors during the process. Any help is highly appriciated.

### Steps/Code to Reproduce
```
pip install wheel numpy scipy cython meson-python ninja
$env:DISTUTILS_USE_SDK = "1"  
& "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
pip install --editable . --verbose --no-build-isolation --config-settings editable-verbose=true 
```

### Expected Results

No error is thrown.

### Actual Results
```
[146/251] Compiling C object sklearn/_loss/_loss.cp312-win_amd64.pyd.p/meson-generated_sklearn__loss__loss.pyx.c.obj
  ninja: build stopped: subcommand failed.
  Activating VS 17.11.2
  INFO: automatically activated MSVC compiler environment
  INFO: autodetecting backend as ninja
  INFO: calculating backend command to run: C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv/Scripts\ninja.EXE
  error: subprocess-exited-with-error

  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv\Scripts\python.exe' 'C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py' prepare_metadata_for_build_editable 'C:\Users\Eden_\AppData\Local\Temp\tmpxaql9nw9'
  cwd: C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn
  Preparing editable metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip is available: 23.2.1 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
```
### Versions

```shell
python : '3.12.7 (tags/v3.12.7:0b05ead, Oct  1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]'
scikit-learn: the latest source code. Unable to obtain the latest source code due to installation issues.
```

COMMENT:
> It might also be an issue with `pip` since yours is old.

I've upgrade the `pip` and rebuild it, but get same error.

Labels: Documentation, Build / CI
issue in building from source with Windows64 Python 3.12.7

### Describe the bug

I am currently following the guide on [building from source](https://scikit-learn.org/dev/developers/advanced_installation.html) to create an editable build of scikit-learn. However, I encountered some errors during the process. Any help is highly appriciated.

### Steps/Code to Reproduce
```
pip install wheel numpy scipy cython meson-python ninja
$env:DISTUTILS_USE_SDK = "1"  
& "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
pip install --editable . --verbose --no-build-isolation --config-settings editable-verbose=true 
```

### Expected Results

No error is thrown.

### Actual Results
```
[146/251] Compiling C object sklearn/_loss/_loss.cp312-win_amd64.pyd.p/meson-generated_sklearn__loss__loss.pyx.c.obj
  ninja: build stopped: subcommand failed.
  Activating VS 17.11.2
  INFO: automatically activated MSVC compiler environment
  INFO: autodetecting backend as ninja
  INFO: calculating backend command to run: C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv/Scripts\ninja.EXE
  error: subprocess-exited-with-error

  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv\Scripts\python.exe' 'C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py' prepare_metadata_for_build_editable 'C:\Users\Eden_\AppData\Local\Temp\tmpxaql9nw9'
  cwd: C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn
  Preparing editable metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip is available: 23.2.1 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
```
### Versions

```shell
python : '3.12.7 (tags/v3.12.7:0b05ead, Oct  1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]'
scikit-learn: the latest source code. Unable to obtain the latest source code due to installation issues.
```

COMMENT:
> I've upgrade the pip and rebuild it, but get same error.

sometimes I get this error but then I restart my computer and it works. I don't know why. Use WSL

Labels: Documentation, Build / CI
issue in building from source with Windows64 Python 3.12.7

### Describe the bug

I am currently following the guide on [building from source](https://scikit-learn.org/dev/developers/advanced_installation.html) to create an editable build of scikit-learn. However, I encountered some errors during the process. Any help is highly appriciated.

### Steps/Code to Reproduce
```
pip install wheel numpy scipy cython meson-python ninja
$env:DISTUTILS_USE_SDK = "1"  
& "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
pip install --editable . --verbose --no-build-isolation --config-settings editable-verbose=true 
```

### Expected Results

No error is thrown.

### Actual Results
```
[146/251] Compiling C object sklearn/_loss/_loss.cp312-win_amd64.pyd.p/meson-generated_sklearn__loss__loss.pyx.c.obj
  ninja: build stopped: subcommand failed.
  Activating VS 17.11.2
  INFO: automatically activated MSVC compiler environment
  INFO: autodetecting backend as ninja
  INFO: calculating backend command to run: C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv/Scripts\ninja.EXE
  error: subprocess-exited-with-error

  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv\Scripts\python.exe' 'C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py' prepare_metadata_for_build_editable 'C:\Users\Eden_\AppData\Local\Temp\tmpxaql9nw9'
  cwd: C:\Users\Eden_\Desktop\Coder\MachineLearning\scikit-learn
  Preparing editable metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip is available: 23.2.1 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
```
### Versions

```shell
python : '3.12.7 (tags/v3.12.7:0b05ead, Oct  1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]'
scikit-learn: the latest source code. Unable to obtain the latest source code due to installation issues.
```

COMMENT:
Doesn't seem like we can easily reproduce this. Closing.

Labels: Documentation, Build / CI
Rename `frozen.FrozenEstimator` to `frozen.Frozen`

Looking through all our estimators, none of them have the word "Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think we can shorten the meta-estimator name to `Frozen`.

CC @adrinjalali @scikit-learn/core-devs

COMMENT:
+1

On Nov 1, 2024, 21:50, at 21:50, "Thomas J. Fan" ***@***.***> wrote:
>Looking through all our estimators, none of them have the world
>"Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think
>we can shorten the meta-estimator name to `Frozen`.
>
>CC @adrinjalali @scikit-learn/core-devs 
>
>-- 
>Reply to this email directly or view it on GitHub:
>https://github.com/scikit-learn/scikit-learn/issues/30194
>You are receiving this because you are on a team that was mentioned.
>
>Message ID: ***@***.***>

Labels: API, Blocker, RFC
Rename `frozen.FrozenEstimator` to `frozen.Frozen`

Looking through all our estimators, none of them have the word "Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think we can shorten the meta-estimator name to `Frozen`.

CC @adrinjalali @scikit-learn/core-devs

COMMENT:
I'm +0.5

On the (-) side, I find more intuitive to have `Estimator` because it qualify what get frozen.
On the (+) side, I agree with the argument of @thomasjpfan and also `Estimator` could be quite unclear to people what it means. `Classifier`, `Regressor` and `Transformer` are better well defined in this regard.

Labels: API, Blocker, RFC
Rename `frozen.FrozenEstimator` to `frozen.Frozen`

Looking through all our estimators, none of them have the word "Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think we can shorten the meta-estimator name to `Frozen`.

CC @adrinjalali @scikit-learn/core-devs

COMMENT:
I would say I'm +0.5.

Frozen comes off as an adjective describing the state of something, whereas FrozenEstimator comes off as a noun, describing an "object" that is "frozen". Though I agree that the `Estimator` part is a bit verbose

Labels: API, Blocker, RFC
Rename `frozen.FrozenEstimator` to `frozen.Frozen`

Looking through all our estimators, none of them have the word "Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think we can shorten the meta-estimator name to `Frozen`.

CC @adrinjalali @scikit-learn/core-devs

COMMENT:
My argument is similar to what @adam2392 says here.

I'm -0.5 on the proposal here. I agree we don't have many `...Estimator` pattern estimator names, but we do have a lot of `...Regressor`, `...Classifier`, `...Transformer`, or in some cases, the estimator name simply says what it does, like `StandardScaler`. So `FrozenEstimator` from that perspective makes sense to me.

Also, `Frozen`, doesn't really say what's frozen. Is it a random state? an estimator? cv splitter? Not that the others make much sense, but the name wouldn't say what it does really.

However, if there are enough people here who think the shorter name is worth it, I'm happy to go with it.

Labels: API, Blocker, RFC
Rename `frozen.FrozenEstimator` to `frozen.Frozen`

Looking through all our estimators, none of them have the word "Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think we can shorten the meta-estimator name to `Frozen`.

CC @adrinjalali @scikit-learn/core-devs

COMMENT:
How about `sklearn.frozen.Freezer`?

Labels: API, Blocker, RFC
Rename `frozen.FrozenEstimator` to `frozen.Frozen`

Looking through all our estimators, none of them have the word "Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think we can shorten the meta-estimator name to `Frozen`.

CC @adrinjalali @scikit-learn/core-devs

COMMENT:
`FrozenModel`? Everything's a "model"

Labels: API, Blocker, RFC
Rename `frozen.FrozenEstimator` to `frozen.Frozen`

Looking through all our estimators, none of them have the word "Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think we can shorten the meta-estimator name to `Frozen`.

CC @adrinjalali @scikit-learn/core-devs

COMMENT:
I agree with @adrinjalali's interpretation of this and reach the same conclusion.

I don't think it is too confusing to include the `Estimator` piece since the first subsection of the scikit-learn getting started page ([here](https://scikit-learn.org/stable/getting_started.html#fitting-and-predicting-estimator-basics)) introduces the concept of everything being an estimator.

Labels: API, Blocker, RFC
Rename `frozen.FrozenEstimator` to `frozen.Frozen`

Looking through all our estimators, none of them have the word "Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think we can shorten the meta-estimator name to `Frozen`.

CC @adrinjalali @scikit-learn/core-devs

COMMENT:
I would actually prefer `Freezer` than `Frozen` if we drop `Estimator`.

> FrozenModel? Everything's a "model"

Everything is an `Estimator` as well. I would probably raise the same critic.

Labels: API, Blocker, RFC
Rename `frozen.FrozenEstimator` to `frozen.Frozen`

Looking through all our estimators, none of them have the word "Estimator" besides `BaseEstimator` and `MetaEstimatorMixin`. I think we can shorten the meta-estimator name to `Frozen`.

CC @adrinjalali @scikit-learn/core-devs

COMMENT:
https://github.com/scikit-learn/scikit-learn/pull/30208 demonstrates the change to `Freezer`

Labels: API, Blocker, RFC