Support Vector Machine from Scratch

machine_learning
optimization
Support Vector Machine from Scratch

Tech Stack

C#
Terraform
Azure Container Instances

Description

Deployed here. Implemented an SVM (Support Vector Machine) in C#, using Sequential Minimal Optimization (SMO). No external ML libraries used.

Theory foundation drawn from a video walkthrough and the original SMO paper.

Chose C# for familiarity, despite it being an uncommon language for ML — this forced implementing mathematical functions from scratch, expanding mathematical fluency.

MNIST test with a linear kernel, reduced training set (1-vs-rest, 1000 samples per class): accuracy of 0.97 (9713/9991). Training on the full 60k images produced one-vs-rest accuracies ranging from 87% (8 vs rest) to 98% (0/1 vs rest).

Configured deployment via Terraform to Azure, containerized and run on Azure Container Instances.

  • Implemented an SVM in C# using Sequential Minimal Optimization, without external ML libraries.

  • Wrote core mathematical functions (linear algebra, Lagrange multipliers, kernels) from scratch.

  • MNIST (reduced, 1-vs-rest, linear kernel): accuracy of 0.97.

  • MNIST (full 60k dataset, one-vs-rest): accuracies ranging from 87% to 98% per digit.

  • Containerized and deployed via Terraform to Azure Container Instances.

Page Info

MNIST Results

One-vs-rest accuracy per digit, trained on the full 60k dataset