Math Graduate Transitioning to ML Engineer: A Complete Analysis of Portfolio Project Methodology

Deconstructing a math grad's first ML portfolio: dataset shift, model comparison, and real-world thinking
A math graduate shares his first ML portfolio project focusing on dataset shift in image classification. The project demonstrates practical ML engineering skills through imbalanced classification handling, SVM vs Random Forest comparison, PCA dimensionality reduction, and robustness testing—offering valuable lessons for aspiring ML engineers on building portfolios that showcase real-world problem-solving rather than just technical prowess.
Math Graduate Transitioning to ML Engineer: A Complete Analysis of Portfolio Project Methodology
For recent graduates looking to transition into AI/ML engineering, a portfolio often speaks louder than a resume. Recently, a newly graduated math major shared his first machine learning portfolio project on Reddit, earnestly seeking community feedback on both methodology and GitHub presentation. While modest in scale, this project touches on several highly representative core issues in machine learning engineering, making it a valuable reference for beginners.
Project Overview: A Portfolio Targeting Entry-Level ML Engineer Positions
According to the math graduate, this project represents a systematic integration of knowledge acquired during university, aimed squarely at junior AI/ML engineer positions. Hosted on GitHub (RithinBhudia/image-classification-dataset-shift), the project name immediately reveals its core focus—the dataset shift problem in image classification.

