Rajarshi1001 / Regression

PClub Task.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regression Notebooks

This repo has 4 Notebooks based on Linear Regression which uses four different loss function for evaluating the total loss of the model.The overall fit is pretty good.

The loss functions involves the predicted value from the model xi and the actual value x . The loss function actually describes the amout of error between the two values and the model optimizes the loss function using the Gradient Descent Algorithm.

  • Linear Regression

Equation: y = mx + c

  1. Loss function: |x - xi|1
Iterations: 2000
Learning rate: 0.0001
The final loss for this model: -0.043649895876628514
  1. Loss function: |x - xi|3
Iterations: 2000
Learning rate: 0.0001
The final loss for this model: -0.00038246939204274676

Thus the second loss function |x - xi|3 seems to perform better on the dataset generated.

  • Polynomial Regression

Equation: y = ax2 + bx + c

  1. Loss function: |x - xi|4
Iterations: 5000
Learning rate: 0.001
The final loss for this model: 0.00043381989579868225
  1. Loss function: |x - xi|7
Iterations: 5000
Learning rate: 0.00001
The final loss for this model: -2.1841120256905214e-07

Although the loss for the second model is less than the first the first model seems to fit better to the dataset.

The comparison graphs are present in the notebooks along with the loss values during each iteration in the training process.

About

PClub Task.


Languages

Language:Jupyter Notebook 100.0%