import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
- numpy : Librairie gestion des mathématique
- panda : Librairie permettant la manipulation et l'analyse des données
- matplotlib : Librairie destinée à tracer et visualiser des données sous formes de graphiques
The linear regression is a supervised Learning algorithm.
It goal is to find a regression line (or a curve with multiple datas) to predict the real-valued output
size (x) | price (y) |
---|---|
20 | 2000 |
30 | 3000 |
40 | 4000 |
training set size (m) |
---|
3 |
Linear regression function :
To calculate the x tetras a cost function J is used
Formula :
- If a is too small the descent will be long
- If a is to large the descent will diverge
Linear regression function :
Feature scaling : Get every feature into approximatively e
mean normalization : replace
Declare convvergence when x decreasze than less than
Modify
Copy a x value and give it a new coeficient (