Lesson 1 of 5 Training Models with SageMaker AI

Matching SageMaker AI Built-in Algorithms to Problems

This lesson explains SageMaker AI's optimised, ready-to-use algorithm containers, which train from data in a supported format and hyperparameters, and how to match each algorithm to its problem and input requirements.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose a supervised algorithm such as XGBoost or Linear Learner.
  • Choose unsupervised, text and vision algorithms such as K-Means, Random Cut Forest and BlazingText.
  • Use managed containers for common ML libraries.

Supervised algorithms

XGBoost (gradient-boosted trees) is the strongest general choice for tabular classification and regression; it accepts CSV, LibSVM and Parquet and handles missing values. LightGBM, CatBoost (strong with categorical features), TabTransformer and AutoGluon-Tabular are further tabular options. Linear Learner trains linear and logistic regression with built-in normalisation and can optimise for precision or recall. k-NN classifies or regresses by nearest neighbours. Factorization Machines handle sparse, high-dimensional data such as click prediction and recommendations. DeepAR forecasts many related time series with a recurrent neural network and produces probabilistic forecasts.

The following diagram matches four needs of a security team to a SageMaker AI built-in algorithm for each.

The security team's four needs mapped to built-in algorithms: IP Insights for logins from addresses unusual for a user, Random Cut Forest for unusual spikes in API call volume, K-Means for grouping similar alerts, and BlazingText for classifying phishing emails from labelled examples.
Each runs on managed infrastructure with standard input formats.
Match the pairs

Supervised built-ins

Exam skills 2.2.1

Match each supervised built-in algorithm with its typical use.

Log in to try this activity Interactive activities are free with an account.

Unsupervised, text and vision algorithms

K-Means clusters data; PCA reduces dimensions; Random Cut Forest scores anomalies; IP Insights learns normal associations between users and IP addresses to flag suspicious logins. LDA and the Neural Topic Model discover topics in documents. BlazingText trains Word2Vec embeddings and fast text classifiers; Sequence-to-Sequence handles translation and summarisation; Object2Vec learns embeddings of pairs. Image classification, object detection and semantic segmentation cover computer vision with transfer learning from pre-trained networks.

The following table summarises the algorithms most often tested.

AlgorithmProblemNotes
XGBoostTabular classification / regressionCSV (target first, no header), Parquet, LibSVM
Linear LearnerLinear / logistic regressionInterpretable; recordIO-protobuf or CSV
Factorization MachinesSparse data, recommendationsrecordIO-protobuf, float32
K-MeansClusteringChoose k (elbow method)
Random Cut ForestAnomaly detectionUnsupervised anomaly scores
IP InsightsSuspicious user-IP pairsLogin and access logs
DeepARForecasting many related seriesJSON Lines; probabilistic forecasts
BlazingTextWord vectors, text classificationVery fast; GPU or CPU
Object detection / Image classificationComputer visionTransfer learning; GPU
Sort into groups

Which family?

Exam skills 2.2.1

Sort each built-in algorithm into the family it belongs to.

Log in to try this activity Interactive activities are free with an account.

Common ML libraries

Beyond its built-in algorithms, SageMaker AI provides managed containers for popular libraries, so teams can use familiar tools without building images. scikit-learn covers classic machine learning and pre-processing. XGBoost is available as an open-source framework as well as a built-in algorithm. PyTorch and TensorFlow cover deep learning, and Hugging Face Transformers covers language and vision transformer models.

These containers run the team's own training code in script mode, described in the next lesson, while SageMaker AI manages the infrastructure, data loading and artefact storage.

Worked example

Built-in algorithms for a security team

A security team describes four needs; each maps to a built-in algorithm.

NeedAlgorithm
Flag logins from IP addresses unusual for that userIP Insights
Score unusual spikes in API call volumeRandom Cut Forest
Group similar alerts to reduce noiseK-Means
Classify phishing emails from labelled examplesBlazingText (text classification)

Using built-in algorithms avoids writing or maintaining training code for these common patterns, and each runs on managed infrastructure with standard input formats.

Check yourself

Which built-in algorithm finds suspicious user and IP address pairs?

Show answer

IP Insights.

Exam Tips

Remember for the exam

  • Tabular data: XGBoost as the default built-in algorithm.
  • Anomalies: Random Cut Forest; suspicious user-IP pairs: IP Insights.
  • Many related time series: DeepAR.
  • Sparse click or recommendation data: Factorization Machines.
  • Fast text classification and word vectors: BlazingText.