Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SGDRegressor is not inheriting from LinearModel #31315

Open
@MarcBresson

Description

@MarcBresson

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp