This repository contains an implementation of Mini-Batch Gradient Descent, a variant of the Gradient Descent optimization algorithm often used in machine learning and deep learning. Mini-Batch Gradient Descent is particularly useful when dealing with large datasets, as it updates the model's parameters using a subset of the training data at each iteration.
Gradient Descent is a popular optimization algorithm used to minimize the loss function in machine learning models by iteratively moving towards the minimum of the loss function. Mini-Batch Gradient Descent is a variation of this algorithm where instead of computing the gradient of the entire dataset (Batch Gradient Descent) or just one sample (Stochastic Gradient Descent), it computes the gradient based on a randomly selected subset of the training data (mini-batch). This approach combines the advantages of both Batch Gradient Descent and Stochastic Gradient Descent, making it suitable for large-scale datasets.
This repository provides a simple implementation of Mini-Batch Gradient Descent in Python, along with examples demonstrating its usage.
Mini-Batch Gradient Descent.ipynb
: Jupyter Notebook containing the implementation of polynomial regression using Python.data.csv
: Sample dataset used in the notebook for demonstration purposes.README.md
: This file providing an overview of the repository.
To run the code in the Jupyter Notebook, you need to have Python installed on your system along with the following libraries:
- NumPy
- pandas
- scikit-learn
- matplotlib You can install these libraries using pip:
pip install numpy pandas scikit-learn matplotlib
- Clone this repository to your local machine:
git clone https://github.com/BaraSedih11/Mini-Batch-Gradient-Descent.git
- Navigate to the repository directory:
cd Mini-Batch Gradient Descent
-
Open and run the Jupyter Notebook
Mini-Batch Gradient Descent.ipynb
using Jupyter Notebook or JupyterLab. -
Follow along with the code and comments in the notebook to understand how mini-batch gradient descent is implemented using Python.
- scikit-learn: The scikit-learn library for machine learning in Python.
- NumPy: The NumPy library for numerical computing in Python.
- pandas: The pandas library for data manipulation and analysis in Python.
- matplotlib: The matplotlib library for data visualization in Python.