Create ML Tutorial: Getting Started

In this Create ML tutorial, you’ll learn how to transfer your learning to Turi Create, and gain familiarity with machine learning toolsets and terminology. No math needed! By Audrey Tam.

Leave a rating/review
Download materials
Save for later
Share
You are currently viewing page 5 of 5 of this article. Click here to view the first page.

Querying the Model

When the model is ready, run these lines:

query_results = model.query(reference_data[0:10], k=10)
query_results.head()

You’re passing an array that contains the first 10 reference_data images, asking for 10 similar images for each, then showing the first 10 rows of query_results.

Suppose you want to find similar images for the 10th image. First, see what it is:

reference_data[9]['image'].show()

The loading order of images is non-deterministic, so your 10th image is probably something different. What matters is that it should look like the output of the next cell.

So run these lines:

similar_rows = query_results[query_results['query_label'] == 9]['reference_label']
reference_data.filter_by(similar_rows, 'id').explore()

The target image is actually the first image returned. The other images show cats that look similar and/or are positioned in a similar way.

Congratulations! You’ve just built an image similarity model in Python! And your Mac didn’t explode ;]. Hopefully, you’ll try out other Turi Create examples on your own data.

Shutting Down

Log out of the jupyter browser windows.

In the Terminal window where the jupyter server is running, press Control-C-C to stop the server.

If your command line prompt starts with (turienv), enter this command to exit:

source deactivate

If you really don’t want to keep Anaconda, enter this command:

rm -rf ~/anaconda3

Where To Go From Here?

The finished Turi Create notebook and iOS project are in the finished folder of this tutorial’s materials. Use the Download Materials button at the top or bottom of this tutorial.

You’re now well-equipped to experiment with datasets in Create ML, and hopefully you’ll continue learning about Turi Create.

Explore Create ML and its documentation, but also spend some time browsing the Turi Create User Guide, even if you don’t want to write Python. The Turi Create How it works documentation is impressively informative and mostly math-free. To find out even more, follow their academic reference links.

And here are some other resources and further reading to deepen your own learning:

Our Tutorials

This tutorial is just the latest in a series of ML tutorials from your favorite how-to site. And yes, there will be more!

ML Community

I hope you enjoyed this Create ML tutorial. Please join the discussion below if you have any questions or comments. And especially tell us what you do with Create ML and Turi Create!