Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

alexandre-hallaine/ft_linear_regression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_linear_regression

The first AI project of 42. It aims to introduce us to machine learning.

We have to create a program that predicts the price of a car by using a linear function train with a gradient descent algorithm.

Usage

  • First, run the training for the prediction to work:
$ python3 train.py
  • Then, just run the prediction and enter your desired mileage:
$ python3 predict.py
Loading data...
Enter mileage: <number>

If your value is incorrect you should get the Invalid input! error and you will be asked to input the mileage again.

  • You now have a predicted price of a car
Price: 8000

Explanation

  • The values are first normalized (scaled between 0 and 1) to be easier to process.

  • Normalized thetas are then calculated via gradient descent Training

  • A denormalized version of thetas is calculated so that it can be used with normal values. Data

  • We can now predict the price of a car with an affine function (with thetas), and voila!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages