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.0.1.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

algofuzz-0.0.1-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for algofuzz-0.0.1.tar.gz
Algorithm Hash digest
SHA256 950a243826d9513db3462913c858b7cf6ef6583432f9e8737597a2221d50bc82
MD5 1c9a46a4cb69728834caeaf0979b4ef1
BLAKE2b-256 37e653970a10613ba9f88d606ce2f2b88a6e65ffefe1990698663b6ed46cefcb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: algofuzz-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 33.5 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f3ddd8597d9d9c6c6a0e6caa7cdb85996dc96b33a22d6c475a034baa13502637
MD5 3924ace6fed044902bc114ec37f55ab8
BLAKE2b-256 5dcfce8e9dbf9c1f2093b10a0bb3b13eacc98cd19a6831da519973fa43a03936

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