Created
November 10, 2017 04:19
-
-
Save dyerrington/c387d811ac16eb92f9d407ab25d7a8d4 to your computer and use it in GitHub Desktop.
Just a basic example of loading a baseline Lasso model without validation. Putting this here for students who just need to load up the Boston Housing dataset and start building a basic regression pipeline.
This file contains 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.linear_model import ElasticNetCV | |
from sklearn.datasets import load_boston | |
data = load_boston() | |
df = pd.DataFrame(data['data'], columns=data['feature_names']) | |
X, y = df, data['target'] | |
elastic = ElasticNetCV(cv=5) | |
model = elastic.fit(X, y ) | |
pd.DataFrame(model.mse_path_).plot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment