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