Tôi thường nhận được PCA
tải trọng như thế này:Bắt mô hình thuộc tính từ scikit-học đường ống
pca = PCA(n_components=2)
X_t = pca.fit(X).transform(X)
loadings = pca.components_
Nếu tôi chạy PCA
sử dụng một pipline scikit-learn
...
from sklearn.pipeline import Pipeline
pipeline = Pipeline(steps=[
('scaling',StandardScaler()),
('pca',PCA(n_components=2))
])
X_t=pipeline.fit_transform(X)
... là nó có thể để có được tải?
Đơn giản chỉ cần cố gắng loadings = pipeline.components_
thất bại:
AttributeError: 'Pipeline' object has no attribute 'components_'
Cảm ơn!
(. Cũng quan tâm đến giải nén các thuộc tính như coef_
từ đường ống dẫn học tập)
Phải, cảm ơn. Không phải vậy (sử dụng 'named_steps') trong [doc here] (http://scikit-learn.org/dev/modules/generated/sklearn.pipeline.Pipeline.html#sklearn.pipeline.Pipeline). Đánh giá cao điều đó. – lmart999
tuyệt vời :) cảm ơn – AbtPst