Conversation
Rosander0
requested review from
Panquesito7 and
realstealthninja
as code owners
September 9, 2026 05:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
This PR adds Binary Logistic Regression to the Machine Learning module—a foundational supervised learning algorithm for binary classification problems.
What it does:
Implements logistic regression using batch gradient descent with numerically stable sigmoid computation
Supports probability prediction, class prediction with adjustable decision threshold, and accuracy scoring
Includes comprehensive Doxygen documentation with mathematical notation for the sigmoid function, binary cross-entropy loss, and gradient descent updates
Why it matters:
Fills a gap in the ML folder (currently has KNN, Adaline, Neural Networks, but no regression-based classifiers)
Complements the existing Linear Regression by showing how to extend it for classification via the sigmoid transformation
Practical for real-world use (spam detection, disease diagnosis, churn prediction) while remaining interpretable and fast to train
Technical details:
Time complexity: O(N × F × I) where N = samples, F = features, I = iterations
Space complexity: O(F) for weights storage
Validates input (binary labels 0/1, feature consistency, size matching)
Includes a self-contained test with synthetic linearly-separable data that achieves 100% training accuracy and demonstrates probability predictions
Testing:
Built-in test creates 8 samples (4 class 0, 4 class 1) in 2D space
Verifies convergence (loss decreases over 500 iterations)
Confirms predictions match true labels and probabilities are calibrated correctly
Validates single-sample and batch prediction modes
Notes: