Last active
July 4, 2018 09:22
-
-
Save oem/82631d970c4a955e95775b3cbc1a264f to your computer and use it in GitHub Desktop.
trains the beer classifier
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
import turicreate as tc | |
import os | |
current_dir = os.path.dirname(__file__) | |
data = tc.SFrame(os.path.join(current_dir, 'data/processed/beers.sframe')) | |
train, test = data.random_split(0.8) | |
model = tc.image_classifier.create(train, target='label', max_iterations=100) | |
# evaluate on test data | |
print(model.evaluate(test)) | |
# persist the model | |
model.export_coreml(os.path.join( | |
current_dir, 'model/BeerClassifier.mlmodel')) | |
model.save(os.path.join(current_dir, 'model/v1.model')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment