genere ho ottenere PCA
carichi come questo:Ottenere modello di attributi da scikit-learn gasdotto
pca = PCA(n_components=2)
X_t = pca.fit(X).transform(X)
loadings = pca.components_
Se corro PCA
utilizzando un pipline scikit-learn
...
from sklearn.pipeline import Pipeline
pipeline = Pipeline(steps=[
('scaling',StandardScaler()),
('pca',PCA(n_components=2))
])
X_t=pipeline.fit_transform(X)
... è possibile ottenere i carichi?
Semplicemente cercando loadings = pipeline.components_
fallisce:
AttributeError: 'Pipeline' object has no attribute 'components_'
Grazie!
(. Interessati anche a estrarre gli attributi come coef_
da tubazioni di apprendimento)
Giusto, grazie. Non quello (uso di 'named_steps') nel [doc qui] (http://scikit-learn.org/dev/modules/generated/sklearn.pipeline.Pipeline.html#sklearn.pipeline.Pipeline). Lo apprezzo. – lmart999
fantastico :) grazie – AbtPst