Let’s Get Certified
Module 04 / 15 · AI and ML fundamentals

Follow a model from data to a production decision

Plan training, deployment and monitoring around a measurable baseline and recovery path.

An impressive validation result

A team predicts overdue shipments using a table containing the final compensation amount. Its validation score is excellent but falls on live orders. What would you inspect before tuning?

Pipeline stages

Collect data, prepare features, train on one partition, validate choices and evaluate on a held-out test. Fit preprocessing only on training data. A field created after the decision can leak the answer even when partitions contain different records.

Model sources

A pretrained model starts with existing learned parameters. Review its provenance, license and limitations before reuse. Training from scratch offers control over initial training but requires suitable data, compute and ongoing operations. Open weights do not guarantee open training data.

Operating the serving layer

A managed API delegates much serving work to a provider. Self-hosting gives the team more control over model artifacts, hardware and deployment. The owner still needs authentication, observability, capacity plans, cost estimates and an incident response path in either case.

AWS tooling by stage

Use SageMaker AI to prepare, train and serve custom models, or invoke supported foundation models through Bedrock. Kiro assists software development. Amazon Quick supports business-facing insights and workflows. Select the tool for the stage and required deliverable.

Repeatable operations

Version datasets, code, configuration and model artifacts together. Track experiments and deployment approvals. Monitor input drift and actual outcome quality separately. Set criteria for investigation, retraining and rollback, then test that a known-good version can be restored.

Technical and business metrics

Precision asks how many flagged cases were correct. Recall asks how many real cases were caught. F1 combines precision and recall. Accuracy can hide failure on a rare class. Include review effort, cost per resolved case, feedback and business outcome alongside the model metric.

Work through the decision

Compare your reasoning

Trace each feature to the timestamp when it becomes available. Compensation is set after the shipment decision and can leak the answer. Rebuild features as of prediction time, partition by time where appropriate, and compare the corrected pipeline against a simple baseline.

Change one constraint

Of 20 alerts, 15 were correct and 10 additional late shipments went unflagged. What do the two rates say?

Check your answer

Precision is 15/20 or 75%. Recall is 15/25 or 60%. Decide whether the five unnecessary reviews or the ten missed shipments cost more before moving the alert threshold.

Measure a review queue

These invented, held-out records contain model scores and confirmed outcomes. Predict how lowering the review threshold changes missed incidents and staff workload. Run this locally with Python 3 or trace the example on paper.

observations = [(0.92, True), (0.81, False), (0.74, True),
                (0.62, True), (0.55, False), (0.30, False)]
for threshold in (0.80, 0.60):
    alerts = [actual for score, actual in observations if score >= threshold]
    caught = sum(alerts)
    actual_positives = sum(actual for _, actual in observations)
    print(threshold, len(alerts), caught / len(alerts), caught / actual_positives)
Check your result

At 0.80 the queue has two alerts, precision is 1/2 and recall is 1/3. At 0.60 it has four alerts, precision is 3/4 and recall is 3/3. Inspect which new records crossed the threshold. On this tiny sample they were both true positives. A lower threshold does not guarantee better precision on new data.

Revisit the recording

The SageMaker demonstrations connect features, training and serving. Save the feature definition and model version along with the endpoint configuration. SageMaker · 8:08:46.

Sources and further practice

AWS exam objectives · AWS documentation for this case.

Lakeflow Declarative Pipelines · Data Engineer Associate · Return to the study map.

Knowledge check

Follow a model from data to a production decision quiz

Answer 5 questions. Check each answer for an explanation.

Worked example · Measuring missed defects