Machine Learning
Statistical Models, Deep Learning & AI Systems
Machine Learning covers algorithms that learn patterns from data. From classical statistical models to modern Large Language Models (LLMs), ML powers modern intelligent software.
Track Curriculum
Subtopics & Modules
Supervised Learning
Linear & Logistic Regression, Decision Trees, Random Forests, SVM, and evaluation metrics.
Unsupervised Learning
K-Means clustering, Principal Component Analysis (PCA), hierarchical clustering, and t-SNE.
Neural Networks & Deep Learning
Perceptrons, backpropagation, activation functions (ReLU, Sigmoid), PyTorch, and gradient descent.
Natural Language Processing (NLP)
Tokenization, TF-IDF, Word2Vec embeddings, RNNs, LSTMs, and sentiment analysis.
Computer Vision & CNNs
Convolutions, pooling layers, ResNet, object detection (YOLO), and image segmentation.
Transformers & LLMs
Self-Attention mechanism, Scaled Dot-Product, BERT, GPT, Fine-tuning, LoRA, and RAG.
Model Deployment & MLOps
Model quantization, ONNX, Triton inference server, MLflow tracking, and drift monitoring.
Interview Questions by Module Topic
Select a module to view its related questions, or explore all modules organized by seniority level
Supervised Learning
The Bias-Variance tradeoff defines a fundamental tension in supervised machine learning. Expected test error decomposes into three additive components: Error = Bias² + Variance + Irreducible Error. Bias measures the error originating from overly simplistic assumptions in the learning algorithm. High bias causes underfitting: the model fails to capture complex underlying relationships in the data. Both training loss and validation loss remain high and stagnate early. Variance measures the model's sensitivity to random fluctuations and noise in the training set. High variance causes overfitting: the model memorizes idiosyncratic noise rather than generalizable signals. In loss curves, training loss drops monotonically toward zero, while validation loss bottoms out and begins diverging upward. The optimal model minimizes total generalization error at the inflection point where validation loss reaches its minimum before variance drives it upward.
import numpy as np
def compute_loss_curves(X_train, y_train, X_val, y_val, max_degrees=10):
train_errors = []
val_errors = []
for degree in range(1, max_degrees + 1):
# Generate polynomial feature expansion
poly_train = np.vander(X_train, degree + 1, increasing=True)
poly_val = np.vander(X_val, degree + 1, increasing=True)
# Fit least squares weights using Normal Equation
weights = np.linalg.pinv(poly_train) @ y_train
# Compute Mean Squared Error (MSE)
train_mse = np.mean((poly_train @ weights - y_train) ** 2)
val_mse = np.mean((poly_val @ weights - y_val) ** 2)
train_errors.append(train_mse)
val_errors.append(val_mse)
# Detect optimal degree minimizing validation error
best_degree = np.argmin(val_errors) + 1
return {
"best_degree": best_degree,
"train_errors": train_errors,
"val_errors": val_errors
}🔍 Code Mechanics (Python): 1. Sweeps polynomial model capacity from low degree (high bias) to high degree (high variance). 2. Computes train and validation MSE for each model capacity. 3. Diagnoses overfitting where training loss continues decreasing while validation loss diverges upward. 4. Identifies the optimal complexity balancing bias and variance.