Statistics & Machine Learning Demo Examples
Zero-dependency Python 3 scripts implementing core statistics, data cleaning, gradient descent, evaluation metrics, and fairness checks from first principles. Click View to inspect any script in the code viewer.
For statistical textbooks, scikit-learn/PyTorch documentation, and responsible AI frameworks, see References.
Phases 1–2: Data Preparation & Statistics
Standard-library Python scripts for summary statistics, record cleaning, and correlation analysis.
| # | Script | Description | Link |
|---|---|---|---|
| 1 | Descriptive Statistics | Computes mean, median, standard deviation, and IQR on latency samples. | View |
| 2 | Data Cleaning Pipeline | Deduplicates records, imputes missing values with median, and min-max normalizes. | View |
| 3 | Pearson Correlation | Calculates Pearson's r between two numeric feature vectors from scratch. | View |
Phases 3–4: Modeling, Evaluation & Fairness
Gradient-descent linear regression, imbalanced classification metrics, and subgroup parity auditing.
| # | Script | Description | Link |
|---|---|---|---|
| 4 | Linear Regression (GD) | Fits y = wx + b via batch gradient descent and logs MSE per 100 epochs. | View |
| 5 | Confusion Matrix Metrics | Computes accuracy, precision, recall, and F1 on an imbalanced dataset. | View |
| 6 | Subgroup Fairness Audit | Measures selection rate and true-positive rate gaps across protected groups. | View |