EZ LearnEZ Learn
Courses
EZ Board
Dashboard
All articles
cyber-law-and-iprmlcsrevisionself-study

Unit 1 Quick Reference, Self-Study and Lab

Every idea from this unit in one table, followed by six questions and a hands-on exercise: counting how imbalanced your own inbox already is before Unit 5 formalises feature engineering.

Ashish Revar23 October 20265 min read1 views

Unit Summary and Quick Reference

TopicCore idea
Three ML familiesSupervised (labelled), unsupervised (unlabelled), reinforcement (reward-driven) learning, each matched to a different security problem in this course
Four threat familiesMalware, social engineering, network intrusion, and fraud/abuse, each favouring a different family of model
The spam arms racePaul Graham's 2002 Naive Bayes approach to spam outlasted keyword blacklists because it learns from data rather than a fixed rule list
The ML pipelineCollect, engineer features, train, evaluate, deploy and monitor, the five stages every unit in this course builds
Class imbalanceEven ordinary spam data is imbalanced; fraud and intrusion data are far more so, a theme that returns in Units 2 and 6

Self-Study Questions

Q1. Why does a keyword blacklist eventually fail against a motivated spammer, even one with no technical sophistication?

A blacklist only blocks exactly what it was told to block, specific sender addresses or specific words. It has no memory of anything it was not explicitly given. A spammer who misspells a blocked word or rotates to a fresh, unlisted sending address slips past it entirely, with no need for any technical sophistication, just small variation.

Q2. Name the three families of machine learning used in this course, and match each to the kind of training data it requires.

Supervised learning requires already-labelled data, such as emails marked spam or legitimate. Unsupervised learning requires no labels at all; the model finds structure on its own. Reinforcement learning requires no fixed dataset at all; an agent takes actions in an environment and learns from the rewards it observes over time.

Q3. Why might a security dataset be described as "imbalanced," and why does this matter for a model's evaluation, not just its training?

A dataset is imbalanced when one class, such as spam, fraud, or intrusion traffic, is far rarer than the other. This matters for evaluation because a model can achieve a very high accuracy score simply by predicting the majority class every time, while being useless at catching the rare, important class. Unit 6 covers metrics built specifically to expose this.

Q4. Walk through the five-stage ML pipeline for a network intrusion detection system: what would "collect," "engineer features," and "deploy and monitor" concretely mean in that setting?

Collect would mean gathering raw network traffic, such as packet captures or flow records. Engineer features would mean turning that raw traffic into numeric measurements a model can use, such as packet counts, connection duration, or protocol flags. Deploy and monitor would mean running the trained detector on live traffic while tracking whether its accuracy holds up as network behaviour and attacker techniques drift over time, retraining when it does not.

Q5. Pick any two non-adjacent stages of the Cyber Kill Chain and explain, for each, which family of machine learning from this unit would help a defender most, and why.

Reconnaissance is best addressed by unsupervised anomaly detection (Unit 3), since scanning traffic has no fixed label and needs to be flagged as unusual relative to a baseline. Delivery is best addressed by supervised learning (Unit 1, Unit 5), since phishing and spam classifiers are trained on labelled examples of malicious versus legitimate messages.

Q6. Using the timeline figure, explain in your own words why offensive and defensive machine learning milestones tend to alternate rather than one side simply winning permanently.

Every defensive advance, such as a new statistical spam filter or malware classifier, creates an incentive and a target for attackers to find a way around it, and every successful attack then creates pressure for a stronger defensive response. This is the same arms-race dynamic security has always had, now playing out between models as well as between humans, which is why the timeline shows offensive and defensive milestones pushing each other forward rather than either side settling the matter once and for all.

Lab: Extend the Spam Classifier

  1. Reproduce the baseline. Using the naive_bayes_spam.py script from this unit, train the classifier on any public spam/ham dataset (such as the classic SpamAssassin public corpus) and confirm you can reproduce a classification report in the same shape as the one shown in this unit.
  2. Break the blacklist on purpose. Take five sentences the blacklist filter correctly flags, and rewrite each one with a single character substitution (e.g. "viagra" to "v1agra"). Run both is_spam_blacklist and the trained Naive Bayes classifier on your rewritten sentences and record which one still catches them.
  3. Measure the imbalance. Count the exact number of spam versus legitimate messages in whichever dataset you used, and compare the ratio to the 4,827 to 1,813 (roughly 3 to 1) ratio shown in this unit's chart.
  4. Map one real tool. Pick one security product you have used (an email provider, an antivirus, a bank's fraud alert) and write two sentences on which threat family from this unit it defends against and which family of machine learning it most likely uses.

Discussion

Loading comments…
More articlesTest your knowledge
EZ MentorAI · Free

Unit 1 Quick Reference, Self-Study and Lab

Hi! I'm EZ Mentor

Your AI tutor for
Unit 1 Quick Reference, Self-Study and Lab

Sign in to ask, it's free.

EZ Mentor is AI-powered · Answers may not be perfect · 10 free questions / day

EZ LearnEZ Learn

Structured learning across Reverse Engineering, Cloud Security, and Research Methodology, plus games and practice tools in EZ Arena. Free, and open to anyone.

EZ Learn

  • Courses
  • EZ Articles
  • EZ Watch
  • EZ Talks
  • EZ Bytes
  • Cyber Hygiene

EZ Library

  • All Resources
  • eBooks & PDFs
  • Question Banks
  • MCQ Banks
  • Cheatsheets

EZ Exams

  • All Exams
  • REMA
  • Cloud Security
  • Research Methodology
  • Python for Cyber Security
  • Cyber Law & IPR
  • Community
  • EZ Board

EZ Arena

  • EZ Games
  • Live Quiz
  • ML Challenges
  • दिशा - Hygiene
  • सजग - Awareness
  • अभ्यास - Practice

Platform

  • About
  • Contact
  • Terms of Use
  • Disclaimer
  • Verify Certificate
  • Events

© 2026 EZ Learn by EpochZero. Educational content for learning purposes.

Platform Lead: Ashish Revar