What Is Amazon SageMaker? Machine Learning on AWS Explained
SageMaker is the big ML workshop on AWS: notebooks to explore, training jobs to learn from data, endpoints to serve predictions. Powerful — and easy to leave a meter running. Read the cost box twice.
What you'll learn in this chapter
- What SageMaker is for
- Notebooks vs training vs endpoints
- Built-in algorithms vs your container
- SageMaker vs Bedrock
- Cost and sandbox warnings
1. Everyday example
Why do we need this?
A bank wants to score loan risk from past rows. Data scientists need a notebook, a training run on bigger machines, then an API that returns a score in milliseconds.
What is it?
Amazon SageMaker is a managed set of services to build, train and deploy machine learning models on AWS without you assembling raw GPU clusters by hand.
2. Main pieces
| Piece | Does | Bill watch |
|---|---|---|
| SageMaker Studio / Notebook instances | Interactive Python/R exploration | Instance runs until you stop/delete |
| Training job | Fits model on chosen instance type | Pays while the job runs |
| Endpoint | Hosted HTTPS model for live traffic | Pays while InService — easy to forget |
| Processing / Batch transform | Offline feature jobs / bulk scores | Pays for the job duration |
3. SageMaker vs Bedrock
- SageMaker: you (or your team) train/customize models on your data; classic ML + many DL workflows.
- Bedrock: call ready foundation models via API (chat, embeddings) — no GPU training required for the base model.
- Many apps use both: Bedrock for text generation, SageMaker for a custom fraud model.
Cost & sandbox
Never leave notebook instances or endpoints running overnight in a student account. Prefer Studio with auto-shutdown where available. Delete endpoints after demos. Training on large GPU instances can cost a lot in one afternoon — start with tiny sample data and small instance types.
4. Interview angles
Q. Three pillars?
Build (notebooks), train (jobs), deploy (endpoints).
Q. Where do artifacts live?
Usually S3 model.tar.gz style outputs.
Q. Why not EC2 DIY?
SageMaker handles images, metrics, scaling patterns.
Q. Real-time vs batch?
Endpoint vs batch transform.
Q. Bedrock instead?
When a managed foundation model API is enough.
Try at home
- Open SageMaker console in ap-south-1 and list instance prices — do not create yet.
- Write one sentence: your project needs SageMaker or Bedrock?
In short
- SageMaker = build, train, deploy ML on AWS.
- Endpoints and notebooks bill while running.
- Bedrock is the better fit for many generative API apps.
- Delete lab resources the same day.
Practice Tasks
Tokyo Ramen House is a restaurant business in Tokyo. Yuki Tanaka looks after its IT and cloud work. They count money in JPY and run their AWS resources in the ap-northeast-1 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.
0 / 10
Easy List SageMaker endpoints
Why: Endpoints cost money every hour; list them to find forgotten ones.
What to do: List SageMaker endpoints.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Easy List Bedrock models
Why: See which foundation models are offered in your Region.
What to do: List the foundation models available in Amazon Bedrock.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Easy How many addresses in a /16?
Why: Picking a VPC size needs this count.
What to do: Tokyo Ramen House plans the VPC 10.27.0.0/16. How many IP addresses does it hold in total?
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy Port for SSH
Why: Security group rules need the right port.
What to do: Which TCP port must the security group open for SSH?
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy Show where you are
Why: Before you copy or delete anything, you must know which folder you are in.
What to do: Yuki Tanaka logged in to the Tokyo Ramen House server and is not sure which folder the terminal is in. Print the current folder path.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Medium Allow one Bedrock model
Why: Limit apps to the approved model so costs stay predictable.
What to do: Allow bedrock:InvokeModel on arn:aws:bedrock:ap-northeast-1::foundation-model/amazon.nova-lite-v1:0 only.
- Start with { "Version": "2012-10-17", "Statement": [ ... ] }.
- In each statement write Effect, Action and Resource.
- Give only what the task needs (least privilege).
- Use double quotes and commas correctly. Click Check answer.
Medium Detect labels in an image
Why: Rekognition names objects in a photo, e.g. to tag product images.
What to do: Detect labels in s3://tokyoramen-media/shop/p1.jpg (Bucket=tokyoramen-media, Name=shop/p1.jpg), max 10 labels.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Medium Delete an unused endpoint
Why: Deleting a test endpoint stops the hourly bill.
What to do: Delete endpoint tokyoramen-demand-forecast.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Hard Ask a model a question
Why: Converse is one API shape for many models.
What to do: Call converse on model amazon.nova-lite-v1:0 with the messages in msgs.json.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Hard Call a model endpoint
Why: Your app sends features to the endpoint and gets a prediction back.
What to do: Invoke endpoint tokyoramen-demand-forecast with body from input.csv, content type text/csv, saving the result to out.json.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Revision, comparison and interview cards
Revise this lesson in a few minutes. Save the cards on your phone or download them as PNG files. The QR code on each card opens this lesson.







More cards: Ravi Sir's Cards.