Table of Contents
The project is about training a linear model able to predict the price of a car based on the driven mileage.
So the formular to achieve is:
with m
and c
having to be found by the training alogrithm.
For finding the coeficciants the project is using the Gradient Descent algorithm,
which uses the mean squared error as loss function:
The following contains a description of how to use the program.
To run the programs you have to have python3 and pip3 installed. See an installation guide here After, you have to clone the repository and install the libraries used in this project.
git clone https://github.com/oph-design/ft_linear_regression
pip3 install -r requirements.txt
The project consists of three seperate programs predict.py
, train.py
and evaluate.py
Each of the programs can be started by typing:
python3 <programname>.py
predict.py
asks for any mileage and ourt puts the pice predictiontrain.py
train the model on the current data and shows the training processevaluate.py
calculates the R squared value of the current model
Ole-Paul Heinzelmann
[email protected]