Skip to main content

Framework for popular fuzzy c-means clustering algorithms from literature

Project description

algoFuzz

Documentation

PyPI version

algoFuzz is a unique framework dedicated to the implementation and comparison of various fuzzy c-means clustering algorithms found in academic literature. It provides a comprehensive environment for researchers and practitioners to explore and compare different clustering methodologies.

Documentation

The full documentation for algoFuzz is available at Read the Docs. You should read the documentation before using algoFuzz.

Getting Started

Before you start using the algoFuzz library, ensure that you have the following prerequisites:

  • Python 3.8+ installed on your system.
  • Familiarity with clustering concepts.
  • A basic understanding of Python programming.

To install the library, simply use the following pip command:

pip install algofuzz

Alternatively, you can also install the library directly from the source if it’s hosted on GitHub or a similar platform:

git clone https://github.com/naghim/algofuzz
cd algofuzz
pip install .

Quick example

Here’s a basic example of how to use the Fuzzy C-Means (FCM) algorithm to cluster data.

Refer to the documentation for a thorough explanation.

from algofuzz import FCM
from algofuzz import CentroidStrategy, DatasetType, load_dataset, generate_colors
import numpy as np
import matplotlib.pyplot as plt
import random

# Choose a random seed for reproducibility
np.random.seed(0)

# Load the Bubbles toy dataset
# You can replace this with your own dataset as well
data, num_clusters, true_labels = load_dataset(DatasetType.Bubbles)

# There are 3 clusters
print(f'Number of clusters: {num_clusters}')

# Create an FCM model with 3 clusters, choosing random initial centroids
fcm = FCM(
   num_clusters=num_clusters,
   max_iter=100,
   centroid_strategy=CentroidStrategy.Random
)

# Fit the model to the data
fcm.fit(data)

# These are the centroids of the clusters
centers = fcm.centroids

# These are the labels assigned to each data point (there are 3 clusters)
labels = fcm.labels

Algorithms

You may choose from the following algorithms currently available in the library:

  1. Fuzzy C-Means (FCM) algorithm, proposed by Dunn in 1973 and improved by Bezdek in 1981.
  • from algofuzz import FCM
  1. Possibilistic Fuzzy C-Means Clustering algorithm proposed by Pal et al. in 2005.
  • from algofuzz import PFCM
  1. An extension of the FCM model that includes a penalty term (eta) for each cluster depending on the distance between the data points and the centroids of the clusters.
  • from algofuzz import EtaFCM
  1. Fuzzy C-Means algorithm with an extra noise cluster proposed by R. Dave in 1993.
  • from algofuzz import FCPlus1M
  1. Fuzzy Possibilistic Product Partition C-Means Clustering algorithm proposed by L. Szilágyi & S. Szilágyi in 2014.
  • from algofuzz import NonOptimizedFP3CM
  1. Fuzzy-Possibilistic C-Means Clustering algorithm proposed by Pal, Pal and Bezdek in 1997.
  • from algofuzz import NonOptimizedFPCM
  1. Self-tuning version of the Possibilistic Fuzzy C-Means Clustering algorithm proposed by MB. Naghi in 2023.
  • from algofuzz import STPFCM

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

algofuzz-0.1.0.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

algofuzz-0.1.0-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file algofuzz-0.1.0.tar.gz.

File metadata

  • Download URL: algofuzz-0.1.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for algofuzz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a306cd970ddd5b3bd3bc0a46aa01aa03effecb1716f9670cc3483a3d928b2f9
MD5 26ed5aae142e2e9d574b0676dcec81d5
BLAKE2b-256 24a2a804b50d41ffeace5333695791d5cd98eb04036018fc105c1f0d8f17f282

See more details on using hashes here.

File details

Details for the file algofuzz-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: algofuzz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for algofuzz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c6118c6e5d4639e3218c23ea13932d895421614e3dc7a459da04c6d9906b9c8
MD5 94500b4dd60ae17f48ae37ea242d14b3
BLAKE2b-256 be2d036d6ed0e1fc2b2d295fb74b3ce2dced580fc1b5df1e292ec76458357e84

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page