Python偏最小二乘回归(PLSR)测试

scikit learn机器学习包中包含了偏最小二乘回归,所以可以调用对应的函数来实现

class sklearn.cross_decomposition.PLSRegression(n_components=2scale=Truemax_iter=500tol=1e-06copy=True)

参数信息:

Parameters:

n_components : int, (default 2)

Number of components to keep.(要保留的主成分数量,默认为2)

scale : boolean, (default True)

whether to scale the data (是否归一化数据,默认为是)

max_iter : an integer, (default 500)

the maximum number of iterations of the NIPALS inner loop (used only if algorithm=”nipals”) (使用NIPALS时的最大迭代次数)

tol : non-negative real

Tolerance used in the iterative algorithm default 1e-06. (迭代截止条件)

copy : boolean, default True

Whether the deflation should be done on a copy. Let the default value to True unless you don’t care about side effect

Attributes:

x_weights_ : array, [p, n_components]

X block weights vectors.

y_weights_ : array, [q, n_components]

Y block weights vectors.

x_loadings_ : array, [p, n_components]

X block loadings vectors.

y_loadings_ : array, [q, n_components]

Y block loadings vectors.

x_scores_ : array, [n_samples, n_components]

X scores.

y_scores_ : array, [n_samples, n_components]

Y scores.

x_rotations_ : array, [p, n_components]

X block to latents rotations.

y_rotations_ : array, [q, n_components]

Y block to latents rotations.

coef_: array, [p, q] :

The coefficients of the linear model: Y = X coef_ + Err

n_iter_ : array-like

Number of iterations of the NIPALS inner loop for each component.

Notes

Matrices:

T: x_scores_
U: y_scores_
W: x_weights_
C: y_weights_
P: x_loadings_
Q: y_loadings__

Are computed such that:

X = T P.T + Err and Y = U Q.T + Err
T[:, k] = Xk W[:, k] for k in range(n_components)
U[:, k] = Yk C[:, k] for k in range(n_components)
x_rotations_ = W (P.T W)^(-1)
y_rotations_ = C (Q.T C)^(-1)
</
  • 8
    点赞
  • 103
    收藏
    觉得还不错? 一键收藏
  • 14
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值