Skip to content

Udacity-MachineLearning-Internship/Mini-Batch-Gradient-Descent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Mini-Batch_Gradient_Descent

GitHub repo size GitHub repo file count (file type) Python Version Pip Version GitHub last commit (branch) Version Contributors GitHub pull requests

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.

Overview

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.

Contents

  • 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.

Requirements

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

Usage

  1. Clone this repository to your local machine:
git clone https://github.com/BaraSedih11/Mini-Batch-Gradient-Descent.git
  1. Navigate to the repository directory:
cd Mini-Batch Gradient Descent
  1. Open and run the Jupyter Notebook Mini-Batch Gradient Descent.ipynb using Jupyter Notebook or JupyterLab.

  2. Follow along with the code and comments in the notebook to understand how mini-batch gradient descent is implemented using Python.

Acknowledgements

  • 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.

About

Implementing mini batch gradient descent using sckit-learn

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published