/Linear-Regression-from-Scratch

This project implements a Python-based linear regression model from scratch, complete with custom functions for mean squared error and gradient descent algorithm. It is tested on data, using features to predict target variables. The project offers a practical introduction to linear regression.

Primary LanguageJupyter NotebookMIT LicenseMIT

Linear Regression Model from Scratch

This project contains an implementation of a Linear Regression model from scratch in Python, as well as an example usage of the model on a random dataset generated using scikit-learn.

Usage

To use the Linear Regression model, simply import the LinearRegression class from the Linear_regression.py file in your Python code, create an instance of the class, and call the fit method on your training data to train the model. Once the model is trained, you can use the predict method to make predictions on new data.

Example

An example of using the Linear Regression model on a random dataset with multiple features can be found in the test_model.ipynb file. This file generates a random dataset using scikit-learn, trains a Linear Regression model using the LinearRegression class, and makes predictions on the test set. The predicted values are then compared to the true values to evaluate the performance of the model.

Contributions

Contributions to this project are welcome. If you find a bug or have a suggestion for improvement, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.