GCP Prep
Browse all topics
AI & Machine Learning4 min readUpdated August 28, 2026

Machine Learning Fundamentals

In one sentence

Machine learning finds patterns in historical data and applies them to new data — which means it is only as good as the data it learned from.

What it is

In traditional programming you write rules and the computer applies them. In machine learning you supply examples of inputs and correct outputs, and the system derives the rules itself. The output is a model: a function that maps new inputs to predictions.

This is powerful precisely where writing rules is impractical — recognising objects in images, understanding language, predicting behaviour from many weakly-informative signals.

Why it matters

Understanding the fundamentals is what lets you judge whether a machine learning approach is appropriate at all. A meaningful share of proposed ML projects should be a SQL query, a rules engine, or a better-designed form.

The exams test this judgement directly. Scenarios where a simple deterministic approach meets the requirement, or where a pre-trained service already solves the problem, are common — and choosing to train a custom model is the wrong answer.

Key concepts

  • Supervised learning — learning from labelled examples. Classification predicts a category; regression predicts a number.
  • Unsupervised learning — finding structure without labels, such as clustering customers into segments.
  • Feature — an input variable. Feature engineering — constructing better inputs — usually improves results more than changing the algorithm.
  • Label — the correct answer for a training example.
  • Training, validation and test sets — you train on one, tune on another, and measure honestly on a third that was never used for either.
  • Overfitting — the model memorises the training data, performing excellently there and poorly on anything new.
  • Underfitting — the model is too simple to capture the real pattern and performs poorly everywhere.
  • Bias and fairness — a model trained on historical data reproduces the patterns in that data, including patterns that reflect past discrimination.

Choosing the right metric

Metric selection is the most frequently tested piece of theory, because choosing the wrong one produces a model that scores well and is useless.

MetricWhat it measuresUse it when
AccuracyProportion of predictions that are correct.Classes are roughly balanced. Misleading otherwise.
PrecisionOf the items flagged positive, how many really were.False positives are costly — flagging a legitimate transaction as fraud.
RecallOf the real positives, how many you caught.False negatives are costly — missing a disease or a security threat.
F1 scoreThe harmonic mean of precision and recall.You need a single number balancing both.
AUC-ROCHow well the model separates classes across all thresholds.Comparing models independently of a chosen threshold.

The production problems

  • Training–serving skew — features are computed one way during training and another way in production, so the model sees inputs unlike anything it learned from.
  • Data drift — the input distribution changes over time and the model's assumptions quietly stop holding.
  • Concept drift — the relationship between inputs and outputs changes, as when customer behaviour shifts.
  • Feedback loops — the model's own predictions influence future data, reinforcing its existing biases.
  • Silent failure — a degraded model keeps returning confident predictions. Nothing crashes, which is why monitoring prediction quality matters as much as monitoring latency.

Common use cases

  • Classification — spam detection, fraud scoring, support ticket routing.
  • Regression — demand forecasting, price estimation, time-to-failure prediction.
  • Clustering — customer segmentation and anomaly detection.
  • Recommendation — surfacing relevant products or content.
  • Vision and language — extracting text from documents, classifying images, analysing sentiment.

Certification relevance

Where this topic appears, and how deeply each exam goes into it. These are our own assessments based on published exam guides.

Practice questions

AI & Machine Learning practice questions

7 original questions with full explanations.