Machine Learning

home

Built a complete machine learning pipeline in Python to train a linear classifier model on the MNIST dataset, applying fundamental ML concepts including cross-entropy loss, backpropagation, and bias-variance tradeoff. The model achieved 90% accuracy. Leveraged PyTorch for model architecture and training, managing DataLoaders, and implementing L2 regularization via weight decay. Conducted greedy 1D hyperparameter search across learning rate, weight decay, and batch size to optimize model performance. Applied ML best practices including GPU acceleration (CUDA/Apple Silicon MPS), fixed-seed reproducibility, and train/validation/test splitting. Visualized results using Matplotlib and Seaborn, including loss/accuracy curves and a confusion matrix. Documented the full mathematical foundation from logit computation to the SGD weight update rule in a Jupyter Notebook.

Check out the notebook: MNIST Linear Classifier, on GitHub

In this image from the Jupyter Notebook, you can see the model's predicted labels for the digits vs their true labels.

Predictions Summary

Like the previous image, this one provides more insights into the model's predictions. The model achieved around 90% accuracy every run (of the whole notebook) but you can notice small deviations in the heatmap.