Solved Numerical Examples
Follow exact mathematical breakdowns of popular algorithms. Perfect for exam preparation, these step-by-step guides show you exactly how to trace formulas and data structures by hand.
Machine Learning
Step-by-step solved problems for classifiers and regressors. See exact entropy calculations, matrix inversions, and distance formulas.
Naive Bayes Classifier
Calculates prior and conditional probabilities step-by-step to predict a class label using Bayes' Theorem.
Confusion Matrix & Evaluation Metrics
Derives Accuracy, Precision, Recall, and F1 Score from a 2×2 matrix of TP, TN, FP, and FN counts.
Decision Tree (ID3)
Calculates Entropy and Information Gain for each feature to determine the optimal recursive splits.
K-Means Clustering
Iteratively assigns points to nearest centroids and recomputes centroid means until cluster assignments converge.
K-Nearest Neighbors (Classification)
Computes Euclidean distances from a query point to all training points, then votes among K nearest neighbors.
K-Nearest Neighbors Regression
Computes Euclidean distances from a query point to all training points, then averages the K nearest target values.
Linear Regression
Derives the slope and intercept using the least squares formula, then predicts a continuous target value.
Multiple Linear Regression
Solves the Normal Equation β = (XᵀX)⁻¹Xᵀy using matrix operations to find all feature coefficients simultaneously.
Random Forest Classifier
Runs ID3 on three bootstrap samples with restricted feature subsets, then aggregates predictions by majority vote.
Stuck on a specific problem? Request an example