The Consequence of Curves: Binary Cross-Entropy
When implementing Log Loss in software, engineers must account for the strict mathematical limits of logarithms.
The Geometry of Probability: The Sigmoid Function
The Vulnerability:
Passing a massive negative integer (e.g., ) into the sigmoid function requires the CPU to calculate . This number is astronomically large and exceeds the 64-bit floating-point memory limits of standard Python arrays, resulting in a RuntimeWarning: overflow encountered in exp.
Month 1 Retrospective: The Glass Box Engine
Constructing a production-ready machine learning engine entirely from scratch establishes a transparent mathematical pipeline, bypassing black-box abstractions.
The Capstone Comparison: Custom Engine vs. Scikit-Learn
Production libraries operate as "Black Boxes." They prioritize computational efficiency and abstraction, obfuscating the underlying linear algebra and calculus driving the model's predictions.
Upgrading the Engine: The Regularization Suite
Machine learning architectures enforce a strict mathematical separation in how state variables are handled during training:
The Calculus of Regularization: Ridge (L2)
Why does squaring the weights fix multicollinearity? It comes down to the geometry of exponents.
Evaluation Metrics: The R-Squared Proof
Mean Squared Error (MSE) is great for the Gradient Descent loop, but it is terrible for human evaluation. An MSE of 15,000 doesn't mean anything unless you know the scale of the dataset. normalizes the error into a scale-free ratio, acting much like a percentage score.
Feature Engineering: Bending the Matrix
"Linear regression is not weak. It’s actually very powerful if you give it the right representation."
Synthetic Data Generation: Simulating Reality
When generating this dataset, we intentionally injected a fatal flaw that ruins naive linear regression: Multicollinearity.