Learning from data

Machine Learning Lab

Teaching machines to spot the threats humans can't see at scale. Watch the model on the right learn to separate benign traffic from malicious.

Learn the Basics How Good Is a Model?
BENIGNMALICIOUS- - decision boundary
The big idea

What is Machine Learning?


Machine learning (ML) is a branch of artificial intelligence where systems learn patterns from data instead of following hand-written rules. Give a model enough examples and it can classify, predict, or flag anything that looks unusual.

In security, the volume of logs, packets, emails, and files is far beyond what any analyst can review. ML helps triage that flood. It surfaces the handful of events that deserve a human's attention and catches new attack variants that signature-based tools miss.

Three approaches

Three Ways Machines Learn

BENIGNPHISHING Labelled data

Supervised Learning

Learns from labelled examples, such as emails already marked "phishing" or "legitimate", then predicts the label for new data.

Malware vs. benign file classification
OUTLIER No labels

Unsupervised Learning

Finds structure in unlabelled data. It groups similar behaviour into clusters and highlights outliers that don't fit any group.

Anomaly detection in network traffic or user logins
AgentEnvironmentactionreward + new state Trial & reward

Reinforcement Learning

An agent learns by trial and reward, choosing actions in an environment and improving based on the outcome.

Automated penetration testing and adaptive defence
From raw data to production

The ML Pipeline

Most of the work happens before training even starts.

STEP 1
Collect

Logs, PCAPs, emails, file samples

STEP 2
Clean & Label

Remove noise, mark known good and bad

STEP 3
Features

Turn raw data into numbers a model can use

STEP 4
Train

Fit the model to the training set

STEP 5
Evaluate

Precision, recall, false-positive rate

STEP 6
Deploy & Monitor

Watch for drift, retrain regularly

Step 5, up close

How Good Is a Model?

Imagine a phishing filter checking 1,000 emails, 50 of which are really phishing.

Predicted:
phishing
Predicted:
legitimate
Actually
phishing
45True positive
caught
5False negative
missed!
Actually
legitimate
20False positive
false alarm
930True negative
correctly ignored
Accuracy 97.5%
(45 + 930) / 1000. Looks great, but a model that flagged nothing would still score 95%. In security, attacks are rare, so accuracy alone is misleading.
Recall 90%
45 / (45 + 5). How many real attacks were caught. The 5 misses are the dangerous part.
Precision 69%
45 / (45 + 20). How many alerts were real. Low precision means alert fatigue for the SOC.

Tuning a model is a trade-off: catching more attacks (higher recall) usually means more false alarms (lower precision).

Keep exploring

Coming Next to the Lab

Anomaly detection on Snort alerts, clustering of login events, and a walk-through of training a real classifier in Python with scikit-learn.

ML in Cybersecurity & URL Lab Deep Learning Fundamentals AI Journey