Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Created April 5, 2018 21:52
Show Gist options
  • Save sergiolucero/ee85de75ff1b2a24881facce7994faff to your computer and use it in GitHub Desktop.
Save sergiolucero/ee85de75ff1b2a24881facce7994faff to your computer and use it in GitHub Desktop.
Boston Teapot Party!
from tpot import TPOTRegressor
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
housing = load_boston()
X_train, X_test, y_train, y_test = train_test_split(housing.data, housing.target,
train_size=0.75, test_size=0.25)
tpot = TPOTRegressor(generations=5, population_size=50, verbosity=2)
tpot.fit(X_train, y_train)
print(tpot.score(X_test, y_test))
tpot.export('tpot_boston_pipeline.py')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment