Exams / AIF-C01 / D2 Fundamentals of AI and ML
Fundamentals of AI and ML (part 2 of 3)
- Exam domain: Fundamentals of AI and ML
This pass drills into the pieces of the ML lifecycle that part 1 only named: exploratory analysis, feature engineering and preprocessing, choosing an algorithm for a stated task, getting from unlabeled to labeled data with Amazon SageMaker Ground Truth, evaluating classifiers with a confusion matrix, and the foundation-model lifecycle (pre-training vs. fine-tuning) with its context-window limit. See part 1 for the lifecycle order, supervised/unsupervised split, inference modes, and overfitting.
AI, ML, and deep learning: three nested fields
| Field | Scope | Key fact |
|---|---|---|
| Artificial intelligence (AI) | The broadest field: making machines simulate human-like problem-solving | "the broader concept of making machines more human-like" |
| Machine learning (ML) | A subset of AI: data-driven algorithms that learn patterns to make predictions, with minimal explicit programming | "a subset focused on teaching computers to learn from data without explicit programming" |
| Deep learning (DL) | A subset of ML: uses multilayer neural networks modeled after the brain | "a subset of ML that uses specific algorithmic structures called neural networks" |
The exam tests this as a matching exercise ("simulates human problem-solving" → AI, "data-driven learning to predict" → ML, "processes data through intricate neural networks" → deep learning) — always nested, never overlapping categories.
From raw data to a trained model: the sub-steps the exam names individually
Part 1 covers the five high-level lifecycle phases. Inside "model development," the exam separately names these sub-steps, in this order:
| Step | What happens | Recognize it by |
|---|---|---|
| Data collection | Gathering the raw data itself | Recordings, logs, or files are being gathered for the first time |
| Data preprocessing | Cleaning, filtering, balancing, imputing, partitioning already-collected data | "filtering recordings by duration and language," removing noise/outliers |
| Exploratory data analysis (EDA) | Analyzing/visualizing data to understand structure before modeling | Correlation matrices, summary statistics, visualizations |
| Feature engineering | Creating or selecting the input variables (features) the model trains on | "select relevant features," transform variables for predictive power |
| Training → evaluation → deployment → inference | Covered in part 1 | — |
A company "filtering voice recordings based on duration and language" is preprocessing, not data collection (already done) or feature engineering (a later step on cleaned data). A company "creating a correlation matrix, calculating statistics, and visualizing the data" is doing EDA, which comes before feature engineering and preprocessing decisions are finalized.
Data labeling: Ground Truth and the human-vs-automated choice
Tagging each record with a category (e.g., marking a transaction "personal" or "business") is data labeling — distinct from encoding (numeric representation), normalization (rescaling values), and balancing (adjusting class proportions). When most of a dataset is unlabeled, Amazon SageMaker Ground Truth gets it labeled either by a human workforce or by ML-assisted automated labeling:
- Human workforce — a private workforce (your employees/contractors), a vendor workforce, or the public Amazon Mechanical Turk workforce, appropriate when the data contains no confidential information.
- Automated data labeling — a Ground Truth process that uses ML to label large unlabeled datasets, reducing manual labeling time and effort.
Note: Amazon SageMaker Ground Truth is documented as no longer open to new customers (existing customers can keep using it) — the exam still tests the labeling-workflow concepts above.
Picking the right algorithm for the task
| Task | Data has labels? | Output type | Algorithm family | Example |
|---|---|---|---|---|
| Group similar records with no target | No | — | Clustering (K-means) | Segment customers by demographics/purchases |
| Assign a known category to new data | Yes | Category (2 classes) | Binary classification (k-NN, decision tree, logistic regression) | Fraud vs. not fraud |
| Assign a known category, 3+ classes | Yes | Category (3+ classes) | Multiclass classification | Classify flower species from petal/sepal measurements |
| Predict a continuous value | Yes | Number | Regression | Predict house price |
| Flag unusual data, no labeled anomalies | No | — | Autoencoders (reconstruction error) | Detect abnormal sensor readings |
K-nearest neighbors (k-NN) classifies a new point by the majority class among its closest labeled neighbors — this is the answer whenever a question describes predicting a category from several numeric measurements (e.g., petal/sepal length and width) with a labeled dataset already available. K-means, by contrast, needs no labels and is the default whenever a question says "group" or "segment" with no pre-existing categories.
Autoencoders for anomaly detection. With no labeled anomalies available, an autoencoder learns to reconstruct the normal pattern in the data; observations with high reconstruction error are flagged as abnormal. This is an unsupervised technique — distinct from classification/regression/decision trees, which all require a labeled target the scenario doesn't have.
Evaluating a classifier: the confusion matrix
A confusion matrix tabulates four outcomes for a classifier's predictions against the true labels:
| Predicted positive | Predicted negative | |
|---|---|---|
| Actual positive | True positive (TP) | False negative (FN) |
| Actual negative | False positive (FP) | True negative (TN) |
From these four counts, accuracy ((TP+TN) ÷ total), precision (TP ÷ (TP+FP)), recall (TP ÷ (TP+FN)), and F1
score (harmonic mean of precision and recall) can all be derived — this is why a confusion matrix is the standard
"measure a classifier's performance" answer, including for deep-learning image/material classifiers. A
correlation matrix is unrelated — it shows relationships between features, not classifier correctness.
BLEU for translation quality. Comparing a translation tool's output against reference (e.g., human) translations on the same document corpus with BLEU gives a relative comparison between the two methods — BLEU relies on normalization, tokenization, and the specific reference set used, so its scores aren't a reliable absolute measure of quality across different corpora or setups.
Foundation model lifecycle: pre-training, fine-tuning, and context window
| Stage | Data used | What happens |
|---|---|---|
| Pre-training | Large-scale, broad (often unlabeled) corpus | Builds the base foundation model's general capabilities |
| Fine-tuning | Small, labeled, task-specific dataset | Supervised learning adapts the pre-trained FM to a particular target task |
| Inference | New input at request time | The deployed (custom or base) model produces a prediction/response |
"A company uses supervised learning to train a model with a small, labeled dataset tailored to a target task" is fine-tuning — not pre-training (large-scale, broad data) or data selection/evaluation, which are different lifecycle stages.
Context window. Every model has a maximum number of tokens it can process in a single request. An application that fails to summarize long inputs (e.g., some books) but works for shorter ones is hitting this context-size limit — not temperature or Top P, which control output sampling, and not fine-tuning support, which affects customization rather than input length.
NLP basics: tokenization and managed text analysis
- Tokenization splits raw text into smaller units (tokens) — words, subwords, or sentences — that an NLP system can analyze or feed to a model. It is a preprocessing step, not encryption, compression, or translation.
- Sentiment analysis evaluates unstructured text and assigns a sentiment (positive/negative/neutral/mixed). An LLM, or a managed NLP service such as Amazon Comprehend, can perform this directly on raw feedback text — no detour through regression, a recommendation engine, or a time-series algorithm is needed.
- Amazon Comprehend toxicity detection is a managed, pre-trained capability for detecting harmful, offensive, or inappropriate text content. Because it's pre-trained, it needs no labeled training data — the answer whenever a question asks to detect harmful language without training a custom model.
Operational-efficiency picks
- Simple, deterministic per-file transforms (e.g., transpose/rotate a batch of images) → an AWS Lambda function: serverless, no infrastructure to manage, minimal operational overhead. Reaching for a deep neural network, an LLM, or a data-quality service for a plain geometric transform adds unnecessary complexity. Amazon SageMaker Model Registry catalogs and versions models; Serverless Inference hosts the current model for on-demand predictions without managing servers — two different jobs in a model's lifecycle.
- Once-per-day inference on an entire accumulated dataset → batch inference (SageMaker Batch Transform), which needs no persistent endpoint — see part 1 for the full inference-mode comparison table.
Exam traps
- AI ⊃ ML ⊃ deep learning — simulate problem-solving (AI), data-driven prediction (ML), neural-network processing (deep learning); never mix up which is the subset of which.
- Data collection (gathering) vs. preprocessing (cleaning/filtering) vs. EDA (analyze/visualize) vs. feature engineering (create/select features) — four different lifecycle sub-steps tested by four different scenario phrasings.
- k-NN (supervised classification from labeled neighbors) vs. K-means (unsupervised clustering) — same "k" in the name, opposite data requirements.
- No labeled anomalies → autoencoders (unsupervised reconstruction error), never regression/classification/ decision trees, which all need labels.
- Confusion matrix (classifier performance) vs. correlation matrix (feature relationships) — don't swap them.
- BLEU on the same corpus = relative comparison between two translation methods, not an absolute, universal quality score.
- Fine-tuning = small labeled task-specific data on an already pre-trained FM; pre-training = large-scale, broad data building the base FM.
- Input exceeds the model's context window → request fails — not a temperature, Top P, or fine-tuning issue.
- Mechanical Turk workforce only for non-confidential data — if data is confidential, use a private workforce instead.
- Simple, deterministic, per-item transforms → Lambda, not a deep learning model or an LLM — reserve ML models for problems that actually need learned patterns.
Docs
- What is Machine Learning? (AWS)
- Deep Learning vs Machine Learning (AWS)
- Training data labeling using humans with Amazon SageMaker Ground Truth
- Perform exploratory data analysis (EDA) — Amazon SageMaker AI
- Feature engineering — AWS Well-Architected Machine Learning Lens
- Data preprocessing — AWS Well-Architected Machine Learning Lens
- K-Means Algorithm — Amazon SageMaker AI
- Choosing an algorithm — Amazon SageMaker AI
- Unsupervised Built-in SageMaker AI Algorithms
- Binary Classification (Amazon Machine Learning)
- Regression (Amazon Machine Learning)
- Use advanced metrics in your analyses — Amazon SageMaker AI
- Model Quality Metrics — Amazon SageMaker
- The BLEU translation quality metric (Google Cloud Translation)
- Customize a model with fine-tuning in Amazon Bedrock
- Google Machine Learning Glossary: Generative AI
- Syntax analysis (Amazon Comprehend)
- Sentiment (Amazon Comprehend)
- Amazon Comprehend Trust and safety
- AWS Lambda Functions
- Amazon SageMaker Model Registry
- Deploy models with Amazon SageMaker Serverless Inference
- Batch transform for inference with Amazon SageMaker AI
- What Is Amazon Forecast?
- What is Amazon Comprehend?
- Deploy models for inference (Amazon SageMaker AI)
- Content Domain 1: Fundamentals of AI and ML — AWS Certification