AI ENGINEERING

Linear Regression from Scratch

Linear Regression from Scratch is a machine learning project focused on implementing one of the most fundamental supervised learning algorithms without relying on machine learning libraries such as Scikit-learn or TensorFlow.

YEAR

2026

ROLE

Designed • Developed • Shipped

STACK

PythonNumPyPandasMatplotlib

01/PROBLEM → SOLUTION

02/SYSTEM ARCHITECTURE

How the system fits together

  1. Raw Dataset
  2. Data Validation
  3. Feature Normalizer
  4. Gradient Descent Optimizer
  5. Model Exporter
  6. Prediction Script
DRAG / SWIPE TO PAN DIAGRAM
Raw DatasetCSVData ValidationPANDASFeature NormalizerNUMPYGradient Descent OptimizerTRAINING ENGINECost FunctionERROR CALCULATIONParameter UpdaterWEIGHTS & BIASModel ExporterSTATE PERSISTENCEDisk StorageTHETA VALUESUserCLI INPUTPrediction ScriptINFERENCE PIPELINEOutputESTIMATED PREDICTION

Drag to pan or Hover to trace or Click to inspect

03/KEY ENGINEERING DECISIONS

Zero ML Libraries

Normalization, gradient descent, and inference are hand-written in NumPy no scikit-learn or TensorFlow.

Feature Normalization

Scaling inputs prevents wide-range features from dominating the optimization.

Parameter Persistence

Training and prediction are separated; trained theta is saved to disk and reused without retraining.

04/IMPACT & TAKEAWAYS

Standalone Pipeline. CSV to validate to normalize to train to export to predict, all from scratch.

Reusable Model. Train once, persist, and predict later without re-running optimization.

Convergence Control. Stops when extra iterations yield minimal improvement.