ENGINEER · PILOT · BUILDER

ML & Data · 2021–2023

Machine Learning Studies

Built an inspectable MNIST clustering classifier, compared wine-quality models under class imbalance, and visualized the behavior of core machine-learning methods.

Project type
Machine-learning study collection · classification, evaluation, and foundations
Role
MNIST clustering and reporting; wine-quality neural nets and writing; algorithm notebooks individual
Maturity
Study collection
Collaboration
MNIST with Ethan Nussinov; wine-quality with Ben Ko and Ben Watkins; algorithm notebooks individual
MNIST digit clustering
K-means pipeline
Wine-quality classification
Model comparison
Per-class evaluation
Imbalance analysis
Regression, margins, and neural nets
ML foundations
Read the MNIST case-study report
01

What the studies covered

This page brings together two substantial classification studies and a visual algorithm archive. The MNIST project builds an inspectable k-means digit classifier from scratch. The wine study compares model families on an imbalanced dataset and shows why per-class performance matters. Supporting notebooks make concepts such as learning rate, margin, regularization, and model capacity visible.

SYSTEM ARCHITECTURE

MNIST centroid classifier

28 × 28 image → 784-vector → k-means (k = 26) → nearest centroid → digit label + outlier flag

The complete pipeline—from centroid initialization and assignment to labeling and outlier detection—was implemented directly in MATLAB so every stage could be inspected and plotted.

Wine-quality comparison

11 physicochemical features → EDA / PCA / imbalance treatment → RF, SVM, ANN, logistic regression → per-class metrics

Exploratory analysis established the class imbalance and feature structure before several classifier families were compared on original and rebalanced training data.

Visual algorithm studies

controlled dataset → implemented method → diagnostic plot

Focused notebooks isolate how step size, regularization, decision boundaries, polynomial degree, and network width change a model's behavior.

02

How the models were evaluated

  1. STAGE 01

    Build and test the MNIST baseline

    Implemented k-means on 1,500 flattened MNIST images, assigned digit meanings to 26 learned centroids, and classified a 200-image test set.

  2. STAGE 02

    Understand the wine dataset

    Explored 1,599 red-wine samples with feature distributions, a correlation heatmap, PCA, and univariate scoring before training classifiers.

  3. STAGE 03

    Compare models under class imbalance

    Compared random forests, SVMs, multilayer perceptrons, and logistic regression across original and rebalanced variants, then checked per-class performance on a held-out test set.

  4. STAGE 04

    Visualize the underlying algorithms

    Built focused notebooks showing how learning rate, polynomial degree, separability, SVM regularization, and network width affect fitted models.

03

Key modeling decisions

Keeping the MNIST baseline interpretable

K-means made the complete classification path visible, but its result depended on a manually chosen k and centroid initialization. The 73.5 percent score represents one documented baseline run, not an optimal digit recognizer.

Looking beyond aggregate accuracy

Wine-quality classes 5 and 6 dominated the dataset. The selected random forest reached 70 percent accuracy, yet several rare classes still had zero precision and recall, making the per-class report more informative than the headline score.

Understanding what rebalancing changes

Oversampling, undersampling, and SMOTE improved some minority-class results while changing the training distribution and sometimes reducing performance on the original test distribution.

04

What the experiments showed

  • The MNIST baseline correctly labeled 147 of 200 test images (73.5 percent), with learned-centroid images, a convergence curve, prediction overlays, and 11 flagged outliers.
  • Wine-quality analysis visualized feature correlations and PCA class overlap before any classifier was selected.
  • The selected random forest reached 70 percent accuracy on a 320-sample test split, while its class report exposed weak performance on rare quality scores.
  • The supporting plots demonstrate gradient descent, least squares, perceptrons, RBF SVMs, neural-network capacity, and polynomial underfitting and overfitting.
05

What I took from them

A transparent baseline made the MNIST errors inspectable, even though a more advanced classifier could achieve higher accuracy.

The wine study showed why aggregate accuracy must be read alongside class balance, precision, recall, and the test distribution.

Focused visual experiments made abstract choices such as step size, regularization, margin, and model capacity easier to reason about.

06

Report and analysis

NEXT PROJECT / 13

Signals & Digital Communication Studies