- Notifications
You must be signed in to change notification settings - Fork25.8k
Open
Labels
Description
Describe the bug
I wanted to rely on the base classLinearModel to identify linear models, but I found out thatSGDRegressor (nor any of its sub classes) is not inheriting this class. However, SGDClassifier is (through LinearClassifierMixin).
Is there any reason forBaseSGDRegressor to not inheritLinearModel? Is it because it overloads all of LinearModel's methods?
Steps/Code to Reproduce
from sklearn.linear_model import SGDRegressor
from sklearn.linear_model._base import LinearModel
issubclass(SGDRegressor, LinearModel)
Expected Results
from sklearn.linear_model import SGDRegressor
from sklearn.linear_model._base import LinearModel
issubclass(SGDRegressor, LinearModel)
True
Actual Results
from sklearn.linear_model import SGDRegressor
from sklearn.linear_model._base import LinearModel
issubclass(SGDRegressor, LinearModel)
False
Versions
System: python: 3.10.11 (v3.10.11:7d4cc5aa85, Apr 4 2023, 19:05:19) [Clang 13.0.0 (clang-1300.0.29.30)]executable: /usr/local/bin/python3.10 machine: macOS-14.4.1-arm64-arm-64bitPython dependencies: sklearn: 1.5.0 pip: 24.2 setuptools: 74.0.0 numpy: 1.26.4 scipy: 1.13.1 Cython: 3.0.12 pandas: 1.5.3 matplotlib: 3.8.4 joblib: 1.2.0threadpoolctl: 3.5.0Built with OpenMP: Truethreadpoolctl info: user_api: blas internal_api: openblas num_threads: 8 prefix: libopenblas filepath: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/.dylibs/libopenblas64_.0.dylib version: 0.3.23.devthreading_layer: pthreads architecture: armv8 user_api: blas internal_api: openblas num_threads: 8 prefix: libopenblas filepath: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scipy/.dylibs/libopenblas.0.dylib version: 0.3.27threading_layer: pthreads architecture: neoversen1 user_api: openmp internal_api: openmp num_threads: 8 prefix: libomp filepath: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sklearn/.dylibs/libomp.dylib version: None