Book Image

Machine Learning with Amazon SageMaker Cookbook

By : Joshua Arvin Lat
Book Image

Machine Learning with Amazon SageMaker Cookbook

By: Joshua Arvin Lat

Overview of this book

Amazon SageMaker is a fully managed machine learning (ML) service that helps data scientists and ML practitioners manage ML experiments. In this book, you'll use the different capabilities and features of Amazon SageMaker to solve relevant data science and ML problems. This step-by-step guide features 80 proven recipes designed to give you the hands-on machine learning experience needed to contribute to real-world experiments and projects. You'll cover the algorithms and techniques that are commonly used when training and deploying NLP, time series forecasting, and computer vision models to solve ML problems. You'll explore various solutions for working with deep learning libraries and frameworks such as TensorFlow, PyTorch, and Hugging Face Transformers in Amazon SageMaker. You'll also learn how to use SageMaker Clarify, SageMaker Model Monitor, SageMaker Debugger, and SageMaker Experiments to debug, manage, and monitor multiple ML experiments and deployments. Moreover, you'll have a better understanding of how SageMaker Feature Store, Autopilot, and Pipelines can meet the specific needs of data science teams. By the end of this book, you'll be able to combine the different solutions you've learned as building blocks to solve real-world ML problems.
Table of Contents (11 chapters)

Preparing the datasets for image classification using the Apache MXNet Vision Datasets classes

In this recipe, we will set up the file and directory structure needed for the image classification experiments in this chapter. We will create five directories inside the tmp directory—train, validation, train_lst, validation_lst, and test. After that, we will use the Apache MXNet Vision Datasets classes to load the datasets required to train and test the image classification models in this chapter. We will perform the train-test split, store the loaded data as image files, and generate the .lst files that will be used for the training job.

Figure 8.17 – MNIST dataset

We have in Figure 8.17 a few sample image files that will be prepared in this recipe. In the recipe Training and deploying an image classifier using the built-in image classification algorithm in SageMaker, we will use these image files to train an image classifier model that can recognize...