Talip7/scikit-learn-issues-multilabel huggingface dataset:
⚠️ CI failed on Wheel builder ⚠️

**CI is still failing on [Wheel builder](https://github.com/scikit-learn/scikit-learn/actions/runs/8320966198)** (Mar 18, 2024)

```
  ________________________ ERROR collecting test session _________________________
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  <frozen importlib._bootstrap>:1050: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1027: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:688: in _load_unlocked
      ???
  ../venv-test-arm64/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
      exec(co, module.__dict__)
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/conftest.py:17: in <module>
      from sklearn.datasets import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/__init__.py:8: in <module>
      from ._base import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/_base.py:27: in <module>
      from ..preprocessing import scale
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/__init__.py:31: in <module>
      from ._target_encoder import TargetEncoder
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/_target_encoder.py:15: in <module>
      from ._target_encoder_fast import _fit_encoding_fast, _fit_encoding_fast_auto_smooth
  sklearn/preprocessing/_target_encoder_fast.pyx:1: in init sklearn.preprocessing._target_encoder_fast
      ???
  E   ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
  =========================== short test summary info ============================
  ERROR  - ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
```

COMMENT:
Yes, sorry about that... We tried to avoid a C++ warning, but created a Cython error, please just be patient for a day or so and it'll go away.

Labels: Bug, Build / CI
⚠️ CI failed on Wheel builder ⚠️

**CI is still failing on [Wheel builder](https://github.com/scikit-learn/scikit-learn/actions/runs/8320966198)** (Mar 18, 2024)

```
  ________________________ ERROR collecting test session _________________________
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  <frozen importlib._bootstrap>:1050: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1027: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:688: in _load_unlocked
      ???
  ../venv-test-arm64/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
      exec(co, module.__dict__)
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/conftest.py:17: in <module>
      from sklearn.datasets import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/__init__.py:8: in <module>
      from ._base import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/_base.py:27: in <module>
      from ..preprocessing import scale
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/__init__.py:31: in <module>
      from ._target_encoder import TargetEncoder
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/_target_encoder.py:15: in <module>
      from ._target_encoder_fast import _fit_encoding_fast, _fit_encoding_fast_auto_smooth
  sklearn/preprocessing/_target_encoder_fast.pyx:1: in init sklearn.preprocessing._target_encoder_fast
      ???
  E   ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
  =========================== short test summary info ============================
  ERROR  - ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
```

COMMENT:
OK sound good, thanks for the answer! No worries, we can certainly be patient for a few days!

Labels: Bug, Build / CI
⚠️ CI failed on Wheel builder ⚠️

**CI is still failing on [Wheel builder](https://github.com/scikit-learn/scikit-learn/actions/runs/8320966198)** (Mar 18, 2024)

```
  ________________________ ERROR collecting test session _________________________
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  <frozen importlib._bootstrap>:1050: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1027: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:688: in _load_unlocked
      ???
  ../venv-test-arm64/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
      exec(co, module.__dict__)
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/conftest.py:17: in <module>
      from sklearn.datasets import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/__init__.py:8: in <module>
      from ._base import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/_base.py:27: in <module>
      from ..preprocessing import scale
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/__init__.py:31: in <module>
      from ._target_encoder import TargetEncoder
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/_target_encoder.py:15: in <module>
      from ._target_encoder_fast import _fit_encoding_fast, _fit_encoding_fast_auto_smooth
  sklearn/preprocessing/_target_encoder_fast.pyx:1: in init sklearn.preprocessing._target_encoder_fast
      ???
  E   ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
  =========================== short test summary info ============================
  ERROR  - ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
```

COMMENT:
## CI is no longer failing! ✅

[Successful run](https://github.com/scikit-learn/scikit-learn/actions/runs/8337222203) on Mar 19, 2024

Labels: Bug, Build / CI
⚠️ CI failed on linux_arm64_wheel ⚠️

**CI failed on [linux_arm64_wheel](https://cirrus-ci.com/build/6336497452843008)** (Mar 17, 2024)

```
  ________________________ ERROR collecting test session _________________________
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  <frozen importlib._bootstrap>:1050: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1027: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:688: in _load_unlocked
      ???
  ../venv-test-arm64/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
      exec(co, module.__dict__)
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/conftest.py:17: in <module>
      from sklearn.datasets import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/__init__.py:8: in <module>
      from ._base import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/_base.py:27: in <module>
      from ..preprocessing import scale
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/__init__.py:31: in <module>
      from ._target_encoder import TargetEncoder
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/_target_encoder.py:15: in <module>
      from ._target_encoder_fast import _fit_encoding_fast, _fit_encoding_fast_auto_smooth
  sklearn/preprocessing/_target_encoder_fast.pyx:1: in init sklearn.preprocessing._target_encoder_fast
      ???
  E   ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
  =========================== short test summary info ============================
  ERROR  - ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
```

COMMENT:
Same issue as the wheel: numpy 2 for building and numpy < 2 at runtime does not work.

Labels: Bug, Build / CI
⚠️ CI failed on linux_arm64_wheel ⚠️

**CI failed on [linux_arm64_wheel](https://cirrus-ci.com/build/6336497452843008)** (Mar 17, 2024)

```
  ________________________ ERROR collecting test session _________________________
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  <frozen importlib._bootstrap>:1050: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1027: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:688: in _load_unlocked
      ???
  ../venv-test-arm64/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
      exec(co, module.__dict__)
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/conftest.py:17: in <module>
      from sklearn.datasets import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/__init__.py:8: in <module>
      from ._base import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/_base.py:27: in <module>
      from ..preprocessing import scale
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/__init__.py:31: in <module>
      from ._target_encoder import TargetEncoder
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/_target_encoder.py:15: in <module>
      from ._target_encoder_fast import _fit_encoding_fast, _fit_encoding_fast_auto_smooth
  sklearn/preprocessing/_target_encoder_fast.pyx:1: in init sklearn.preprocessing._target_encoder_fast
      ???
  E   ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
  =========================== short test summary info ============================
  ERROR  - ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
```

COMMENT:
For reference, the non-arm64 wheel failures are tracked at: #28644.

Labels: Bug, Build / CI
⚠️ CI failed on linux_arm64_wheel ⚠️

**CI failed on [linux_arm64_wheel](https://cirrus-ci.com/build/6336497452843008)** (Mar 17, 2024)

```
  ________________________ ERROR collecting test session _________________________
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  <frozen importlib._bootstrap>:1050: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1027: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:688: in _load_unlocked
      ???
  ../venv-test-arm64/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
      exec(co, module.__dict__)
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/conftest.py:17: in <module>
      from sklearn.datasets import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/__init__.py:8: in <module>
      from ._base import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/_base.py:27: in <module>
      from ..preprocessing import scale
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/__init__.py:31: in <module>
      from ._target_encoder import TargetEncoder
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/_target_encoder.py:15: in <module>
      from ._target_encoder_fast import _fit_encoding_fast, _fit_encoding_fast_auto_smooth
  sklearn/preprocessing/_target_encoder_fast.pyx:1: in init sklearn.preprocessing._target_encoder_fast
      ???
  E   ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
  =========================== short test summary info ============================
  ERROR  - ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
```

COMMENT:
This seems like the non-arm64 issue #28644 has been fixed, so I guess this one will be closed automatically on the next Cirrus wheel Cron invocation on March 24.

Labels: Bug, Build / CI
⚠️ CI failed on linux_arm64_wheel ⚠️

**CI failed on [linux_arm64_wheel](https://cirrus-ci.com/build/6336497452843008)** (Mar 17, 2024)

```
  ________________________ ERROR collecting test session _________________________
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  <frozen importlib._bootstrap>:1050: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1027: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:688: in _load_unlocked
      ???
  ../venv-test-arm64/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
      exec(co, module.__dict__)
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/conftest.py:17: in <module>
      from sklearn.datasets import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/__init__.py:8: in <module>
      from ._base import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/_base.py:27: in <module>
      from ..preprocessing import scale
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/__init__.py:31: in <module>
      from ._target_encoder import TargetEncoder
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/_target_encoder.py:15: in <module>
      from ._target_encoder_fast import _fit_encoding_fast, _fit_encoding_fast_auto_smooth
  sklearn/preprocessing/_target_encoder_fast.pyx:1: in init sklearn.preprocessing._target_encoder_fast
      ???
  E   ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
  =========================== short test summary info ============================
  ERROR  - ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
```

COMMENT:
it was indeed (https://cirrus-ci.com/build/6117060997021696). Let's close

Labels: Bug, Build / CI
⚠️ CI failed on linux_arm64_wheel ⚠️

**CI failed on [linux_arm64_wheel](https://cirrus-ci.com/build/6336497452843008)** (Mar 17, 2024)

```
  ________________________ ERROR collecting test session _________________________
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  <frozen importlib._bootstrap>:1050: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1027: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:688: in _load_unlocked
      ???
  ../venv-test-arm64/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
      exec(co, module.__dict__)
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/conftest.py:17: in <module>
      from sklearn.datasets import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/__init__.py:8: in <module>
      from ._base import (
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/datasets/_base.py:27: in <module>
      from ..preprocessing import scale
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/__init__.py:31: in <module>
      from ._target_encoder import TargetEncoder
  ../venv-test-arm64/lib/python3.10/site-packages/sklearn/preprocessing/_target_encoder.py:15: in <module>
      from ._target_encoder_fast import _fit_encoding_fast, _fit_encoding_fast_auto_smooth
  sklearn/preprocessing/_target_encoder_fast.pyx:1: in init sklearn.preprocessing._target_encoder_fast
      ???
  E   ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
  =========================== short test summary info ============================
  ERROR  - ValueError: numpy.broadcast size changed, may indicate binary incompatibility. Expected 816 from C header, got 560 from PyObject
```

COMMENT:
I was hoping it would get closed automatically, but apparently not :wink:

Labels: Bug, Build / CI
⚠️ CI failed on Linux_nogil.pylatest_pip_nogil ⚠️

**CI failed on [Linux_nogil.pylatest_pip_nogil](https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=65083&view=logs&j=67fbb25f-e417-50be-be55-3b1e9637fce5)** (Mar 17, 2024)
- test_balance_property[75-True-SGDRegressor1]

COMMENT:
## CI is no longer failing! ✅

[Successful run](https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=65090&view=logs&j=67fbb25f-e417-50be-be55-3b1e9637fce5) on Mar 18, 2024

Labels: Needs Triage
[Bug] `sklearn.base.BaseEstimator` subclasses not decoratable

### Describe the bug

Greetings, wondrous `sklearn` maintainers. This is @leycec, the maintainer of @beartype – a third-generation hybrid static-runtime type-checker with far too many hyphens in its description. Who even knows what that means at this point. The point is that I recently [fielded an issue](https://github.com/beartype/beartype/issues/340) from [one of my favourite users](https://github.com/tvdboom) requesting support for `sklearn` "metadata routing." I don't even know what that is... *but it sounds hot.*

Sadly, @beartype cannot provide this support – because the `sklearn.base.BaseEstimator` subclass fails to support decoration at a core level. That's outside our scope of control. But first, the minimal reproducible example (MRE) exhibiting this issue:

### Steps/Code to Reproduce

```python
import sklearn
from sklearn.base import BaseEstimator

sklearn.set_config(enable_metadata_routing=True)

class A(BaseEstimator):
    def fit(self, X, y, sample_weight=None):
        return self

A.set_fit_request = A.set_fit_request
a = A().set_fit_request(sample_weight=True)
```

### Expected Results

No exception is raised.

### Actual Results

```python
Traceback (most recent call last):
  File "/home/leycec/tmp/mopy.py", line 13, in <module>
    a = A().set_fit_request(sample_weight=True)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: RequestMethod.__get__.<locals>.func() takes 0 positional arguments but 1 was given
```

### Versions

```shell
System:
    python: 3.12.2 (main, Mar  9 2024, 18:58:45) [GCC 13.2.1 20240113]
executable: /usr/bin/python3.12
   machine: Linux-6.1.67-gentoo-x86_64-AMD_Athlon-tm-_II_X2_240_Processor-with-glibc2.38

Python dependencies:
      sklearn: 1.3.2
          pip: 24.0
   setuptools: 69.1.1
        numpy: 1.26.4
        scipy: 1.12.0
       Cython: 3.0.8
       pandas: 2.2.0
   matplotlib: 3.8.3
       joblib: 1.3.2
threadpoolctl: 3.3.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 6
         prefix: libopenblas
       filepath: /usr/lib64/libopenblas_barcelonap-r0.3.25.so
        version: 0.3.25
threading_layer: openmp
   architecture: BARCELONA

       user_api: openmp
   internal_api: openmp
    num_threads: 2
         prefix: libgomp
       filepath: /usr/lib/gcc/x86_64-pc-linux-gnu/13/libgomp.so.1.0.0
        version: None
```
```

COMMENT:
@tvdboom: I summon thee. Arise from your ancestral tomb! :zombie_man:

Labels: Bug
[Bug] `sklearn.base.BaseEstimator` subclasses not decoratable

### Describe the bug

Greetings, wondrous `sklearn` maintainers. This is @leycec, the maintainer of @beartype – a third-generation hybrid static-runtime type-checker with far too many hyphens in its description. Who even knows what that means at this point. The point is that I recently [fielded an issue](https://github.com/beartype/beartype/issues/340) from [one of my favourite users](https://github.com/tvdboom) requesting support for `sklearn` "metadata routing." I don't even know what that is... *but it sounds hot.*

Sadly, @beartype cannot provide this support – because the `sklearn.base.BaseEstimator` subclass fails to support decoration at a core level. That's outside our scope of control. But first, the minimal reproducible example (MRE) exhibiting this issue:

### Steps/Code to Reproduce

```python
import sklearn
from sklearn.base import BaseEstimator

sklearn.set_config(enable_metadata_routing=True)

class A(BaseEstimator):
    def fit(self, X, y, sample_weight=None):
        return self

A.set_fit_request = A.set_fit_request
a = A().set_fit_request(sample_weight=True)
```

### Expected Results

No exception is raised.

### Actual Results

```python
Traceback (most recent call last):
  File "/home/leycec/tmp/mopy.py", line 13, in <module>
    a = A().set_fit_request(sample_weight=True)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: RequestMethod.__get__.<locals>.func() takes 0 positional arguments but 1 was given
```

### Versions

```shell
System:
    python: 3.12.2 (main, Mar  9 2024, 18:58:45) [GCC 13.2.1 20240113]
executable: /usr/bin/python3.12
   machine: Linux-6.1.67-gentoo-x86_64-AMD_Athlon-tm-_II_X2_240_Processor-with-glibc2.38

Python dependencies:
      sklearn: 1.3.2
          pip: 24.0
   setuptools: 69.1.1
        numpy: 1.26.4
        scipy: 1.12.0
       Cython: 3.0.8
       pandas: 2.2.0
   matplotlib: 3.8.3
       joblib: 1.3.2
threadpoolctl: 3.3.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 6
         prefix: libopenblas
       filepath: /usr/lib64/libopenblas_barcelonap-r0.3.25.so
        version: 0.3.25
threading_layer: openmp
   architecture: BARCELONA

       user_api: openmp
   internal_api: openmp
    num_threads: 2
         prefix: libgomp
       filepath: /usr/lib/gcc/x86_64-pc-linux-gnu/13/libgomp.so.1.0.0
        version: None
```
```

COMMENT:
pinging @adrinjalali that will be surely interested in looking at what is going on in the internals :)

Labels: Bug