Coders Packet

Linear Regression in Python using NumPy

By Prateek Kumar

Implementation of Linear Regression from scratch in Python using NumPy library with mean squared error as loss function.

The given Python module contain code of Linear Regression class. The Loss function(mean squared error) is optimised by gradient descent algorithm.

Feature:

- Hyperparameters like learning rate, epochs can be adjusted as per problem.

- Mantains a log of loss and R-2 score and plot it in graph after completion of training loop using Matplotlib library.

- builtin methods like:

1. predict(X_test): return prediction for test dataset.

2. test(X_test,y_test): predict on test dataset and compute loss and R-2 score and return in form of Python Dictionary

3. save(): save the trained model into the disk in form of Python pickle file.

- The module is written in Object Oriented way it makes code highly readable and all features of OOPs is available.

- Well documented so highly useful to the beginners in Machine Learning.

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by Prateek Kumar (18225prateek)

Download packets of source code on Coders Packet