↑ ↓ to move, Enter to open, Esc to close

    awsAIF-C01AI Practitioner

    Switch exam

    Microsoft Azure

    aws Amazon Web Services

    Google Cloud

    ServiceNow

    Databricks

    Cisco

    Salesforce

    All exams and search
    Free exam

    Exams / AIF-C01 / D2 Fundamentals of AI and ML

    D2.3

    Fundamentals of AI and ML (part 3 of 3)

    • 10 min read
    • 8 sections
    • 33 questions
    • Exam domain: Fundamentals of AI and ML

    This chapter closes out Domain 2: choosing the right ML learning paradigm and algorithm for a business problem, deciding when ML is not even the right tool, reading training data for structure/labels, diagnosing model fit, picking the right evaluation metric, and matching SageMaker AI lifecycle/inference concepts to a scenario.

    Supervised, unsupervised, and reinforcement learning

    The exam repeatedly asks "what kind of learning is this?" from a description of the data and the goal. The three paradigms:

    Paradigm Data looks like Typical algorithms Goal
    Supervised learning Inputs and a known target/label Logistic regression, decision trees, linear regression, neural networks Learn the mapping from inputs to the known label, to predict it on new inputs
    Unsupervised learning Inputs only, no label K-means, dimensionality reduction Find structure (groups, density, reduced dimensions) with no predefined categories
    Reinforcement learning No dataset of labels — an agent acts and receives a reward RLHF, policy optimization Learn a policy that maximizes cumulative reward through trial and feedback

    A decision flow from a dataset to supervised learning (regression or classification) when data is labeled, unsupervised learning (clustering) when it is not, or reinforcement learning when there is only a reward signal

    Inside supervised learning, the target's type decides the task:

    • Regression — the target is a continuous number (customer lifetime value, future temperature, future stock level). "Predict historical sales → forecast demand," "predict a numeric amount" are the regression tells.
    • Classification — the target is a discrete category or probability of a class (churn yes/no, sentiment positive/negative/neutral, fraud yes/no). Sentiment analysis is a classification task even though the question may call it "model evaluation strategy."

    Clustering (e.g. k-means) is the unsupervised answer whenever a question says the data has no predefined categories and the goal is to group similar records — customer segmentation by demographics/purchase history/browsing behavior is the classic exam scenario. K-means works by making members of a group as similar as possible to each other and as different as possible from other groups. Because it needs no labels, it is never the answer when a question gives you a known target column.

    Reinforcement learning fits when a system must self-improve from feedback/interactions rather than from a static labeled dataset — e.g., a chatbot getting better from rewards tied to positive customer feedback (RLHF). A manually curated "good/bad response" dataset or a manually updated FAQ is not self-improving, even if it looks similar on the surface.

    Transfer learning is a different axis entirely: it reuses a model already pre-trained on one task (its weights/features) and fine-tunes it for a new, related task, avoiding training from scratch and reducing the data/compute needed. Exam phrasing: "adapt pre-trained models," "use information from previous tasks to increase learning speed" → transfer learning, never "increase/decrease epochs" (which only changes how long a single training run lasts) and never "unsupervised learning" (a different paradigm, not a way of reusing prior knowledge).

    When ML is not even the right tool

    Not every question that mentions "a model" should be answered with ML. If a problem has an exact, deterministic formula (e.g., probability of drawing a marble of a given color from a known jar composition), plain code implementing that formula is more accurate and has far less operational overhead than any ML approach (supervised regression, reinforcement learning, or unsupervised density estimation). Whenever a stem states "least operational overhead" next to a problem that is really simple arithmetic, the simple-code option beats every ML option.

    Reading the dataset: structured vs. unstructured, labeled vs. unlabeled

    Property Meaning Example
    Structured Follows a predefined (usually tabular) data model Spreadsheets, relational tables
    Unstructured No predefined data model Raw images, audio, free text
    Labeled Has annotations/metadata identifying the right answer Images tagged with land-cover type
    Unlabeled No annotations at all Raw image files with no metadata

    A large collection of raw image files with no annotations or metadata is both unstructured (images are not tabular) and unlabeled (no land-cover/class information attached) — don't be tempted by "semi-structured," which describes self-describing formats like JSON/XML, not raw binary images.

    For training a domain-specific AI assistant (e.g., a chatbot for one content area), the right training data is diverse conversations that use the domain's own terminology — numeric time-series, generic news sentiment, or ID pairings carry no conversational language and cannot teach a model how users in that domain talk.

    An LLM is also the standard tool whenever a requirement is to finish an incomplete sentence written by a user (e.g., in medical records): a model trained on the organization's own text learns the domain's language and generates a plausible continuation — this is ordinary text-generation/completion, not computer vision, k-NN, or reinforcement learning.

    Model interpretability and feature management

    Logistic regression is the model to pick whenever a requirement is that business users must view and manually adjust the weight assigned to each input variable based on domain expertise — its per-feature coefficients are transparent and easy to troubleshoot. Neural networks, deep learning on principal components, and k-NN all hide or lack a simple, directly adjustable per-feature weight.

    Amazon SageMaker Feature Store is the centralized repository for creating, storing, sharing, and managing features (model input variables) so that multiple teams can reuse the same, consistent features across different models — this is distinct from Data Wrangler (data prep for one workflow), Clarify (bias/explainability), and Model Cards (static documentation).

    Diagnosing model fit: underfitting vs. overfitting

    Symptom Diagnosis Typical cause
    Poor accuracy on both training and test data Underfitting Model too simple, or not enough training, to capture the patterns
    Strong accuracy on training data, much weaker on test/unseen data Overfitting Unrepresentative training data, or an overly complex model that memorizes the training set
    Accuracy on new data drops after the model is tested Overfitting The model doesn't generalize past what it memorized

    Decision flow: low accuracy on training data means underfitting; high training accuracy with low test accuracy means overfitting; high accuracy on both means a good fit

    A model with 90% recall on training data but only 40% recall on unseen test data is the textbook overfitting signature — a large train/test performance gap, not "insufficient training data" or "insufficient testing data" (those would not specifically produce this gap pattern). Regularization and early-stopping are cures for overfitting, never causes of it; the usual root causes are training data that does not represent the full range of real inputs, and models that are too complex (too many features without feature selection, for instance).

    Choosing the right evaluation metric

    Metric Measures Use when
    Accuracy Fraction of all predictions that are correct Classes are roughly balanced
    Precision Of predicted positives, how many are actually positive False positives are costly
    Recall Of actual positives, how many were found False negatives are costly
    F1 score Harmonic mean of precision and recall Classes are imbalanced and both false positives and false negatives matter
    R² / RMSE How well a regression model fits a continuous target Only for regression, never for classification
    BLEU N-gram overlap with a reference translation Machine translation / text generation quality
    BERT Score Similarity between contextual token embeddings of generated vs. reference text Semantic similarity, when n-gram overlap alone misses meaning

    On a highly imbalanced dataset (e.g. only 5% of customers actually purchase), overall accuracy is misleading — a model that never predicts a purchase can still score 95% accuracy while missing nearly every real buyer. The F1 score exposes this because it factors in both precision and recall for the minority (positive) class. When a requirement explicitly says "minimize false positives," that is precision's specific job; pick F1 only when precision itself is not one of the answer choices.

    For text generation and translation tasks specifically: BLEU compares n-grams against a reference translation (translation quality), while BERT Score compares embeddings to catch paraphrases and semantic similarity that BLEU's literal n-gram matching misses.

    Domain-specific benchmark testing is the name for evaluating a model against a labeled dataset and criteria drawn from its target subject area — e.g., scoring a medical model's diagnostic accuracy against labeled radiology reports.

    The ML lifecycle and SageMaker AI inference options

    The AWS ML lifecycle phases, in order: business goal identification → ML problem framing → data processing (collection, preprocessing, feature engineering) → model development (training, tuning, evaluation) → model deployment (inference, prediction) → model monitoring. Two exam traps:

    • Right after data is collected, the next step is data preprocessing (cleaning, transforming, partitioning, scaling) — not hyperparameter tuning or evaluation, both of which need already-prepared data, and not drift monitoring, which only happens after deployment.
    • Making a trained model reachable by production applications through an API endpoint for runtime queries is the model deployment and inference phase — not data preparation, training/tuning, or evaluation/validation, which all happen earlier.

    For serving a trained model on SageMaker AI, four inference options trade off latency against cost and endpoint persistence:

    Decision flow from needing a live response, to payload/duration, to traffic pattern, ending at batch transform, asynchronous inference, serverless inference, or real-time inference

    • Batch transform — no persistent endpoint; AWS provisions compute only for the job and bills only for its duration. The answer whenever a workload is not time-sensitive and the requirement explicitly says no persistent endpoint (e.g., a monthly assessment job).
    • Asynchronous inference — queues large payloads (up to 1 GB) or long-running requests without blocking the caller.
    • Serverless inference — keeps an endpoint but scales it to zero between invocations, for intermittent/unpredictable traffic.
    • Real-time inference — a fully persistent endpoint for steady, latency-sensitive traffic.

    Measuring the value of an AI deployment

    When AI agents automate manual decision-making, the metric that captures the immediate value of the deployment is the reduction in cost per decision (comparing the cost of decisions before and after automation, net of the agents' own operating/oversight cost). Network-effect growth, new market-expansion revenue, and the potential value of future vertical solutions are longer-horizon or speculative benefits, not an immediate measure of the current deployment.

    For an AI assistant whose goal is to resolve more queries per hour, task/resolution completion rate is the closest available metric among typical choices — it validates that queries are actually being resolved — but a percentage alone does not prove throughput; pairing it with the raw count of resolved queries per hour is what actually confirms an hourly-volume goal. User satisfaction, cost per interaction, and inference latency do not measure resolution success at all.

    Adaptability — the ability to keep working correctly as the information behind it changes (new products, revised policies) without being rebuilt — is the AI characteristic tested when a support system must absorb ongoing change. It's the same reasoning behind retrieval-based approaches (RAG) over baking new facts into model weights: extending an LLM to new information without retraining it.

    Exam traps

    • Sentiment analysis → classification, even when the stem calls it a "model evaluation strategy."
    • Continuous target = regression; discrete/known target = classification; no label = clustering; reward only = reinforcement learning. Don't mix these up when a dropdown asks you to match three customer-analytics use cases to the three ML approaches.
    • An exact, deterministic formula never needs ML — plain code beats supervised, unsupervised, or reinforcement learning for "least operational overhead."
    • Unrepresentative training data AND overly complex models (too many features) are both documented causes of overfitting — don't assume there is only one "textbook" cause when a question forces a single choice.
    • Train AND test accuracy both low → underfitting. Train high, test low → overfitting. A 90%-vs-40% recall gap between train and test is overfitting, not "insufficient data."
    • Logistic regression for interpretable, manually adjustable weights — neural networks, deep learning on principal components, and k-NN don't expose simple per-feature weights.
    • SageMaker Feature Store = cross-team feature sharing; don't confuse with Data Wrangler, Clarify, or Model Cards.
    • F1 balances precision and recall; it is not the same as "minimize false positives" specifically (that's precision) — pick F1 only when precision isn't offered and classes are imbalanced.
    • BLEU = n-gram overlap (translation); BERT Score = embedding similarity (semantic/paraphrase); R² is a regression metric and never belongs in a classification/NLG metric lineup.
    • Batch transform = no persistent endpoint, billed per job duration — the answer for "not time-sensitive, no persistent endpoint wanted," never real-time/serverless/async.
    • Data preprocessing comes right after data collection, before tuning, evaluation, or drift monitoring.
    • Cost per decision (immediate) vs. network effects/market expansion (longer-term, speculative) when measuring the value of agentic AI automation.

    Docs

    The rest of this chapter is part of the AIF-C01 premium course

    Unlock every chapter, all 555 questions and spaced review with All access or a 90-day exam pass. Every Fundamentals exam stays free, and the first chapter of every exam is open.

    Chapters