Skip to content

A collection of parallel machine learning algorithms implemented using MPI for distributed computing, including parallel gradient descent, model evaluation, and K-means clustering.

License

Notifications You must be signed in to change notification settings

lokk798/parallel-ml-algorithms-mpi

Repository files navigation

Parallel Machine Learning Algorithms with MPI

This repository contains simple implementations of various machine learning algorithms parallelized using the Message Passing Interface (MPI) for distributed computing.

Algorithms Included

  • Parallel Gradient Descent: Implementation of distributed linear regression with gradient averaging using MPI reduce operations.
  • Parallel Model Evaluation: Distributed evaluation of machine learning models across multiple processes with communication via send/recv and reduce operations.
  • Parallel K-means Clustering: Implementation of the K-means clustering algorithm in a distributed setting, parallelizing both the distance calculations and centroid updates.

Requirements

  • mpi4py
  • NumPy
  • scikit-learn

Installation

# Install required packages
pip install mpi4py numpy scikit-learn

# Clone the repository
git clone https://github.com/lokk798/parallel-ml-algorithms-mpi.git
cd parallel-ml-algorithms-mpi

Usage

Run the algorithms using the MPI launcher:

# Run parallel gradient descent with 4 processes
mpiexec -n 4 python parallel_gradient_descent.py

# Run parallel model evaluation with 4 processes
mpiexec -n 4 python parallel_model_evaluation.py

# Run parallel K-means with 4 processes
mpiexec -n 4 python parallel_kmeans.py

About

A collection of parallel machine learning algorithms implemented using MPI for distributed computing, including parallel gradient descent, model evaluation, and K-means clustering.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages