Deploy the Core Machine Learning Models Using Turi Create on Linux

Turi Create is a Python library that is created by Apple for the easy deployment of comprehensive machine learning and data analytics algorithms. It is an open source library which allows the users to take advantage of this powerful tool free of charge. It contains implementations for both supervised and unsupervised learning techniques which include classification tasks, regression tasks, clustering algorithms, object detection tasks, and more. It also allows the users to create custom machine learning algorithms by incorporating the core machine learning and data analytics fundamentals.

Despite being made by Apple, it is available on all three major platforms which include Apple, Linux, and Windows which further increases its utility in the world of learning from abundant data. The primary advantage that Turi Create offers its users over other traditional machine learning and analytical libraries and frameworks is that its users can access the prebuilt and ready-to-use algorithms and learning models. People who are not thoroughly adept with complex machine learning and data analytics concepts can make use of this library with relative ease and accomplish their tasks without a significant amount of effort being put into learning the ins and outs of these algorithms. One of the main competitors to this library is SciKit Learn which is abundantly used in most machine learning tasks but is somewhat complex to learn and implement.

The most important prerequisite to start with Turi Create is the cursory knowledge of Python and its programming fundamentals. Turi Create allows its users to work with different forms of data including the tabular data, textual data, graphs, and more. By offering the custom data types for containers which resemble some of the most heavily used data types like DataFrames, this library makes storing and processing of data really simple and easy.

It should be noted that Turi Create is available on the following versions of Python: 2.7, 3.5, 3.6, 3.7, and 3.8. It is being worked upon to make it available for more recent versions.

Installation Guide

To start with the Turi Create installation, you need to first ensure that you are running a version of Python from the mentioned list earlier. If you are using an older or newer version, you are required to either upgrade or downgrade to a different version to be able to run the Turi Create. Otherwise, you will get the following error if you try to install it with a different version of Python than the ones that are mentioned:

Since Turi Create is a Python library package, it can only be used through Python code. Which is why, to install it, we make use of the Python package manager called “Pip”. You can also use “conda” to install this library if you are using the Anaconda platform for your Python development. For the purposes of this installation guide, we make use of Pip.

Note: It is always a good idea to install any package in an environment of its own so that it does not cause any error and issue with the other packages in the global Python package scope.

1. Run the following command in the terminal to install the Turi Create with Pip:

$ pip install turicreate


With this, Turi Create should be downloaded and installed on your Linux machine using the Pip package manager for Python.

User Guide

As mentioned previously, since Turi Create is a Python package, it can be used using Python code. To start working with Turi Create, we create a Python file (.py) or a Python notebook (.ipynb).

We start off by importing Turi Create into our working environment:

import turicreate as tc

Now that we imported Turi Create, we import a dataset to work on. This can be any dataset that fits the requirements for the types of data that Turi Create is able to work with. We use the ADNI dataset for Alzheimer’s patients. This dataset is a classic example of classification for supervised learning tasks.

data = tc.SFrame.read_csv("./12_months_joint.csv")

The SFrame keyword is the implementation of a data type that is very close to its functionality as a DataFrame. When loading the data into an SFrame from a comma separated value file, the data is stored in the form of a table with table features as column names and records as rows.

We can now split this data into the training and testing samples using the “random_split” method and specify the percentage of the data that we require in the training sample.

train_data, test_data = data.random_split(0.8)

Now that the data is processed into the training and testing samples, we can start with implementing a binary classifier on this data so that we can later test and determine the performance of our model.

binary_classifier = tc.logistic_classifier.create(train_data,target='cov')

With this, the model starts to learn and slowly converges to the most optimum solution that it is able to find. We can get a summary of the model and learning by running the following command:


We can further ask the model that we made to predict the outputs of the testing data using the following code snippet:

Predictions = binary_classifier.predict(test_data)

We can compare the predicted values with the original target values in the test_data to find out the performance of this model.

We can further use another library like Matplotlib to create the specialized performance visualizations like confusion matrices and graphs.


With many complex machine learning libraries and packages that are available to work with, it can become a tiresome and exhaustive task to implement the learning algorithms easily. Libraries like Sklearn implement most intelligent algorithms but they come with a learning curve that most people are not comfortable with. Turi Create ensures the easy implementation of most of these learning techniques without any comprehensive learning exercises. Its easy algorithmic implementation and even simpler execution make it a very easy library to recommend when it comes to machine learning and analytics. For new beginners and novice analysts, this library is the best solution for all their analytical needs.

About the author

Zeeman Memon

Hi there! I'm a Software Engineer who loves to write about tech. You can reach out to me on LinkedIn.