Created
February 3, 2019 21:07
-
-
Save Shashikant86/4f0fec0f1d8985b7854243271e4e30b4 to your computer and use it in GitHub Desktop.
CreateML Swift Script
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
import Foundation | |
import CreateML | |
let training = URL(fileURLWithPath: "/tmp/ml/data-applenews/training") | |
let testing = URL(fileURLWithPath: "/tmp/ml/data-applenews/training") | |
let model = try MLImageClassifier(trainingData: .labeledDirectories(at: training)) | |
let evaluation = model.evaluation(on: .labeledDirectories(at: testing)) | |
try model.write(to: URL(fileURLWithPath: "/tmp/ml/data-applenews/applemews.mlmodel")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment