什么是线性回归中的.rank_和.singular_?

发布于 2025-02-11 04:54:09 字数 613 浏览 2 评论 0 原文

我试图了解Sklearn文档中的线性回归,并且偶然发现了“属性”部分,但我不知道 .rank _ .singular _ 表示。文档中没有全面的解释。

我有一个例子

>>> from sklearn.linear_model import LinearRegression

>>> model.rank_ 
13

>>> model.singular_
array([3.54353952e+03, 1.57609582e+03, 5.69911549e+02, 3.26708222e+02,
       1.41541547e+02, 1.05019683e+02, 7.89006614e+01, 6.08655030e+01,
       3.64069654e+01, 2.13508221e+01, 1.03249311e+01, 4.64668118e+00,
       1.12979776e+00])

如何解释这些值/属性?

您也可以将我链接到与 .ranks _ 相关的数学概念的链接。 。

I am trying to understand linear regression in sklearn documentation and I stumbled upon the attributes section, and I don't know what the .rank_ and .singular_ represent. There is no comprehensive explanation in the documentation.

I have this as an example

>>> from sklearn.linear_model import LinearRegression

>>> model.rank_ 
13

>>> model.singular_
array([3.54353952e+03, 1.57609582e+03, 5.69911549e+02, 3.26708222e+02,
       1.41541547e+02, 1.05019683e+02, 7.89006614e+01, 6.08655030e+01,
       3.64069654e+01, 2.13508221e+01, 1.03249311e+01, 4.64668118e+00,
       1.12979776e+00])

How can I explain these values/attributes?

You can also leave me link/s to the math concepts related to the.ranks_ and .singular_ for me to study.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对风讲故事 2025-02-18 04:54:09

来自

    rank_ : int
        Rank of matrix `X`. Only available when `X` is dense.
    singular_ : array of shape (min(X, y),)
        Singular values of `X`. Only available when `X` is dense.

两者均通过 FRORE} .lstsq which in turn calls LAPACK:?gelsd 来自Trefethen,Lloyd N.和David Bau III。数值线性代数。卷。 50。暹罗,1997年。

From the source code:

    rank_ : int
        Rank of matrix `X`. Only available when `X` is dense.
    singular_ : array of shape (min(X, y),)
        Singular values of `X`. Only available when `X` is dense.

Both are computed by scipy.linalg.lstsq which in turn calls LAPACK:?gelsd. The singular value decomposition (SVD) is introduced in Lecture 4 from Trefethen, Lloyd N., and David Bau III. Numerical linear algebra. Vol. 50. Siam, 1997.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文