The AI/ML Development Lifecycle & MLOps: Pipeline, Models & Metrics
The AI/ML development lifecycle is the repeatable set of stages that turn raw data into a working, monitored model: you collect data, prepare it, train a model, evaluate and tune it, deploy it, then monitor and retrain it as the world changes. For the AIF-C01 exam you are not asked to build these pipelines — you recognize their stages, name the AWS service or feature that fits each one, and read the metrics that say whether a model is any good and worth running. This lesson walks the pipeline in order, compares the three ways to source a foundation model, weighs managed against self-hosted deployment, and maps the AWS offerings — from Amazon SageMaker AI and Amazon Bedrock to Amazon Q, Amazon Quick and Kiro — to the jobs they do. It then covers MLOps (experiment tracking, automated pipelines, technical debt, production readiness, monitoring and retraining) and defines the model metrics (accuracy, precision, recall, F1 score) and business metrics (cost per user, development cost, customer feedback, ROI) used to judge a model. Learn the pipeline as a single story and most Task 1.3 questions answer themselves.
On this page9 sections
- The AI/ML Pipeline, Stage by Stage
- Where Models Come From: Build vs Buy
- Running a Model in Production: Managed API vs Self-Hosted
- AWS Services for Each Pipeline Stage
- MLOps: Making ML Repeatable and Production-Ready
- Monitoring and Retraining: Drift vs Other Problems
- Reading Model Metrics: Accuracy, Precision, Recall, and F1
- Business Metrics: Is the Model Worth It?
- Worked Example: A Fraud-Detection Pipeline
- Describe the stages of an AI/ML pipeline in order, explain what each stage contributes, and place a described activity in the stage that owns it.
- Compare the three sources of a foundation model — a provider's managed FM, an open-source pre-trained model, and a custom-trained model — along the build-versus-buy spectrum.
- Weigh a managed API service against a self-hosted API for putting a model into production.
- Match each pipeline stage to the AWS service or feature that supports it, and tell Amazon SageMaker AI, Amazon Bedrock, Amazon Q, Amazon Quick and Kiro apart.
- Explain core MLOps concepts — experiment tracking, automated pipelines, technical debt, production readiness, model monitoring and retraining.
- Distinguish drift from overfitting, bad labels and operational problems such as latency, and choose the right fix for each.
- Define accuracy, precision, recall, and F1 score, choose the right metric for a given business risk, and judge a model with business metrics such as per-unit ROI.
The AI/ML Pipeline, Stage by Stage
An AI/ML pipeline is the ordered set of steps that carries a problem from raw data to a running model that keeps earning its keep. The exam wants you to name the stages and know what each one does, not to implement them. The order matters, because each stage depends on the output of the one before it.
| Stage | What happens |
|---|---|
| Data collection | Gather raw data from sources such as databases, logs, files, or sensors, label examples where the task needs labels, and land it all in one central store. |
| Data preparation | Explore the data (exploratory data analysis), clean errors and duplicates, fill in (impute) missing values, and shape raw fields into useful inputs such as "purchases in the last 30 days" (feature engineering). |
| Model training | Feed prepared data to an algorithm so it learns the patterns that map inputs to the desired output. |
| Evaluation and tuning | Test the model on held-back data, measure its metrics, and adjust settings (hyperparameter tuning) to improve results. |
| Deployment | Make the trained model available to applications, usually behind an API that returns predictions. |
| Monitoring | Watch the live model for errors, slow responses, and prediction quality that drops as real-world data changes. |
| Retraining | Refresh the model on newer data when monitoring shows its performance decaying, evaluate the new version, then redeploy it. |
Where labeling sits varies by source. AWS's Well-Architected Machine Learning Lens groups labeling with data collection (label, ingest, aggregate), while many textbooks file it under preparation. Either way, labeling happens before training, and the activities that unambiguously belong to preparation are cleaning, de-duplicating, imputing missing values and engineering features.
Notice that the pipeline is a loop, not a line: monitoring feeds retraining, and a retrained model goes back through evaluation before deployment — you never ship a new version you have not tested. A model is never finished the day it ships. When a question describes a symptom — messy inputs, poor test scores, a live model going stale — map it to the stage that owns that work.
Where Models Come From: Build vs Buy
You do not always train a model from scratch. For generative AI in particular, the exam expects you to know three sources of a foundation model (FM), which sit on a spectrum from buy to build.
- Use a provider's managed FM. A cloud provider hosts large, ready-trained models and lets you call them through an API. This is the fastest, lowest-effort option — you write no training code and run no servers. On AWS,
Amazon Bedrockis the managed FM service. - Adapt an open-source pre-trained model. Many capable models are published openly with their weights. You download one that someone else already pre-trained, inspect and fine-tune it on your own data, and run it in an environment you control — even moving it between clouds. You skip the months of pre-training, but you take on the work of hosting, scaling, patching and maintaining it.
- Train a custom model. You build and train a model on your own data, either from scratch or by heavily adapting a base model. This gives the most control and the tightest fit to your problem, but it demands the most data, expertise, time, and cost.
The trade-off is consistent: moving from buy toward build increases control and customization but also increases cost, effort, and required expertise. A startup validating an idea leans toward a managed FM; an organization with unique data, strict requirements, and a data-science team may justify training its own. The exam rewards matching the source to the situation, not always picking the most powerful option.
Running a Model in Production: Managed API vs Self-Hosted
Once you have a model, you must make it available to applications. There are two broad methods, and the exam frames the choice as operational overhead versus control.
A managed API service means the provider hosts the model and exposes it as an endpoint you simply call. You send input, you get a prediction back, and you never touch servers, scaling, patching, or capacity planning. Amazon Bedrock is the classic example for foundation models. The upside is low operational overhead and fast time to value; the trade-off is less control over the underlying infrastructure and model internals, plus usage-based pricing.
A self-hosted API means you deploy the model onto infrastructure you manage and expose your own endpoint. You choose the hardware, control the environment, can keep everything inside your own network, and can customize the model freely. The cost is that you now own the operational burden — provisioning, scaling, security patching, availability, and monitoring all fall to you. Amazon SageMaker AI sits between these poles: it hosts models on managed endpoints, so you keep more control than a pure API while offloading much of the undifferentiated infrastructure work.
The rule of thumb the exam tests: choose a managed API when speed and low maintenance matter most, and self-hosting when you need maximum control, customization, or data isolation and have the team to run it.
AWS Services for Each Pipeline Stage
At this exam's recognition level you should be able to point at a pipeline stage and name a fitting AWS service or feature. You are not expected to configure them.
| Pipeline stage | AWS service or feature |
|---|---|
| Data storage and collection | Amazon S3 as the central data store (data lake) for raw data in any format |
| Data labeling | SageMaker Ground Truth to label training examples, with human labelers and automation |
| Data preparation | SageMaker Data Wrangler to explore, clean and transform data and engineer features |
| Feature management | SageMaker Feature Store to define features once and serve the same values to training and to live inference |
| Model building, training, tuning, deployment | Amazon SageMaker AI, the end-to-end service to build, train, tune and host ML models on endpoints |
| Model versioning | SageMaker Model Registry to catalogue each model version and its approval status |
| Monitoring | SageMaker Model Monitor to compare live data and prediction quality against a baseline and raise alerts |
| Managed foundation models | Amazon Bedrock, foundation models from several providers via one API, no infrastructure to manage |
Why Amazon S3 is the data lake
Amazon S3 holds virtually unlimited data of any format — logs, images, CSV exports, Parquet — durably and cheaply, and training jobs read from it directly. The near-misses each fail one requirement: S3 Glacier storage classes are archive tiers built for rarely accessed data, with retrieval fees and (for the colder classes) retrieval delays, so they suit old datasets you must keep, not data training jobs read often. Amazon DynamoDB and Amazon RDS are databases for an application's structured records and transactions; they are not built to hold large volumes of images or mixed raw files for bulk reading.
Feature Store: the same values for training and inference
When two teams each compute "90-day spend" in their own code, the value a model learned from in training can differ from the value computed at prediction time — a training/serving mismatch that quietly degrades predictions. SageMaker Feature Store fixes this by defining each feature once and serving it from two stores: an offline store that keeps the history used to build training datasets, and an online store that returns the latest values with low latency to a live model. Data Wrangler prepares data; Ground Truth labels it; Feature Store shares and serves the finished features.
SageMaker AI vs Amazon Bedrock
The two anchors to memorize are SageMaker AI for the build-train-deploy lifecycle of your own models and Bedrock for calling ready-made foundation models through a serverless API. The boundary has one subtlety: SageMaker AI can also host foundation models — SageMaker JumpStart lets you pick a pre-trained or open model, fine-tune it, and deploy it to a SageMaker endpoint whose instance type and scaling you choose and pay for. So "use a foundation model" alone does not mean Bedrock; "use a foundation model with no infrastructure to provision" does, while "host and control the endpoint yourself" points to SageMaker AI.
AI productivity tools: Amazon Q, Amazon Quick and Kiro
These three are assistants you use, not places where you build or train a model. Tell them apart by the user they serve.
| Offering | Who uses it | What it does |
|---|---|---|
| Amazon Q Developer | Developers and IT/operations staff working on AWS | Generative-AI assistant in the AWS Management Console: answers questions about your AWS resources and helps troubleshoot errors. AWS is moving its IDE and command-line coding help to Kiro |
| Amazon Q Business | Employees across an organization | Answers questions and completes tasks over the company's own content and systems, respecting existing access permissions |
| Amazon Quick | Business users and teams | An agentic AI workspace: researches across business data and public sources, produces insights and reports, builds simple apps and automates workflows |
| Kiro | Software engineers | An agentic development environment with a spec-driven flow: it turns a prompt into requirements, a design and a list of tasks, then helps write the code and tests |
In short: Q Developer helps people who build and run AWS workloads understand their AWS resources; Q Business serves employees over company knowledge; Amazon Quick serves business teams who research, analyse data and automate work; Kiro serves engineers who turn feature ideas into specifications and code. None of them stores training data — that job belongs to Amazon S3.
MLOps: Making ML Repeatable and Production-Ready
MLOps (machine learning operations) applies the discipline of software operations to the ML lifecycle. Its goal is to move a model from a one-off experiment on someone's laptop to a reliable, maintainable production system. The exam tests the concepts, not the tooling.
- Experimentation. Data scientists try many datasets, algorithms, and settings. MLOps tracks each experiment — data version, code, parameters, metrics — so results are reproducible and comparable.
- Repeatable, automated processes. Data prep, training, evaluation and deployment run as automated pipelines rather than by hand, so the same inputs reliably produce the same outputs.
- Scalable systems. The infrastructure must handle growing data volumes and prediction traffic without breaking.
- Managing technical debt. ML systems accumulate hidden complexity that works today but makes every future change risky (examples below).
- Production readiness. A model is production-ready only when it is reliable, monitored, secure, and can be updated — and rolled back — safely.
Speed and tuning are not MLOps. Making training faster or squeezing a little more out of a test score — for example, with bigger GPU instances — does not make the work reproducible or tell you when a live model fails. Only versioned data, code and models, run through automated pipelines and watched by monitoring, fix reproducibility.
What ML technical debt looks like
- Brittle data dependencies: a model silently relies on an upstream table or export whose format can change without warning.
- Undocumented manual steps: one person exports a file by hand and runs a notebook nobody else understands, so the process cannot be repeated if they are away.
- Unversioned models and data: nobody can say which model file is live, what data trained it, or how to rebuild it.
- Duplicated feature code: the same feature calculated differently in several places, drifting apart over time.
None of these break anything on day one — that is what makes them debt. The repayment is automation (pipelines instead of hand steps) and versioning (of data, code and models).
Making a model production-ready
A good test score is necessary but not sufficient. Before go-live a team needs:
- Versioned releases with rollback. Register every model build in a model registry (on AWS, SageMaker Model Registry) before deploying it, so you always know which version is serving and can redeploy an earlier one without retraining.
- Monitoring against a baseline. Capture what normal input data and prediction quality look like at launch, track the live model against that baseline, and raise alerts when it slips — SageMaker Model Monitor does this on AWS — so a decline is caught before customers complain.
- Security and scaling appropriate to the traffic and data the model will handle.
A better test score, however it is obtained, does not make a release traceable or tell you when the live model starts to slip; versioning and monitoring do.
Monitoring and Retraining: Drift vs Other Problems
Model monitoring watches a live model for two different kinds of trouble, and the fix depends on which one you see. Retraining is the fix for decaying prediction quality; it is not a fix for every problem.
| Symptom | Likely cause | When it shows up | Fix |
|---|---|---|---|
| Prediction quality slides gradually after a good launch; code and infrastructure unchanged | Drift — live data no longer resembles the training data (new fraud tactics, new products, changing tastes) | Months after deployment | Retrain on recent data, evaluate, redeploy |
| Great on training data, poor on held-out test data | Overfitting — the model memorized its training set | At evaluation, before launch | Regularize, simplify, or add training data |
| Consistently poor or odd predictions from the start | Bad labels or flawed training data | At evaluation, before launch | Fix the labels and retrain |
| Slow responses or timeouts when traffic spikes; predictions still good | Operational capacity — the endpoint is under-provisioned | Whenever load rises | Scale the endpoint (more or larger instances, auto scaling) |
The diagnostic clue is timing and type. A model that passed evaluation and then gradually worsened with nothing changed in its code points to drift, because overfitting and bad labels would have shown up in testing. A latency problem is about capacity, so retraining will not help it — and scaling out will not restore a model whose quality has drifted. On AWS, SageMaker Model Monitor watches endpoints for data and model-quality drift against a baseline; endpoint latency and error metrics appear in Amazon CloudWatch. Together, monitoring and retraining are why the pipeline is a loop.
Reading Model Metrics: Accuracy, Precision, Recall, and F1
To judge a classification model you compare its predictions to the known correct answers. Four terms come from that comparison, and the exam loves to test which one fits a scenario. Picture the four possible outcomes: true positives (correctly flagged), true negatives (correctly cleared), false positives (flagged by mistake), and false negatives (missed). Every metric below is built from those counts.
| Metric | Plain-English meaning | Care about it when |
|---|---|---|
| Accuracy | Of all predictions, the share that were correct | Classes are balanced and every error costs the same |
| Precision | Of the items the model flagged, the share that were truly positive | False positives are costly |
| Recall | Of the items that were truly positive, the share the model caught | False negatives (misses) are costly |
| F1 score | The harmonic mean of precision and recall — high only when both are high | Both error types are costly, especially on imbalanced data |
A quick way not to swap the definitions: precision looks at what the model flagged ("how many of my alarms were real?"); recall looks at what was really there ("how many real cases did I catch?").
Accuracy can lie. If only 1 in 1,000 transactions is fraud, a model that predicts "never fraud" is 99.9% accurate and completely useless — the majority class dominates the count and hides that it catches nothing. That is why precision and recall matter on imbalanced problems.
The clearest way to remember precision versus recall is two examples. For a spam filter, a false positive sends a real, important email to the junk folder, which users hate — so precision matters most. For a cancer screening model, a false negative means telling a sick patient they are healthy — so recall matters most, even at the cost of a few false alarms.
Putting it together: imbalance plus two costly errors
Consider an insurer screening claims, where roughly 3% are fraudulent. Paying a fraudulent claim is expensive (a false negative), but wrongly holding up an honest customer's claim is also expensive (a false positive — complaints, churn, investigation cost). Work through the options: accuracy is out, because the 97% honest majority inflates it; precision alone would let the model flag almost nothing and miss fraud; recall alone would let it flag nearly everything and swamp honest customers. When the classes are imbalanced and both errors matter, and you want one number to compare candidate models, F1 score is the fit, because it falls sharply if either precision or recall is weak.
Business Metrics: Is the Model Worth It?
A model can score beautifully on precision and recall and still be a bad decision for the business. That is why the exam pairs technical metrics with business metrics — the numbers a leader uses to decide whether a model earns its cost.
- Cost per user (or per prediction or per interaction): what it costs to serve one unit of demand. A model that is accurate but expensive per call may not scale.
- Development cost: the time, talent, and compute spent building and training the model in the first place.
- Customer feedback: satisfaction scores, ratings, and complaints that reveal whether the model actually helps real users.
- Return on investment (ROI): the value the model generates — revenue gained or cost saved — measured against what it cost to build and run.
Model metrics tell you whether the model is good at its task; business metrics tell you whether it is worth doing.
Worked example: per-unit ROI
Compare value and cost on the same unit. Suppose each document a model classifies correctly saves $0.50 of manual handling.
| Model A | Model B | |
|---|---|---|
| Correctly handled | 95% | 90% |
| Savings per document | 0.95 × $0.50 = $0.475 | 0.90 × $0.50 = $0.45 |
| Running cost per document | $0.60 | $0.04 |
| Net per document | −$0.125 (loses money) | +$0.41 |
The more accurate model destroys value on every document, because its running cost exceeds what its extra accuracy saves. Compare value and cost on the same unit, and check any minimum quality requirement first.
Worked Example: A Fraud-Detection Pipeline
Walk one realistic system through every stage to see the lifecycle as a whole. A bank wants to flag fraudulent card transactions in real time.
Data collection: the bank lands years of past transactions — amount, location, time, merchant — in Amazon S3, each labeled fraud or legitimate. Data preparation: the team removes duplicates and errors, fills gaps, and engineers features such as "distance from the last purchase" and "transactions in the past hour," publishing them to SageMaker Feature Store so training and live scoring use identical values. Model training: using Amazon SageMaker AI, an algorithm learns the patterns that separate fraud from normal spending; each experiment's data, parameters and metrics are tracked. Evaluation and tuning: fraud is rare and both missed fraud and blocked customers are costly, so the team compares candidates on F1 score while checking recall and precision individually.
Deployment: the chosen version is registered in the model registry and hosted behind an API so the payment system can score each transaction in milliseconds. Monitoring: CloudWatch tracks latency, and Model Monitor tracks prediction quality against the launch baseline. During a holiday spike latency climbs, so the team scales the endpoint; months later, fraudsters change tactics, live transactions drift away from the training data, and recall starts to fall. Retraining: the automated pipeline refreshes the model on recent transactions, evaluates it, and redeploys it — with the previous version still in the registry for rollback. Meanwhile the business checks ROI: fraud losses prevented per transaction versus the cost of scoring it. Every Task 1.3 idea — pipeline stages, deployment method, MLOps, model metrics, and business metrics — appears in this one story.
Tip. Expect scenario questions that hand you a business situation and ask for the right metric, pipeline stage, service, or fix. When false positives are costly, the answer is precision; when misses are costly, recall; when classes are imbalanced and both errors hurt, F1. If a model that passed evaluation slowly loses quality with nothing changed, think drift and retraining — not overfitting, bad labels, or scaling, which is the fix for latency under load. Service questions hinge on the job and the effort: calling foundation models without managing infrastructure (Bedrock), building, training and hosting your own models (SageMaker AI), keeping features consistent between training and prediction (Feature Store), and which AI assistant fits which kind of user (Amazon Q Developer, Q Business, Amazon Quick, Kiro). MLOps questions reward automation, versioning, a model registry and baseline monitoring over bigger instances or more tuning, and business-metric questions can require comparing savings per use with cost per use.
- The AI/ML pipeline runs in order and loops: collect (and label) data, prepare it, train, evaluate and tune, deploy, monitor, then retrain — and a retrained model is evaluated before it is redeployed.
- Three ways to source a foundation model: use a provider's managed FM (Amazon Bedrock), adapt an open-source pre-trained model, or train a custom model — moving from least to most control, cost, and effort.
- A managed API service means low operational overhead but less control; a self-hosted API gives full control and data isolation but you run the infrastructure.
- Amazon S3 is the data lake; Ground Truth labels, Data Wrangler prepares, Feature Store serves the same feature values to training and inference, Model Registry versions models, and Model Monitor watches them.
- SageMaker AI builds, trains and hosts models (including JumpStart foundation models on endpoints you manage); Bedrock serves foundation models through one serverless API.
- Amazon Q Developer helps builders and operators on AWS, Q Business answers over company content, Amazon Quick is the agentic workspace for business users, and Kiro is the spec-driven development environment.
- MLOps means tracked experiments, automated pipelines, versioned data, code and models, rollback, and monitoring against a baseline — bigger instances and more tuning do not make work reproducible.
- Gradual quality decline after a good launch is drift (retrain); overfitting and bad labels show up at evaluation; latency under load is a capacity problem (scale the endpoint).
- Precision matters when false positives are costly; recall when misses are costly; F1 when both are and classes are imbalanced; accuracy alone misleads on imbalanced data.
- Business metrics — cost per user, development cost, customer feedback, and ROI — decide whether a model is worth running; a more accurate model can lose money per use.
Frequently asked questions
What are the stages of an AI/ML pipeline?
An AI/ML pipeline moves through data collection (including labeling, which AWS groups with collection), data preparation (cleaning, imputing missing values, and feature engineering), model training, model evaluation and tuning, deployment, monitoring, and retraining. The stages run in order because each depends on the output of the one before it, and the pipeline forms a loop: monitoring a live model reveals when its quality is dropping, which triggers retraining on newer data, evaluation of the new version, and redeployment. For the AIF-C01 exam you need to recognize each stage and what it does, not build the pipeline yourself.
What is the difference between precision and recall?
Precision is the share of the items a model flagged that were truly positive, so it matters most when false positives are costly — for example, a spam filter that must not send real email to the junk folder. Recall is the share of all truly positive items that the model actually caught, so it matters most when you must catch every true case — for example, a cancer screening model where missing a sick patient is dangerous. The F1 score combines both into one balanced number for when both kinds of error hurt.
What is the difference between a managed API and a self-hosted model in production?
With a managed API service, the provider hosts the model and you simply call an endpoint; you get low operational overhead and fast time to value but less control over the infrastructure. Amazon Bedrock is the AWS example for foundation models. With a self-hosted API, you deploy the model onto infrastructure you manage, gaining full control and customization and the ability to keep data inside your own network, but you take on provisioning, scaling, patching, and monitoring. Choose managed for speed and low maintenance, self-hosted for maximum control.
Why do machine learning models need to be retrained?
Models are trained on a snapshot of past data, but the real world keeps changing — new fraud tactics, shifting customer behavior, new products. Over time the live data drifts away from the training data, and the model's quality gradually falls; this is called drift or model decay. Monitoring against a baseline (on AWS, SageMaker Model Monitor) detects the decline, and retraining fixes it by refreshing the model on newer data, evaluating it, and redeploying it. Retraining does not fix everything: overfitting and bad labels show up at evaluation, and slow responses under load are fixed by scaling the endpoint.
What is the difference between Amazon SageMaker AI and Amazon Bedrock?
Amazon SageMaker AI is the end-to-end service for the machine learning lifecycle: you use it to build, train, tune, and host your own models on endpoints, with features such as Ground Truth for data labeling, Data Wrangler for data preparation, Feature Store for features, Model Registry for versions, and Model Monitor for live monitoring. It can also deploy foundation models from SageMaker JumpStart onto endpoints you choose and manage. Amazon Bedrock is a managed service that gives you ready-trained foundation models from several providers through a single API, with no infrastructure to provision. Use SageMaker AI to build, train or control hosting; use Bedrock to consume foundation models serverlessly.
What is the difference between Amazon Q, Amazon Quick and Kiro?
All three are AI productivity tools, not services for training models. Amazon Q Developer is a generative-AI assistant for developers and IT staff in the AWS Management Console, where it answers questions about your AWS resources and helps troubleshoot (AWS is moving Q Developer's IDE and command-line coding help to Kiro); Amazon Q Business answers employees' questions over company content. Amazon Quick is an agentic AI workspace for business users that researches business data, produces insights and reports, and automates workflows. Kiro is an agentic development environment for software engineers that turns a prompt into requirements, a design and tasks, then helps write the code and tests.
What does it mean for a machine learning model to be production-ready?
A production-ready model is reliable, secure, monitored, and safely updatable — not just accurate on a test set. In practice that means it was built by an automated, repeatable pipeline from versioned data and code; each build is registered in a model registry (such as SageMaker Model Registry) so you know which version is serving and can roll back to an earlier one without retraining; and its live prediction quality is tracked against a baseline with alerts, so a decline is caught before customers notice. Undocumented manual steps and unversioned model files are technical debt that blocks production readiness.
Source
This lesson covers the "Fundamentals of AI and ML" domain of the official AIF-C01 exam guide. Vendors revise their guides — check the source for the current version.
- AWS Certified AI Practitioner (AIF-C01) exam guide — Amazon Web Services
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.