Skip to content

Instantly share code, notes, and snippets.

@WashingtonGold
Created September 11, 2020 17:09
Show Gist options
  • Save WashingtonGold/946bb8d75ee273bab36d5881ef2b15fe to your computer and use it in GitHub Desktop.
Save WashingtonGold/946bb8d75ee273bab36d5881ef2b15fe to your computer and use it in GitHub Desktop.
import tpot
pipeline_optimizer = tpot.TPOTClassifier(generations=5, #number of iterations to run the training
population_size=20, #number of individuals to train
cv=5) #number of folds in StratifiedKFold
pipeline_optimizer.fit(X_train, y_train) #fit the pipeline optimizer - can take a long time
print(pipeline_optimizer.score(X_test, y_test)) #print scoring for the pipeline
pipeline_optimizer.export('tpot_exported_pipeline.py') #export the pipeline - in Python code!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment