This repository contains an implementation of the Linear Regression algorithm from scratch in Python using Numpy and Pandas for the task of regression.
In this project, we implement Linear Regression, a fundamental supervised learning algorithm used for regression tasks. Linear Regression aims to establish a linear relationship between input features and a continuous target variable. This implementation provides a clear understanding of how Linear Regression works and demonstrates its implementation from scratch using Python.
- Numpy: For numerical computing.
- Pandas: For data manipulation and analysis.
- Matplotlib: For data visualization.
- Linear Regression is implemented to predict continuous target variable values based on input features.
- The algorithm calculates the coefficients using the normal equation.
- The predictions are made using the learned coefficients.
-
Clone the repository:
git clone https://github.com/your_username/supervised-learning-regression.git
-
Install the required libraries:
pip install numpy pandas matplotlib
-
Run the Python script:
python linear_regression.py
linear_regression.py: Contains the main script for implementing Linear Regression.Medical Price Dataset (1).csv: Dataset containing medical price information.
The coefficients obtained from the Linear Regression model are:
- Coefficients: [256.86, 339.19, 475.50, -131.31, 23848.53, -352.96, -1035.02, -960.05]
- Intercept: -11938.54
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.