CreateML

Nadia Ahmadian
Nerd For Tech
Published in
2 min readAug 6, 2021

--

What it allows us to do is to take data such as texts, images, or other types of files and feed it throw this framework called CreateML to create our very own coreML models which then can be incorporate into our app. This training is done directly in Xcode playground and we’ll be using the latest version of swift as well as the iOS12 API or above. After you’ve trained the model, you test it out on data it hasn’t seen before, and evaluate how well it performed the task. When the model is performing well enough, you’re ready to integrate it into your app using CoreML.

Create ML leverages the machine learning infrastructure built in to Apple products like Photos and Siri. This means your image classification and natural language models are smaller and take much less time to train.

How to gather data for training

We can easily go to www.images.google.com and we’re just gonna search for what we want and save the images that we want into a folder called training data.

The label that we gives to our folder is incredibly important because this is the label that the ml model will associate with every single image that we place into this folder and it will give this label to us essentially.

Now that we have all the images that we want for training our model we create another folder called testing data. And this folder will again contains the same subfolders with the same names but with totally different images that we haven’t shown our model yet. This testing data set is used to validate the accuracy of our model, because they are labeled the model can check what it thinks it is and then compare it with the right answer and then evaluates how accurate it was in the process of classifying it.

We don’t have to worry about images formats or sizes because createML takes care of it for us.

How to Train a Brand New Machine Learning Model

Xcode -> Open Developer Tools -> Create ML -> New Document

And choose the file path for training and testing data.

--

--

Nadia Ahmadian
Nerd For Tech

a crazy gemini who believes in magic, aliens and impossible dreams and converts coffee into iOS apps and soon web apps