Amazon SageMaker

Explore ML through open-source tools and Amazon SageMaker, including SageMaker Studio Lab, SageMaker Studio, and SageMaker Canvas.

Amazon SageMaker allows developers to use, customize, and deploy ML models. ML is considered a subfield of AI.

Launched in 2017, SageMaker has hundreds of pre-trained ML models and supports open-source ML tools such as TensorFlow, PyTorch, and Apache MXNet. Potential business use cases for ML include fraud detection, customer churn reduction, inventory optimization, and more.

To make it easier to build ML models, Amazon launched SageMaker Autopilot in 2019 and SageMaker Canvas in 2021 so that the machines can do more of the work of training ML models based on available data. In 2021, Amazon announced SageMaker Studio Lab, a free ML development environment.

SageMaker Studio Lab

To better understand SageMaker Studio Lab, let’s first consider how we might develop ML models using open-source tools. We’ll then walk through setting up a SageMaker Studio Lab account.

Using open-source ML tools

The ML development process can involve the following:

  • Preprocessing the data: Fetching data, cleaning and removing unnecessary parts, making data consistent across entries, and preparing and transforming data for training.

  • Training and evaluating the model: Choosing an algorithm to train the model, and determining the model’s accuracy.

  • Deploying the model: Allowing applications to interact with the ML model.

Free, open-source libraries are often used in ML projects. The scikit-learn library is a Python library that includes many ML algorithms and has been available since 2007. Other open-source ML tools include TensorFlow, PyTorch, and Apache MXNet.

The Python code below makes use of sklearn (scikit-learn) and a logistic regression algorithm to load an example iris dataset to train and evaluate the model. (The goal of this exercise is to classify iris flowers into one of three species based on various characteristics.) Running the code displays the predicted data, the actual data, and an accuracy score for the prediction.

Note: By using different algorithms and tools for the ML model, it may be possible to improve the accuracy score. The process of making predictions using an ML model is also known as “inference.”

Get hands-on with 1200+ tech skills courses.