Last active
June 8, 2019 10:04
-
-
Save avisheknag17/e345c6cc0f65fefa07b8f51124d987ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.pipeline import Pipeline | |
pl_train_x, pl_test_x, pl_train_y, pl_test_y = train_test_split(df_x, df_y) | |
pl_model = Pipeline([('scaler', StandardScaler()), | |
('pca', PCA(0.95)), | |
('regr', ElasticNetCV(cv=5, alphas=[0.1, 0.3, 0.5, 0.7, 1.0]))]) | |
pl_model.fit(pl_train_x, pl_train_y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment