Machine Learning · Glossary
Machine Learning Glossary — Key Terms Explained
Quick summary — machine learning glossary
Machine learning has its own vocabulary. This glossary covers the terms you'll meet most often — from foundational concepts like supervised learning and features, through training concepts like gradient descent and overfitting, to evaluation metrics like precision and recall, and production concepts like model drift and MLOps.
In this guide you will find:
- Fundamentals — supervised, unsupervised, features, labels.
- Modeling & training — gradient descent, epochs, overfitting, regularization.
- Evaluation — accuracy, precision, recall, F1, ROC-AUC.
- Deployment — inference, drift, MLOps, latency.
- How to use this glossary — practical tips for learners.
SECTION 01Overview — why an ML glossary helps
ML is a field where a small vocabulary unlocks a lot of understanding. Here's why a glossary matters:
| Why It Matters | What It Unlocks |
|---|---|
| Interviews | Interviewers expect you to know the terms without hesitation |
| Reading papers and docs | You can understand blogs, papers, and library documentation |
| Team communication | You can follow discussions without constantly asking "what does that mean?" |
| Debugging | You can name the problem — "overfitting" — and know how to fix it |
| Confident learning | You stop getting stuck on jargon and focus on concepts |
SECTION 02Fundamentals — core concepts
These terms are the foundation of every ML discussion. Learn them first:
| Term | Simple Definition | Example |
|---|---|---|
| Machine Learning | Teaching computers to learn patterns from data | Spam filters, recommendations |
| Supervised learning | Learning from labelled data (input + answer) | Predicting house prices |
| Unsupervised learning | Finding patterns in unlabelled data | Customer segmentation |
| Reinforcement learning | Learning through trial and reward | Game-playing agents, robots |
| Features | Input variables a model learns from | Age, income, location |
| Label / Target | The answer the model tries to predict | Price, churn (yes/no) |
| Training data | Data used to learn | 80% of your dataset |
| Test data | Data used to evaluate after training | Held-out 20% |
| Overfitting | Model memorises training data, fails on new data | 99% train accuracy, 60% test |
| Underfitting | Model is too simple to learn the pattern | Poor on both train and test |
# Training vs test data — the basics
import pandas as pd
from sklearn.model_selection import train_test_split
# Load a dataset
df = pd.read_csv("churn.csv")
# Features (X) and label (y)
X = df.drop(columns=["churned"]) # features
y = df["churned"] # label (target)
# Split into training (80%) and test (20%)
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42, stratify=y
)
print("Train:", X_train.shape)
print("Test: ", X_test.shape)
# Features and labels — a concrete example
# Predict whether a customer churns (yes/no)
# Features (what the model sees)
# - tenure_months
# - monthly_charges
# - support_tickets
# - plan_type
# Label (what we predict)
# - churned: 0 = stayed, 1 = churned
import pandas as pd
df = pd.DataFrame({
"tenure_months": [12, 3, 24, 1],
"monthly_charges": [500, 800, 350, 1200],
"support_tickets": [0, 5, 1, 8],
"churned": [0, 1, 0, 1],
})
X = df.drop(columns=["churned"])
y = df["churned"]
print(X.shape, y.shape)
SECTION 03Modeling & training terms
These terms describe how models actually learn:
| Term | Simple Definition | Why It Matters |
|---|---|---|
| Algorithm | The procedure a model uses to learn | Linear regression, decision tree, neural network |
| Gradient descent | An optimisation method that improves the model step by step | How models minimise error during training |
| Loss function | Measures how wrong the model is | MSE, cross-entropy |
| Learning rate | How big a step to take during training | Too high → unstable; too low → slow |
| Epoch | One full pass through the training data | More epochs = more learning (up to a point) |
| Batch size | Number of samples per training step | Affects speed and stability |
| Regularisation | A technique to prevent overfitting | L1, L2, dropout |
| Hyperparameter | A setting you choose before training | Learning rate, batch size, tree depth |
| Parameter / Weight | A value the model learns | Coefficients in a regression |
| Feature engineering | Creating new, useful features from raw data | Turning dates into "days since signup" |
# Epochs and learning rate with sklearn
from sklearn.linear_model import SGDClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
model = make_pipeline(
StandardScaler(),
SGDClassifier(
loss="log_loss",
learning_rate="constant",
eta0=0.01, # learning rate
max_iter=20, # ≈ epochs
random_state=42,
),
)
model.fit(X_train, y_train)
# The model has now seen the training data
# 20 times (20 epochs) at learning rate 0.01.
# Overfitting demo — train vs test accuracy
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import accuracy_score
for depth in [1, 3, 10, 30]:
model = DecisionTreeClassifier(
max_depth=depth, random_state=42
)
model.fit(X_train, y_train)
train_acc = accuracy_score(y_train, model.predict(X_train))
test_acc = accuracy_score(y_test, model.predict(X_test))
print(f"depth={depth:2d} "
f"train={train_acc:.3f} "
f"test={test_acc:.3f}")
# Shallow trees underfit; very deep trees
# overfit — high train acc, lower test acc.
SECTION 04Evaluation & metrics
How do you know if a model is good? These metrics are how teams answer that:
| Term | Simple Definition | When to Use |
|---|---|---|
| Accuracy | Fraction of predictions that are correct | Balanced classes |
| Precision | Of predicted positives, how many were actually positive | When false positives are costly |
| Recall | Of actual positives, how many were correctly found | When false negatives are costly |
| F1 score | Harmonic mean of precision and recall | When you need a balance of both |
| Confusion matrix | Table of actual vs predicted labels | Any classification problem |
| ROC-AUC | How well the model separates classes across thresholds | Ranking and probabilistic output |
| RMSE / MAE | Average error in regression predictions | Predicting continuous values |
| Cross-validation | Evaluating on multiple train/test splits | Small datasets, model selection |
| Baseline | A simple reference model to beat | Always compare against one |
# Classification metrics
from sklearn.metrics import (
accuracy_score, precision_score,
recall_score, f1_score,
confusion_matrix, roc_auc_score,
)
y_pred = model.predict(X_test)
y_proba = model.predict_proba(X_test)[:, 1]
print("Accuracy: ", accuracy_score(y_test, y_pred))
print("Precision:", precision_score(y_test, y_pred))
print("Recall: ", recall_score(y_test, y_pred))
print("F1: ", f1_score(y_test, y_pred))
print("ROC-AUC: ", roc_auc_score(y_test, y_proba))
print("Confusion matrix:")
print(confusion_matrix(y_test, y_pred))
# Regression metrics
from sklearn.metrics import (
mean_absolute_error,
mean_squared_error,
r2_score,
)
import numpy as np
y_pred = model.predict(X_test)
mae = mean_absolute_error(y_test, y_pred)
rmse = np.sqrt(mean_squared_error(y_test, y_pred))
r2 = r2_score(y_test, y_pred)
print(f"MAE: {mae:.2f}")
print(f"RMSE: {rmse:.2f}")
print(f"R²: {r2:.3f}")
# MAE = average absolute error
# RMSE = penalises large errors more
# R² = fraction of variance explained
SECTION 05Deployment & MLOps terms
Once a model leaves the notebook, these terms matter:
| Term | Simple Definition | Example |
|---|---|---|
| Inference | Using a trained model to make predictions | Serving a churn score via an API |
| Batch inference | Predicting in bulk on a schedule | Nightly churn scores |
| Real-time inference | Predicting per request | Credit card fraud check |
| Model drift | Model performance degrades because real data changes | Post-pandemic shopping behaviour |
| Data drift | Input data distribution shifts from training data | New customer demographics |
| Latency | Time to return a prediction | Target: < 100ms for real-time |
| MLOps | Practices and tools to deploy and maintain ML at scale | CI/CD for models, monitoring, retraining |
| Feature store | Central place for reusable, consistent features | Feast, Tecton |
| A/B testing | Comparing two model versions on live traffic | New model on 10% of users |
| Retraining | Training a model again on fresh data | Weekly or triggered by drift |
# FastAPI — serve a trained model
from fastapi import FastAPI
from pydantic import BaseModel
import joblib
app = FastAPI()
model = joblib.load("churn_model.joblib")
class Customer(BaseModel):
tenure_months: int
monthly_charges: float
support_tickets: int
@app.post("/predict")
def predict(c: Customer):
features = [[
c.tenure_months,
c.monthly_charges,
c.support_tickets,
]]
proba = model.predict_proba(features)[0][1]
return {"churn_probability": round(float(proba), 3)}
# Data drift — simple distribution comparison
import pandas as pd
from scipy.stats import ks_2samp
# Training distribution vs current production data
train = pd.read_csv("train.csv")
live = pd.read_csv("live.csv")
for col in ["tenure_months", "monthly_charges"]:
stat, p = ks_2samp(train[col], live[col])
drift = "DRIFT" if p < 0.05 else "ok"
print(f"{col:18s} p={p:.4f} {drift}")
# A low p-value suggests the distributions
# differ — consider retraining or investigating.
SECTION 06Interview Q&A — how terms appear in interviews
Q1What's the difference between a parameter and a hyperparameter?
A parameter is a value the model learns during training (like weights or coefficients). A hyperparameter is a value you set before training (like learning rate, batch size, or tree depth). You tune hyperparameters; the model learns parameters.
Q2When would you prefer recall over precision?
Prefer recall when missing a positive case is worse than a false alarm. For example, cancer screening — you'd rather flag more people for further tests than miss a real case. Prefer precision when false positives are costly, like spam filters.
Q3What is overfitting and how do you fix it?
Overfitting means the model memorises training data and fails on new data — high training accuracy, lower test accuracy. Fix it with more data, simpler models, regularisation (L1/L2/dropout), early stopping, or cross-validation.
Q4What does MLOps mean in practice?
MLOps is the practice of deploying and maintaining ML models reliably. In practice it means versioning data and models, CI/CD pipelines for models, monitoring for drift and performance, automated retraining, and clear rollback procedures.
Q5What's the difference between data drift and model drift?
Data drift is when the input distribution changes (e.g., new customer demographics). Model drift (or concept drift) is when the relationship between inputs and outputs changes, so even the same inputs get different correct answers. Both degrade performance and usually require monitoring and retraining.
SECTION 07Test yourself — ML glossary quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
What is the difference between supervised and unsupervised learning?
Supervised learning trains on labelled data (input + correct answer) — like predicting house prices. Unsupervised learning finds patterns in unlabelled data — like clustering customers into segments. Both are core categories of ML.
What is overfitting in simple terms?
Overfitting means your model memorised the training data instead of learning general patterns. It performs great on training data but poorly on new data. It's like memorising exam answers without understanding the subject.
When should I use F1 score instead of accuracy?
Use F1 when classes are imbalanced and you care about both false positives and false negatives. Accuracy can be misleading when one class dominates — a model that always predicts the majority class can have high accuracy but useless real-world value.
What's the difference between a parameter and a hyperparameter?
Parameters are learned by the model during training (weights, coefficients). Hyperparameters are set by you before training (learning rate, batch size, number of layers). You tune hyperparameters; the model learns parameters.
What does MLOps stand for and why does it matter?
MLOps stands for Machine Learning Operations — the practices and tools for deploying and maintaining ML models reliably. It matters because most models fail in production without it: no monitoring, no retraining, no versioning. MLOps keeps models useful over time.
SECTION 09Related reads
Classroom & online · Noida
Master ML fundamentals with real projects
Our Data Analytics Training Course covers ML fundamentals, sklearn, metrics, and MLOps basics — with real projects and interview prep.
₹15,500 · full programme- ML fundamentals & sklearn
- Metrics, evaluation, and MLOps
- Mock interviews
- Weekday & weekend batches