Lesson 1 of 5 Choosing Modeling Approaches

Framing ML Problems and Selecting Algorithms

This lesson explains how framing a business question as an ML problem type leads to a short list of suitable algorithms, most of which SageMaker AI offers as built-in options.

Learning outcomes

After completing this lesson, you will be able to:

  • Frame a business question as a supervised, unsupervised or other problem type.
  • Map problem types to algorithms.
  • Use solution templates and pre-trained starting points.

Framing the problem

Supervised learning predicts a known label: binary or multiclass classification for categories (churn or not, ticket category) and regression for numbers (price, demand). Unsupervised learning finds structure without labels: clustering (customer segments), dimensionality reduction and anomaly detection. Other types include time-series forecasting, recommendation, ranking, NLP tasks (classification, entity extraction, translation), computer vision tasks (classification, object detection, segmentation) and generative tasks (text, images, code).

Sort into groups

Frame the problem

Exam skills 2.1.3

Decide which kind of ML problem each business question becomes.

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

Mapping problems to algorithms

For tabular classification and regression, gradient-boosted trees (XGBoost, LightGBM, CatBoost) are strong defaults; Linear Learner offers simple, interpretable models. K-Means clusters numeric data; PCA reduces dimensions; Random Cut Forest and IP Insights detect anomalies; DeepAR forecasts many related time series; Factorization Machines handle sparse user-item interactions; BlazingText classifies text and learns word vectors; the image classification, object detection and semantic segmentation algorithms cover vision. For generation, FMs are the default.

The following table maps typical business problems to problem types and algorithms.

Business questionProblem typeTypical choice
Will this customer cancel?Binary classificationXGBoost, Linear Learner
What will the house sell for?RegressionXGBoost, Linear Learner
Which customers behave alike?ClusteringK-Means
Is this transaction unusual?Anomaly detectionRandom Cut Forest
How many units next week per store?ForecastingDeepAR
Which products will this user like?RecommendationFactorization Machines, Amazon Personalize
What category is this text?Text classificationBlazingText, fine-tuned transformer, Comprehend custom classifier
Where are the defects in this photo?Object detectionObject detection algorithm, Rekognition Custom Labels
Summarize this reportGenerationFM on Amazon Bedrock

The following diagram shows the three framings and the one chosen.

Three framings of “reduce late deliveries”. Predicting whether a shipment will be late is binary classification; predicting delivery time is regression; forecasting volume per depot is forecasting. Because dispatchers can reroute shipments flagged as at risk, binary classification with XGBoost is the most actionable.
The data each framing needs differs too.
Match the pairs

Problem to algorithm

Exam skills 2.1.3 · 2.2.1

Match each problem with a SageMaker AI built-in algorithm that suits it.

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

Solution templates and starting points

Before building a model from scratch, existing starting points are worth checking. SageMaker JumpStart provides pre-trained models and example solutions for common use cases, such as demand forecasting, fraud detection and document understanding, which can be deployed directly or adapted with the organisation's own data.

For tabular data, SageMaker Canvas and SageMaker Autopilot run AutoML: they explore the data, try several algorithms and hyperparameter settings, and return a leaderboard of candidate models with their metrics. These give a strong baseline quickly and show whether a problem is worth further custom work.

Worked example

Framing a vague request

A logistics manager asks for "AI to reduce late deliveries". Several framings are possible.

FramingProblem typeData needed
Predict whether a shipment will be lateBinary classificationPast shipments labelled late or on time
Predict delivery time in hoursRegressionPast shipments with actual durations
Forecast daily volume per depot to plan staffForecastingDaily volume history per depot

Discussion shows that dispatchers can reroute shipments flagged as at risk, so binary classification with XGBoost on shipment features is the most actionable framing. The framing, not the algorithm, decided the solution.

Check yourself

What is a strong default algorithm family for tabular classification and regression?

Show answer

Gradient-boosted trees, such as XGBoost.

Exam Tips

Remember for the exam

  • Frame the business question as a problem type first.
  • Tabular classification and regression: gradient-boosted trees as a strong default.
  • Anomalies: Random Cut Forest; forecasting: DeepAR; clustering: K-Means.
  • Sparse user-item data: Factorization Machines or Amazon Personalize.
  • AutoML on tabular data: SageMaker Canvas or Autopilot.