How aryankulkarni11042005/linear-regression-in-cpp works
This is a small C++ linear-regression demo with a hand-written matrix library. The main workflow builds a fixed dataset, normalizes its feature, trains weights with gradient descent, and predicts a new value. Matrix operations support that workflow; separate node/activation helpers are also present but are not part of the regression path. The graph follows the shown calls and README descriptions; it does not infer connections for unsampled code.
Main entry points: matrix.cpp Train regression · matrix.h Matrix operations · main.cpp Program entry · activation.cpp ReLU activation
Components 10
Regression workflow
- Program entry
main.cpp - Train regression
matrix.cpp - Build dataset
matrix.cpp - Normalize feature
matrix.cpp - Predict value
matrix.cpp
Matrix foundation
- Matrix operations
matrix.h - Scalar types
datatype.h
Node primitives
- Weighted sum
weightedSum.cpp - ReLU activation
activation.cpp
Other components
- Program runner
Connections 9
- Program runner → Program entry: runs
main.cpp - Program entry → Train regression: calls
main.cpp - Train regression → Build dataset: builds data
matrix.cpp - Train regression → Normalize feature: normalizes
matrix.cpp - Train regression → Matrix operations: uses
matrix.cpp - Train regression → Predict value: predicts
matrix.cpp - Predict value → Matrix operations: multiplies
matrix.cpp - Matrix operations → Scalar types: uses types
matrix.h - ReLU activation → Weighted sum: uses Node
activation.cpp