Skip to content
New
Latest News || 27 October 2026: Dr Soumava Mukherjee's invited talk at Queen's University Belfast joined device-level hardware innovation with channel-level control. || 22 October 2026: I received a Certificate of Appreciation for serving as a reviewer for IEEE IMAS 2026. || 15 October 2026: I presented a poster on beam-domain ML fingerprinting for RIS-aided mmWave localisation at the Centre for Wireless Innovation's annual symposium. || 15 October 2026: CWI's annual symposium brought research and industry perspectives on 6G, ISAC, optical wireless, AI, and future networks to Queen's University Belfast. || 14 October 2026: Erik Nordell of Ericsson visited our Keysight Lab for a live RIS-assisted video streaming demonstration.
Knowledge Hubmachine learning1. Basics and Classification

machine learning learning note

1. Basics and Classification

A clearer introduction to machine learning, the basic vocabulary, and how classification problems are framed.

At a glance

  • Learn a rule, then test itTraining fits parameters; validation tunes choices; an untouched test set estimates generalization.
  • A score needs a decision ruleChanging the classification threshold changes false positives and false negatives, even with the same scores.
  • Accuracy needs contextUse precision, recall, F1 and a confusion matrix when class imbalance or error costs matter.

What is Machine Learning?

Machine learning fits a rule from examples rather than writing every rule by hand.

  • Input: measured features, such as SNR and delay spread.
  • Target: the answer we want, such as a link-quality class.
  • Training: adjust the model using examples with known outcomes.

A classic definition from Tom Mitchell says a program learns from experience if its performance at a task improves with experience. In practical terms:

  • Task: What do we want the system to do? Example: detect spam email.

  • Experience: What data does it learn from? Example: old emails with spam/not-spam labels.

  • Performance: How do we measure success? Example: accuracy, precision, recall, or error rate.

  • Model: a function with adjustable parameters.

  • Training fit: fewer mistakes on known examples.

  • Generalization: reliable answers on new examples, not memorization.

References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

The Basic Vocabulary

Before studying algorithms, these terms make the field much easier to read:

  • Dataset: A collection of examples.
  • Sample or instance: One row/example in the dataset.
  • Feature: An input variable used by the model. In a house-price model, features could be area, number of rooms, and location.
  • Label or target: The answer we want to predict.
  • Model: The learned mapping from features to outputs.
  • Training set: Data used to fit the model.
  • Validation set: Data used to tune choices such as hyperparameters.
  • Test set: Data kept aside until the end to estimate real performance.
  • Generalization: The ability to work well on new data, not only memorized training data.
References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Learning as Pattern Finding

Suppose we want to detect whether an email is spam. A hand-written rule system might say: "if the email contains 'free money', mark it as spam." That rule fails quickly because real emails are messy. ML learns from many examples instead:

  1. It sees features such as words, sender behavior, links, and punctuation.
  2. It compares its prediction with the correct label.
  3. It changes its parameters to reduce future mistakes.
  4. It is evaluated on unseen emails.

This is why data quality matters. A powerful algorithm trained on biased, noisy, or unrepresentative data will still learn the wrong thing.

References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

What is Classification?

Classification is a supervised ML task where the output is a category. The model asks: "Which class does this input belong to?"

Examples:

  • Email filtering: spam or inbox.
  • Medical screening: healthy, suspicious, or high-risk.
  • Modulation recognition: BPSK, QPSK, 16-QAM, or OFDM.
  • Sentiment analysis: positive, neutral, or negative.

The important point is that the output is discrete. If the output is a number such as temperature, price, or channel gain, that is regression rather than classification.

References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Types of Classification

References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Binary Classification

There are only two possible classes.

Examples:

  • Fraud or not fraud.
  • Link blocked or link accepted.
  • Tumor or normal tissue.

The model often outputs a probability first, such as 0.87. A threshold then converts that probability into a final class. If the threshold is 0.5, probability above 0.5 becomes class 1.

References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Multi-Class Classification

There are more than two classes, but each example belongs to exactly one class.

Examples:

  • A handwritten digit is one of 0, 1, 2, ..., 9.
  • A modulation scheme is one of BPSK, QPSK, 8-PSK, 16-QAM, or 64-QAM.
  • A document is one of sports, politics, business, or science.
References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Multi-Label Classification

One example can have multiple labels at the same time.

Examples:

  • A paper can be tagged as "machine learning", "wireless communication", and "optimization".
  • A scene image can contain "car", "person", "road", and "building".
  • A medical report can mention several conditions at once.

One output or many? Softmax versus independent sigmoids

1. Formula and symbols
multi-class: pk=ezk∑j=1Kezj,∑kpk=1,y^=arg⁡max⁡kpk\text{multi-class: }p_k=\frac{e^{z_k}}{\sum_{j=1}^{K}e^{z_j}},\qquad\sum_kp_k=1,\qquad\widehat y=\arg\max_kp_k
multi-label: qk=σ(zk)=11+e−zk,y^k=1[qk≥0.5]\text{multi-label: }q_k=\sigma(z_k)=\frac1{1+e^{-z_k}},\qquad\widehat y_k=\mathbf1[q_k\ge0.5]
  • zkz_k: Raw score (logit) the model gives class k
  • KK: Number of classes (here 3)
  • pkp_k: Softmax probability: classes compete, the shares sum to 1
  • qkq_k: Independent sigmoid probability: each label is its own yes/no question
  • y^\widehat y: Predicted class (multi-class) or set of labels (multi-label)

Binary classification is the K = 2 case; one sigmoid output is enough.

Multi-class (softmax)0.50.64Car ✓0.32Person0.04Dronesum = 1.00 · pick the tallestMulti-label (sigmoid each)0.50.82Car ✓0.69Person ✓0.23Dronesum = 1.74 · keep every bar ≥ 0.5
2. Work with the current inputs
∑jezj=e1.5+e0.8+e−1.2=7.008\sum_je^{z_j}=e^{1.5}+e^{0.8}+e^{-1.2}=7.008
p=(0.639, 0.318, 0.043),q=(0.818, 0.690, 0.231)p=(0.639,\ 0.318,\ 0.043),\quad q=(0.818,\ 0.690,\ 0.231)
3. Result
Multi-class answerCarp = 0.64; shares sum to 1
Multi-label answerCar + Personsigmoids sum to 1.74
A sensing model looks at one radar frame and outputs three raw scores. Multi-class assumes exactly one object type is present, so softmax makes the classes compete. Multi-label allows several at once (a car and a person), so each score goes through its own sigmoid. Raise two scores together and watch the difference.
References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

How a Classification Model Makes a Decision

Most classifiers learn a decision boundary. This boundary separates one class from another in feature space.

  • Two-feature picture: put SNR on one axis and delay spread on the other.
  • Decision boundary: a learned line or curve separates "good link" from "bad link" examples.
  • Real data: may need many more feature dimensions.

Good classifiers do not simply memorize points. They learn boundaries that are stable enough to handle new observations.

References for this section3
  • Scikit-learn documentation, "Supervised learning".
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Evaluation: Accuracy is Not Always Enough

Accuracy means the fraction of predictions that are correct. It is useful, but it can be misleading when classes are imbalanced.

Example: If only 1 percent of emails are spam, a model that always predicts "not spam" gets 99 percent accuracy while being useless for spam detection.

Better metrics:

  • Precision: Out of the items predicted positive, how many were actually positive?
  • Recall: Out of the actual positive items, how many did the model find?
  • F1-score: A balance between precision and recall.
  • Confusion matrix: A table showing correct and incorrect predictions per class.
  • ROC-AUC: Measures how well a model ranks positives above negatives across thresholds.
Accuracy=TP+TNTP+TN+FP+FN\mathrm{Accuracy}=\frac{TP+TN}{TP+TN+FP+FN} Precision=TPTP+FP\mathrm{Precision}=\frac{TP}{TP+FP} Recall=TPTP+FN\mathrm{Recall}=\frac{TP}{TP+FN} F1=2 Precision RecallPrecision+RecallF_1=\frac{2\,\mathrm{Precision}\,\mathrm{Recall}}{\mathrm{Precision}+\mathrm{Recall}}
  • TP/TN: true positive/true negative, correct positive/negative decisions.
  • FP/FN: false positive/false negative, wrong positive/negative decisions.
  • Accuracy: correct decisions divided by all decisions.
  • Precision/Recall: correctness of positive predictions / coverage of actual positives.
  • F1: harmonic mean of precision and recall; defined when its denominator is nonzero.

Does changing the threshold improve every classification metric?

1. Formula and symbols
y^=1[p≥τ]\widehat y=\mathbf1[p\geq\tau]
Accuracy=TP+TNTP+TN+FP+FN\mathrm{Accuracy}=\frac{TP+TN}{TP+TN+FP+FN}
Precision=TPTP+FP,Recall=TPTP+FN\mathrm{Precision}=\frac{TP}{TP+FP},\quad\mathrm{Recall}=\frac{TP}{TP+FN}
F1=2TP2TP+FP+FNF_1=\frac{2TP}{2TP+FP+FN}
  • pp: supplied positive score
  • τ\tau: threshold
  • TPTP: True positives: correctly predicted positive examples
  • TNTN: True negatives: correctly predicted negative examples
  • FPFP: False positives: negative examples predicted positive
  • FNFN: False negatives: positive examples predicted negative

Precision needs at least one predicted positive

recall needs at least one actual positive.

Filled = predict positive · Open = predict negativeTrue 1True 0Score 0Score 1
2. Work with the current inputs
TP=7,FP=3,TN=6,FN=4TP=7,\quad FP=3,\quad TN=6,\quad FN=4
Accuracy=7+620=0.650,F1=2TP2TP+FP+FN=0.667\mathrm{Accuracy}=\frac{7+6}{20}=0.650,\quad F_1=\frac{2TP}{2TP+FP+FN}=0.667
3. Result
Accuracy65.0%
Precision / recall0.700 / 0.636
F10.667
Twenty fixed illustrative labelled examples and supplied scores; no classifier is trained or calibrated here. Predict positive when score ≥ threshold. Rows show true labels, filled dots predicted positive, open dots predicted negative. Precision is undefined when there are no positive predictions; F1 uses zero when there are no true positives.
References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Common Classification Algorithms

  • Logistic Regression: Fast, interpretable, and strong as a baseline.
  • K-Nearest Neighbors: Simple and intuitive, but slow for large datasets.
  • Decision Tree: Easy to explain, but can overfit.
  • Support Vector Machine: Strong for high-dimensional data and margin-based separation.
  • Random Forest: Many decision trees combined to reduce overfitting.
  • Gradient Boosting and XGBoost: Sequential tree ensembles that often perform very well on tabular data.
  • Neural Networks: Powerful for images, speech, text, and large complex datasets.
References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

A Minimal Python Classification Workflow

Most scikit-learn classifiers follow the same pattern: import the model, create it, fit it, predict, and evaluate it. The code below uses the built-in Iris dataset so it runs without downloading anything.

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, classification_report

X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42, stratify=y
)

model = make_pipeline(
    StandardScaler(),
    LogisticRegression(max_iter=1000)
)

model.fit(X_train, y_train)
y_pred = model.predict(X_test)

print("Accuracy:", accuracy_score(y_test, y_pred))
print(classification_report(y_test, y_pred))

The important idea is that the preprocessing and model are kept together in a Pipeline. That prevents mistakes where the training data is scaled differently from the test data.

References for this section3
  • Scikit-learn documentation, "Supervised learning".
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Common Beginner Mistakes

  • Training and testing on the same data.
  • Forgetting to scale features for algorithms such as KNN, SVM, and neural networks.
  • Using accuracy only on imbalanced datasets.
  • Making the model too complex for the amount of data.
  • Ignoring data leakage, where information from the test set accidentally enters training.
  • Thinking that a higher training score always means a better model.
References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Takeaway

  • Classification output: a category, not a continuous number.
  • Success criterion: evaluate on unseen test data, not training memorization.

Continue with Learning Paradigms to build on this note.

References for this section3
  • C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  • Scikit-learn documentation, "Supervised learning".
  • T. M. Mitchell, Machine Learning, McGraw-Hill, 1997.

Check your understanding

0 of 4 answered

  1. Out of 100 examples, 90 predictions are correct. What is accuracy?

  2. There are 8 true positives and 2 false positives. What is precision?

  3. A detector finds 6 of 10 actual positives. What is recall?

  4. Which dataset should remain untouched while selecting thresholds?

Complete references and further reading