Dataset shift is a widely researched yet still often underestimated problem in machine learning practice. It primarily includes three subtypes: covariate shift, where input feature distributions change but conditional label distributions remain constant; prior probability shift, where the marginal distribution of labels changes; and concept drift, where the mapping relationship between inputs and outputs itself changes. The 2009 book "Dataset Shift in Machine Learning" by Quiñonero-Candela and colleagues systematized the theoretical framework for this field. In industry, the consequences of dataset shift can be severe—for example, autonomous driving systems experiencing sharp performance drops under different weather conditions, or financial risk control models suddenly failing when economic cycles shift.
This project's topic selection is quite clever. Rather than stopping at simply "training a classifier," it focuses on one of the trickiest problems in real production environments: what happens to models when training and test data distributions are inconsistent? This is precisely what many beginner projects overlook, yet it's a capability that industry values most.
Methodology Breakdown: Key Technical Points in ML Portfolio Projects
From the author's description, this project links multiple stages of the machine learning pipeline, forming a complete technical chain.
Imbalanced Image Classification
The project first addresses imbalanced classification. In real-world image data, sample quantities across categories often vary dramatically—for instance, normal samples far outnumber pathological samples in medical imaging. Direct training can easily cause models to "take shortcuts" by favoring the majority class, resulting in extremely poor recognition of minority classes.
The industry has developed three major strategies for handling imbalanced classification. Data-level methods include oversampling minority classes (with SMOTE being the most famous, generating synthetic samples by interpolating between minority class samples), undersampling majority classes, or combining both. Algorithm-level methods include adjusting class weights in the loss function (cost-sensitive learning), or using loss functions specifically designed for imbalanced scenarios like Focal Loss. Evaluation metric adjustments are equally critical: in extremely imbalanced data, a model can achieve high accuracy simply by predicting all samples as the majority class, necessitating a shift toward more discriminative metrics like precision-recall curves (PR curves), F1 scores, Matthews correlation coefficient (MCC), or AUC-ROC. The ability to recognize and handle this problem demonstrates a clear understanding of real data complexity.
Cross-Comparison of SVM and Random Forest
The project compares two classic algorithms: Support Vector Machines (SVM) and Random Forest. This choice is quite meaningful: in an era when deep learning nearly dominates the image domain, the author returns to comparative analysis of traditional machine learning models.
From an algorithmic perspective, these two represent fundamentally different modeling philosophies. SVM's core idea is finding an optimal hyperplane in feature space that maximizes the margin between different classes; through the kernel trick, SVM can perform nonlinear classification in high-dimensional spaces without explicitly computing high-dimensional mappings. Random Forest, proposed by Leo Breiman in 2001, is an ensemble learning method that constructs numerous decision trees through Bootstrap sampling and random feature selection, ultimately outputting predictions through voting or averaging. A key difference: SVM performs excellently on high-dimensional sparse data but requires longer training times for large-scale data, while Random Forest naturally supports parallelization and is less sensitive to hyperparameters. Comparing these algorithms in image classification tasks reveals the deep influence of data characteristics on model selection.
This not only demonstrates solid understanding of classic algorithm principles but also reflects a pragmatic attitude—not all scenarios require expensive deep networks; understanding model applicability boundaries is equally important.
PCA Dimensionality Reduction and Robustness Testing
The project also introduces Principal Component Analysis (PCA) for dimensionality reduction and robustness testing for train-test distribution shifts.
PCA is a linear algebra-based dimensionality reduction technique whose core involves eigendecomposition of the data covariance matrix (or singular value decomposition of the data matrix), finding directions of maximum data variance as new coordinate axes. For image data, PCA dimensionality reduction is especially critical: a 64×64 grayscale image has 4096 pixel features; directly inputting into traditional ML models is not only computationally expensive but also prone to the "curse of dimensionality"—in high-dimensional spaces, distances between data points tend to become uniform, causing distance-based algorithms (like SVM kernel computations) to perform poorly. By retaining the top k principal components, PCA can reduce feature dimensionality by one to two orders of magnitude while losing minimal information, significantly improving training efficiency and model generalization.
Robustness testing in the machine learning context refers to systematically evaluating model performance when input data deviates from the training distribution. Common methods include adversarial perturbation testing (like FGSM, PGD attacks), out-of-distribution detection, and artificially constructed covariate shift scenarios. This methodology aligns with the concept of "ML technical debt" from Google's classic 2015 paper "Hidden Technical Debt in Machine Learning Systems"—the paper points out that the greatest challenges facing real-world ML systems are often not the models themselves, but distribution changes quietly occurring in data pipelines.
These two points combined constitute the project's most valuable aspect: by actively constructing distribution shift scenarios and testing model performance under such shifts, the author is essentially simulating "environmental changes" the model might encounter after deployment. This critical examination of model generalization ability is the watershed distinguishing "getting a demo to run" from "understanding ML engineering."
Why "Dataset Shift" Is a Plus for ML Job Hunting
It's worth emphasizing separately that this project places "distribution shift" at its core. In academic teaching, we typically assume training and test sets come from the same distribution (the i.i.d. assumption). The independent and identically distributed (i.i.d.) assumption is a cornerstone of classical statistical learning theory and a prerequisite for PAC learning frameworks and VC dimension theory—under this assumption, both training and test samples are independently drawn from the same unknown but fixed probability distribution.
However, in industrial practice, this assumption is almost always violated—user behavior changes, data collection devices update, business scenarios migrate. Recommendation systems face continuous evolution of user interests, NLP models must adapt to shifts in language usage habits, and computer vision models may encounter image style differences from different cameras, lighting conditions, or geographic regions. Recently emerging research directions like Domain Adaptation, Domain Generalization, and Continual Learning represent academia's systematic response to this fundamental challenge.
A candidate who recognizes the distribution shift problem and proactively designs experiments to quantify its impact demonstrates engineering thinking rather than mere hyperparameter-tuning thinking. This also explains why such a project with seemingly "traditional" tech stack might actually stand out in job hunting: it's not saying "I can use a certain library," but rather "I understand how models fail in the real world and how to respond."
Practical Advice for Beginners Building ML Portfolios
Considering the three dimensions the author seeks feedback on—whether the methodology is rigorous, whether README/notebooks are clear, and how to make the project more compelling for entry-level positions—we can extract some universal advice.
Clear Narrative Beats Complex Models
Recruiters reviewing portfolios have extremely limited time. A well-structured README that explains within the first few lines "what problem this project solves, what methods were used, and what conclusions were reached" is often more effective than piling up code. Each step's motivation, decision rationale, and result interpretation in notebooks should flow like a story.
Demonstrate Critical Thinking
What truly enhances a project isn't "the model achieved 95% accuracy," but rather "when distribution shifted, accuracy dropped by X%, why, and what mitigation approaches I tried." This honest discussion of limitations is precisely the mark of a mature engineer.
Reproducibility and Engineering Standards
For portfolios targeting engineering positions, code reproducibility (dependency lists, fixed random seeds, clear directory structure) is itself part of capability. While these details don't involve "sophisticated algorithms," they directly reflect a candidate's engineering literacy. Worth noting, the reproducibility crisis plagues not only academia—a 2019 survey of ML research papers found over 60% of results difficult to independently reproduce. Demonstrating rigorous reproduction processes in portfolios both shows responsibility for one's work and proves to potential employers you can reliably transform experimental results into production code.
Conclusion
This math graduate's project is essentially a sample of "how to tell a good technical story with limited resources." It reminds us that an excellent entry-level ML portfolio doesn't necessarily require flashy models or massive datasets, but rather whether it touches the essence of real problems—data imbalance, model comparison, distribution shift, and robustness are all microcosms of daily ML engineering work. For fellow learners on the job-hunting path, rather than chasing the latest model architectures, it's better to settle down and thoroughly explain a problem close to actual practice.
Related articles

Building an AI Robot Dog for Kids: Multi-Model Routing, Content Filtering, and Latency Optimization
A $130 AI robot dog for kids integrates 8 LLMs with 61-language voice interaction. The team shares key engineering lessons on content safety filtering, multi-LLM intent routing, and sub-1-second latency optimization.

Can Omarchy Dominate the Sub-$1000 Laptop Market? An In-Depth Analysis
Omarchy, based on Arch Linux, shows unique advantages in the sub-$1000 laptop market. This analysis compares Windows and MacBook performance bottlenecks on low-spec hardware and examines why Omarchy enables cheap laptops to run smoothly, plus the ecosystem challenges and market prospects it faces.

AI Agent Beginner's Guide: Building a Creative Strategy Intelligent Assistant from Scratch
A complete guide to building a creative strategy AI Agent from scratch. No coding required — use tools like Dify and Coze to quickly build an intelligent assistant.