Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.47 KB

File metadata and controls

56 lines (38 loc) · 1.47 KB

Regression Model in C

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.


Features

  • 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

Files

File Description
main.c Entry point to train and run model
main.exe Basic Output

How to Run

Compile

Run ./regression_model

gcc main.c -o main.exe

You can also compile using any IDE or just open main.exe for results.


Dataset Format

I used inbuild small dataset, you can use your own .csv file.


Learning Goals

  • 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

License

This project is released under the MIT License.

Contributing

Contributions, suggestions, and improvements are welcome! Just open an issue or pull request.