14
我通常得到PCA
载荷这样的:获取模型从属性scikit学习管道
pca = PCA(n_components=2)
X_t = pca.fit(X).transform(X)
loadings = pca.components_
如果我使用scikit-learn
pipline运行PCA
...
from sklearn.pipeline import Pipeline
pipeline = Pipeline(steps=[
('scaling',StandardScaler()),
('pca',PCA(n_components=2))
])
X_t=pipeline.fit_transform(X)
...是有可能获得装载?
只是想loadings = pipeline.components_
失败:
AttributeError: 'Pipeline' object has no attribute 'components_'
谢谢!
(也有兴趣在借鉴管道提取像coef_
属性)
对,谢谢。没有([使用'named_steps')在[doc here](http://scikit-learn.org/dev/modules/generated/sklearn.pipeline.Pipeline.html#sklearn.pipeline.Pipeline)。感谢。 – lmart999 2015-03-03 23:52:35
真棒:)谢谢 – AbtPst 2015-12-15 19:36:20