-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Name of a class impacts the value of its __metadata_request__* variables #28430
Copy link
Copy link
Closed
Labels
Description
Describe the bug
The metadata request of an object are dependent on its name.
Basically identical class can have different behaviours when calling class()._get_metadata_request()) if they have different name.
Steps/Code to Reproduce
from sklearn.model_selection import GroupKFold
class class_1(GroupKFold):
__metadata_request__split = {"groups": "sample_domain"}
class Class_1(GroupKFold):
__metadata_request__split = {"groups": "sample_domain"}
print(class_1()._get_metadata_request())
print(Class_1()._get_metadata_request())
Expected Results
{'split': {'groups': 'sample_domain'}}
{'split': {'groups': 'sample_domain'}}
Actual Results
{'split': {'groups': 'sample_domain'}}
{'split': {'groups': True}}
Versions
System:
python: 3.9.18 (main, Nov 2 2023, 16:52:00) [Clang 14.0.0 (clang-1400.0.29.202)]
executable: /Users/yanislalou/Documents/CMAP/scikit-learn/sklearn-env/bin/python
machine: macOS-12.7.2-arm64-arm-64bit
Python dependencies:
sklearn: 1.5.dev0
pip: 23.3.1
setuptools: 68.2.2
numpy: 1.26.4
scipy: 1.12.0
Cython: 3.0.8
pandas: None
matplotlib: None
joblib: 1.3.2
threadpoolctl: 3.3.0
Built with OpenMP: False
threadpoolctl info:
user_api: blas
internal_api: openblas
num_threads: 8
prefix: libopenblas
filepath: /Users/yanislalou/Documents/CMAP/scikit-learn/sklearn-env/lib/python3.9/site-packages/numpy/.dylibs/libopenblas64_.0.dylib
version: 0.3.23.dev
threading_layer: pthreads
architecture: armv8
user_api: blas
internal_api: openblas
num_threads: 8
prefix: libopenblas
filepath: /Users/yanislalou/Documents/CMAP/scikit-learn/sklearn-env/lib/python3.9/site-packages/scipy/.dylibs/libopenblas.0.dylib
version: 0.3.21.dev
threading_layer: pthreads
architecture: armv8Reactions are currently unavailable