https://github.com/mahdi-eth/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.
https://github.com/mahdi-eth/linear-regression-from-scratch
algorithm data-science data-visualization linear-regression machine-learning machine-learning-algorithms python
Last synced: about 1 month ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/mahdi-eth/linear-regression-from-scratch
- Owner: mahdi-eth
- License: mit
- Created: 2023-04-14T07:13:23.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-28T03:38:54.000Z (2 months ago)
- Last Synced: 2025-04-15T21:45:35.201Z (about 1 month ago)
- Topics: algorithm, data-science, data-visualization, linear-regression, machine-learning, machine-learning-algorithms, python
- Language: Jupyter Notebook
- Homepage:
- Size: 190 KB
- Stars: 10
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.