How Turi Create is Disrupting the Machine Learning Landscape | by Jonathan Balaban | Towards Data Science

A few months ago — Thursday, January 18 — I presented at my first Seattle meetup. This was three days after I moved my family cross-country from Chicago, so no time was wasted!
The reason? Nothing was more on my radar than the news that Apple had open-sourced Turi Create, the Machine Learning (ML) library it had come to own with the 2016 acquisition of Turi.
Bottom line: Turi Create is a Pythonic Machine Learning library that’s amazingly powerful and easy to use, and you should explore its capabilities!
First, I’d like to thank Metis, BeMyApp, and Intel for co-sponsoring the event.
This post is a summary of the meetup: what I presented, pertinent questions asked by the audience, a note on a few surprise visitors, and my thoughts on how Turi Create may evolve in the future. I’ll also share best practices, lessons learned, and ideas for my future projects with the package.
To start, I shared lessons learned in preparing the GraphLab Create environment. Keen-eyed readers may notice that GraphLab Create (henceforth GC) looks like a different product than Turi Create (TC); this difference— I was informed by the Turi team — is only skin deep, as both packages use the same core code, and the open-source variant (TC) can do basically everything GC can. Therefore, while a few procedural items may differ, general usage is quite similar.
To deeply understand how the product has evolved, I highly recommend this walkthrough by Carlos Guestrin, the founder. It’s five years old, but Guestrin touches on motivations and areas of focus during the early development years. And to understand where the package fits in the ‘stack’, here’s a common architecture:
Of note, GC and TC both run on Python 2, and the environment must be set up with specific versions of supporting libraries. As a challenge, I attempted to incorporate the new package in my main anaconda environment, but ran into version and dependency hell. So, for first-timers:
Ensure you have at least 8GB of RAM for serious work, or set up in a Virtual EnvironmentCreate a new conda environment, per setup instructionsThen, register for a license (for GC)If using TC, clone the repo to your machineTry a few exercises in the Getting Started guide
Ensure you have at least 8GB of RAM for serious work, or set up in a Virtual Environment
Create a new conda environment, per setup instructions
Then, register for a license (for GC)
If using TC, clone the repo to your machine
Try a few exercises in the Getting Started guide
Loading and managing data is very similar to Pandas:
import graphlab as gl%matplotlib inline# load data into SFrameurl = 'https://raw.githubusercontent.com/plotly/datasets/master/data.csv'df = gl.SFrame.read_csv(url)
From there, we can invoke summary stats and an interactive dashboard with the following functions:
# summary statistics for a columndf['column'].sketch_summary()# show dashboarddf.show()
You’ll then be able to quickly find specific row ranges, track more summary stats, and build interactive charts like the ones below:
Modeling looks eerily similar to SciKit-Learn, but that’s a good thing. If it ain’t broke, don’t fix it:
# load housing data and fit a linear modelurl = 'https://static.turi.com/datasets/regression/Housing.csv'x = gl.SFrame.read_csv(url)lm = gl.linear_regression.create(x, target='price')
Of note, GC auto-creates a validation ‘out of sample’ set for tracking true model performance. There are a number of clever tricks incorporated throughout that allow you to code more efficiently and get results faster. However, GC pre-selects common approaches, so you’ll need to be aware of the default arguments and assumptions per the documentation!
One common audience question related to performance compared to SciKit-Learn. If you’re fitting models or churning data using just the CPU, differences are small, and will come down to code optimization, slightly different solver approaches, etc. However, if you have a highly parallelizable task, and are running on AWS P2 or P3 instances, or you have a powerhouse Cuda setup in the office, we’re talking orders of magnitude faster with TC.
That fact alone could be the perfect reason to move your firm’s modeling to a Turi environment.
The general comparison between TC and SciKit-Learn’s Python-based ML libraries — for now — looks like this:
Open Source: Scikit-learn is an open source library with over 500 contributors and strong support
Support for Python 3: Scikit-learn supports Python 3 while Graphlab Create is only compatible with Python 2
More Algorithms: Scikit-learn has more algorithms compared to Graphlab
Graphlab Create is commercial software with dedicated 24/7 support
Scalable: Scikit-learn implementations are executed ONLY in memory. GraphLab Create is able to scale out-of-core, and many of the multi-threaded implementations take advantage of multiple cores on the machine.
GPU Support: You can install Graphlab Create with GPU Acceleration, which can make it insanely fast for certain tasks
Finally, after the talk, three of Turi’s core members — responsible for coding and development of both GC and TC — came up and introduced themselves! Now Apple employees, we had an in-depth chat about the future of the product, external market perceptions, and business model.
Amazing!
And probably a good I didn’t know they were watching me all along... ignorance is bliss.
Apple is quite serious about building out its Machine Learning (ML) capabilities, as it seeks to compete within the lucrative “big data” domain with other giants like Google and Facebook. Apple’s strategy, however, is quite different. As an organization which prides itself on customers’ data privacy, the focus firmly sits on leveraging what Apple knows about users of its products to better the general user experience, including:
Siri becoming more intelligent to predict your needs
Apple Music leveraging ML to help you discover amazing new artists
Caller ID for new numbers that call your iPhone
Using ML to predict your calorie expenditure and general activity
Differential privacy to power all of these services
We can see hints at the latest and greatest products and services — and how data science is implemented — on Apple’s regularly-updated and public-facing blog.
TC is already a worthy competitor to the Pandas and SciKit-Learn combo, with its full stack data management and modeling capabilities. It’s fast and efficient, and has certain features — like GPU acceleration — that are non-existent or early stage in SciKit-Learn. In addition, because the product is a key facet in Apple’s ML push, I expect to see deep integration with frameworks like Core ML, ARKit, and HealthKit.
Turi has functionality overlap with platforms like Tensorflow, and this overlap will likely grow within the deep learning space, given the focus and hype around models like neural networks. In fact, one of the key value-propositions of GPU acceleration is to allow faster fitting of deep models on large datasets. I also hope to see wrappers like Keras expand the ease with which data scientists modify parameters and architectures.
There’s already a quick guide on how to integrate TC into an iPhone app and deploy your ML models straight to users via the App Store. Current model offerings include the list below, but we should see more added with time:
Recommender systems
Image classification
Image similarity
Object detection
Activity classifier
Text classifier
Finally, I expect to see a strong push deeper into the Topic Modeling and NLP space over the coming years, especially as the sophistication of Siri continues.
So TC seems like an amazing platform, but the question that really matters is this:
How can Turi Create benefit my business?
If your business sells a subscription service, or licenses software, TC’s extensive suite of classification models may determine which customers are more likely to turn over, or “churn”. You can then incentivize those customers to renew, or determine if another product fits their needs.
If your firm provides a number of products or services — and you know something about your customer base — you can implement TC’s recommender system to quantify the customers’ interest and prioritize which new items you market or offer. These models power Amazon and eBay’s “recommended for you” listings, Spotify’s music playlist curation, and GrubHub’s vendor spotlights.
Finally, if you run a medical business that collects heart, brain, or activity metrics using on-body sensors, TC’s activity classifier can ingest data from devices like accelerometers, gyroscopes, thermostats, and others. The model will then predict what form of exercise, heart condition, or medical emergency may be happening. This application can extend to other domains, like cybersecurity, engineering applications, or any field where patterns are deduced from noisy data.
I’d like to recreate some of my past projects in the TC environment, as a real-world test with a vetted baseline. I’ll deploy some of this code — especially my ensemble models — to various AWS instance types in order to guage which architecture gives me the highest performance.
This year, I’m focused on applying more data science to my investment and cryptocurrency strategy, and TC is a strong contender for building a neural network or similar portfolio optimization model.
And last but not least, as a data science instructor with Metis, I’ll be looking for ways to incorporate TC in our curriculum for student exposure. Ultimate success in my book: a student builds an iOS Application centered on ML and successfully deploys it to a market of over one billion smartphone users!
How are you thinking of getting started with Turi Create? Comment below or connect with me on Twitter and LinkedIn.