AWS Certification — ML Specialty — Part 1 (Introduction)
By: Himanshu Singh
Tags: AWS, Certification, Machine Learning, Sagemaker

Steps in general Machine Learning:

We should have a Business Problem Then we should look at the feasibility of the solution and what approach to use to accomplish it, that is, either machine learning, deep learning, or reinforcement learning Next process is the collection and processing of data, which means to find the related data, integrate the data from different sources, clean the data, and, may be, normalize the data Once we have the prepared and cleaned data, we try to visualize and analyze the data to gain better insights. Finally, we can do feature engineering to find out features that can be best suited for the model. Once the above processes are done, the data can be sent to the model. Training of the model starts. We can tune the parameters in different ways to get the best performance. Lastly, the model’s performance is measured using different matrix, and then decision is made.

Given below is the diagram showcasing the flowchart of the above mentioned steps:

Credits: AWS Innovate 2018

AWS provides Sagemaker as a service for building, training, and deploying the models at one single place. Sagemaker doesn’t limit you to use its own syntax. Instead, you can use any framework that you love to work inside Sagemaker. It provides you the environment of Jupyter Notebook, which most of the Data Scientist prefer.

How to open a Jupyter Notebook Instance in Sagemaker?

First we need to login to AWS Console. Once done, click on Sagemaker from the list of all services:

AWS Management Console

then you’ll have to click on Notebook Instance:

Creating a Jupyter Notebook Instance

Now, on the top right side there will be an option to create a new instance. Click on that and a new page will open.

Creating the Instance

Give your instance a name and then directly click on create notebook instance. Leave other things as default. We will talk about different options in the future versions of this post.

It will take sometime to create the instance, and finally you will see a screen like this:

How to open the instance

Click on Open Jupyter and a new notebook will start. We can see multiple options present in notebook, for different types of coding.

Supported Platforms

The list of algorithms that we can use inside the Sagemaker is:

K-Means Clustering Principal Component Analysis Neural Topic Modelling Factorization Machines Linear Learner — Regression XGBoost Latent Dirichlet Allocation Image Classification Seq2Seq Linear learning — Classification Deep AR Forecasting BlazingText Semantic Segmentation Object Detection RandomCutForest K-Nearest Neighbour

Below is the list of Frameworks that is supported in Sagemaker:

Apache MXNet

TensorFlow

Caffe2

CNTK

PyTorch

Torch

TRAINING IN SAGEMAKER

To start training in Sagemaker, we first need to create a training job.

training job creation

Once you click on create training job, you’ll see a new page:

Suppose I want to use Logistic Regression for Classification part. For this we have an algorithm named Linear Learner. So we can select that algorithm and change the hyper-parameters, as required.

If we don’t want to use this graphic interface, and want to accomplish everything directly from the notebook, then we can follow the below approach.

In the list of examples that we have in jupyter notebook, open the linear learner mnist one.

ML examples in Sagemaker

You can see inside the notebook that each and every parameters will be defined as a code. You just need to execute it, and the training will start.

In the next section we will see the basics of Amazon ML.

***