Milestone Gate 1: Foundations Validation

A timed gate to validate core ML foundations before moving to model architecture depth.

Before you go deeper into model architecture, neural networks, or production systems, you need to be honest with yourself about whether your foundations are solid. This gate is a structured self-assessment. It is pass/no-pass, not graded on a curve.

The bar here is not academic fluency. It is practical competence: can you do the things an ML engineer is expected to do on their first week on the job?

What This Gate Tests

The ML Foundations gate covers four domains:

  1. Supervised vs. unsupervised learning - not just definitions, but when to use each
  2. Model quality evaluation - metrics, splits, cross-validation, leakage
  3. Algorithm selection - which algorithm family fits which problem
  4. Data understanding - distributions, correlations, missing values

Domain 1: Supervised vs. Unsupervised

You should be able to classify any ML problem as supervised or unsupervised (or semi-supervised) without hesitation. More importantly, you should understand why the distinction matters for choosing your approach.

python
from sklearn.datasets import make_blobs, make_classification from sklearn.cluster import KMeans from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.metrics import adjusted_rand_score, accuracy_score import numpy as np # Supervised: you have labels X_sup, y_sup = make_classification(n_samples=500, n_features=10, random_state=42) X_train, X_test, y_train, y_test = train_test_split(X_sup, y_sup, test_size=0.2) lr = LogisticRegression() lr.fit(X_train, y_train) print(f"Supervised accuracy: {accuracy_score(y_test, lr.predict(X_test)):.4f}") # Unsupervised: no labels, discover structure X_unsup, true_labels = make_blobs(n_samples=500, centers=4, random_state=42) kmeans = KMeans(n_clusters=4, random_state=42, n_init='auto') pred_labels = kmeans.fit_predict(X_unsup) print(f"Clustering ARI: {adjusted_rand_score(true_labels, pred_labels):.4f}")

Self-check: Can you name two real business problems for each paradigm? Can you explain why you cannot use accuracy to evaluate a clustering result?

Domain 2: Model Quality Evaluation

This is where most beginners have gaps. The ability to evaluate a model correctly is more important than the ability to train one.

python
from sklearn.model_selection import StratifiedKFold, cross_val_score from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import (classification_report, confusion_matrix, roc_auc_score, average_precision_score) X, y = make_classification(n_samples=1000, n_features=20, weights=[0.8, 0.2], random_state=42) model = RandomForestClassifier(n_estimators=100, random_state=42) # Stratified CV - preserves class balance in each fold cv = StratifiedKFold(n_splits=5, shuffle=True, random_state=42) scores = cross_val_score(model, X, y, cv=cv, scoring='roc_auc') print(f"ROC-AUC: {scores.mean():.4f} ± {scores.std():.4f}") # Fit and evaluate on hold-out X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, stratify=y, random_state=42) model.fit(X_train, y_train) y_proba = model.predict_proba(X_test)[:, 1] print(f"ROC-AUC (hold-out): {roc_auc_score(y_test, y_proba):.4f}") print(f"PR-AUC (hold-out): {average_precision_score(y_test, y_proba):.4f}") print(classification_report(y_test, model.predict(X_test)))

You must be able to explain: why stratified CV matters for imbalanced datasets, why you never use accuracy on imbalanced data, and what the difference between ROC-AUC and PR-AUC is.

Domain 3: Algorithm Selection

Given a problem description, you should be able to propose a starting algorithm family and justify your choice.

ProblemStarting Algorithm
Binary classification, tabular data, 100K rowsGradient boosted trees (XGBoost, LightGBM)
Regression, high-dimensional sparse featuresLasso / Ridge regression
Clustering, unknown number of groupsDBSCAN or GMM
Recommendation, user-item interactionsMatrix factorization or two-tower model
Text classificationFine-tuned transformer or TF-IDF + logistic regression
Anomaly detection, no labelsIsolation Forest or Autoencoder

You do not need to justify the best answer. You need to justify a reasonable answer.

Domain 4: Data Understanding

python
import pandas as pd import numpy as np df = pd.DataFrame({ 'age': np.random.randint(18, 70, 1000).astype(float), 'income': np.random.exponential(50000, 1000), 'churn': np.random.binomial(1, 0.15, 1000) }) df.loc[np.random.choice(1000, 50, replace=False), 'age'] = np.nan # The minimum data understanding checklist print(df.describe()) print(df.isnull().sum()) print(df['churn'].value_counts(normalize=True)) # class balance print(df.corr(numeric_only=True))

You should be able to answer: what is the distribution of each feature, how many missing values are there and why might they be missing, is the target imbalanced, and what are the obvious correlations?

Pass/No-Pass Criteria

Pass (proceed to model architecture depth) if you can:

  • Correctly classify 5 problem descriptions as supervised/unsupervised without assistance
  • Write a 5-fold stratified CV evaluation from memory
  • Choose an appropriate starting algorithm for 4 out of 5 problem descriptions with justification
  • Perform a basic data audit (nulls, distributions, class balance) in pandas

No-pass (spend more time on foundations) if you:

  • Needed to look up how to do stratified CV
  • Cannot explain why accuracy is misleading on a 95/5 class split
  • Cannot distinguish ROC-AUC from PR-AUC by use case
  • Have not worked with real data that had missing values or imbalance

Common Mistakes

The most common failure mode is skipping exploratory data analysis and jumping directly to model training. Engineers from a software background want to write code, and data exploration feels passive. But a model trained on poorly understood data is rarely trustworthy.

Where to Go Next

Related Posts

More posts

Model Selection Guide: When to Use Which ML Algorithm

A practical decision framework for choosing the right machine learning algorithm - from linear models to gradient boosting to neural networks - based on your data, constraints, and goals.

#decision-tree#model-selection#reference#algorithms

Evaluation Metrics Guide: Which Metric to Use and When

Accuracy is rarely the right metric. This guide explains every major ML evaluation metric - classification, regression, ranking, and generation - with clear guidance on when to use each one.

#regression#evaluation#metrics#ranking#reference#classification

Python ML Quick Reference

The NumPy, Pandas, and scikit-learn one-liners you reach for every day - organized by task so you spend less time searching and more time building.

#python#scikit-learn#numpy#pandas#reference