I'm trying to build a Machine Learning - Image Recognition
using Create ML
in Xcode
10.1 Playground but I'm having some problems to put my data in the model.
I have a folder with images numbered from 1 to 1336 and a .csv
file with 2 columns (the image name and the image classification).
I don't know exactly how to put this in the model.
I have this until now:
import Cocoa
import CreateML
let data = try MLDataTable(contentsOf: URL(fileURLWithPath: "/Users/x/Desktop/CoreML/project/file.csv"))
let(trainingData, testingData) = data.randomSplit(by: 0.8, seed: 1)
let Classifier = try MLImageClassifier *need help here*
let evaluationMetrics = sentimentClassifier.evaluation(on: testingData)
let evaluationAccuracy = (1 - evaluationMetrics.classificationError) * 100
let metaData = MLModelMetadata(author: "x", shortDescription: "Model", version: "1.0")
try classifier.write(to: URL(fileURLWithPath: "/Users/x/Desktop/CoreML/project/XClassifier.mlmodel"))