Intrusion and anomaly detection, malware analysis, threat intelligence, phishing, security logs and incident response: defensive experiments that really compute in your browser on synthetic data, with algorithms, datasets, projects and quizzes.
- Home
- AI Intrusion Detection
- Cyber Anomaly Detection
- Malware Analysis
- Cyber Threat Intelligence
- AI Network Security
- AI Phishing Detection
- AI Security Log Analytics
- AI Incident Response
- Algorithm Library
- Datasets Repository
- Learning Roadmap
- Projects
- Quizzes and Challenges
- Experiment Workbench
- Research and Metrics
- My experiments
- Scientific references
- Glossary and FAQ
Linear SVM (Pegasos)
Algorithm Library · Algorithm Supervised Learning Runs in the browser
The idea
Finds a maximum-margin separating hyperplane, trained here with Pegasos stochastic gradient descent on the hinge loss.
The problem it addresses
Strong linear separation in high dimensions such as TF-IDF.
Data it needs
High-dimensional sparse or dense data.
Equations
\min_w \tfrac{\lambda}{2}\lVert w\rVert^2+\tfrac1n\sum_i\max(0,1-y_i w^\top x_i)Steps
- Pick a random sample
- If it violates the margin, update w
- Shrink w by the regulariser
Pseudocode
for t in 1..T:
i = rand(n); eta = 1/(lam*t)
w *= (1 - eta*lam)
if y[i]*(w@x[i]) < 1: w += eta*y[i]*x[i]Strengths
- Effective in high dimensions
- Clear margin
Limitations
- No direct probabilities
- Needs scaling
- Only the linear version is implemented here
Uses in cybersecurity
- Phishing text classification
- Files with many features
Common pitfalls
- A fair comparison tunes the regularisation strength for every model rather than using defaults.
Suggested datasets
Related experiments
References
- Arp, Quiring, Pendlebury, Warnecke, Pierazzi, Wressnegger, Cavallaro, Rieck (2024). Pitfalls in Machine Learning for Computer Security. Communications of the ACM 67(11), pp. 104-112. doi:10.1145/3643456
