Skip to content

ManojC0/linear-regression-cpp-iris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Iris Linear Regression with Gradient Descent (C++ and Python)

This project implements a simple linear regression model using gradient descent from scratch using C++, applied to the Iris dataset across all 3 plant species. The regression line is visualised in Python using matplotlib. Image

What I did

  • C++ implementation of gradient descent.
  • Use 1 feature (sepal length) to predict another (petal length).
  • Visualise predictions.

What I learned

  • C++ CSV file handling.
  • Overloading C++ operators (e.g., >>).
  • Mathematics behind gradient descent.

What I'd do next

  • Support more features (multiple linear regression).
  • Test the gradient descent function on other datasets.

Dataset

  • Iris Dataset: A dataset containing the sepal/petal length & width for 3 plant species.
  • I used on 2 numerical columns in the project, the sepal length and the petal length.
  • Source: https://archive.ics.uci.edu/

The dataset is included in /data/iris.csv for convenience.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors