A lightweight and minimalistic implementation of a Linear Regression model written in pure C language, without using any external machine learning libraries. This project is ideal for educational purposes, low-level system integration, and embedded systems where simplicity and performance are critical.
- Simple and clean implementation in C
- Supports single-variable linear regression (y = mx + c)
- Calculates optimal slope (m) and intercept (c)
- Uses least squares method
- Easily extensible to multivariate regression
- No external dependencies
| File | Description |
|---|---|
main.c |
Entry point to train and run model |
main.exe |
Basic Output |
Run ./regression_model
gcc main.c -o main.exe
You can also compile using any IDE or just open main.exe for results.
I used inbuild small dataset, you can use your own .csv file.
- Understand linear regression at a low level
- Explore gradient descent or analytical solutions
- Practice C programming for numerical methods
- Build ML logic without external libraries
This project is released under the MIT License.
Contributions, suggestions, and improvements are welcome! Just open an issue or pull request.