Skip to content

woolimi/ft_linear_regression

Repository files navigation

ft_linear_regression

presentation ft_linear_regression

Overview

ft_linear_regression is a 42 machine learning project to create a program that predicts the price of a car by using a linear function train with a gradient descent algorithm. Dataset consists of a pair of price and mileage in src/data.csv. In this project we are free to use any language, so I used Javascript(NodeJS and React for visualization)

How to use

  1. Install package

    > pnpm i
    
  2. Prediction before train

    Try to predict price before training our src/model.json

    > pnpm predict
    > milage: 200000
    > price: 0
    
  3. Train

    > pnpm train
    ===========================
    Theta0 :  8008.400720135726
    Theta1 :  -0.02144848806185557
    ===========================
    
  4. Prediction after train

    > pnpm predict
    > milage: 200000
    > price: 3718.7031077646125
    
  5. Visualization (React App localhost:8080)

    > pnpm bonus
    

    By changing the learning rate, you can observe how the gradient descent algorithm is performed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published