Framework for popular fuzzy c-means clustering algorithms from literature
Project description
algoFuzz
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:
- Fuzzy C-Means (FCM) algorithm, proposed by Dunn in 1973 and improved by Bezdek in 1981.
from algofuzz import FCM
- Possibilistic Fuzzy C-Means Clustering algorithm proposed by Pal et al. in 2005.
from algofuzz import PFCM
- 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
- Fuzzy C-Means algorithm with an extra noise cluster proposed by R. Dave in 1993.
from algofuzz import FCPlus1M
- Fuzzy Possibilistic Product Partition C-Means Clustering algorithm proposed by L. Szilágyi & S. Szilágyi in 2014.
from algofuzz import NonOptimizedFP3CM
- Fuzzy-Possibilistic C-Means Clustering algorithm proposed by Pal, Pal and Bezdek in 1997.
from algofuzz import NonOptimizedFPCM
- Self-tuning version of the Possibilistic Fuzzy C-Means Clustering algorithm proposed by MB. Naghi in 2023.
from algofuzz import STPFCM
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file algofuzz-0.1.1.tar.gz
.
File metadata
- Download URL: algofuzz-0.1.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30834e07aa599c6bb907685717e4684975ef641fe7d58067ebd04e46fea2a8bb |
|
MD5 | 598240ff57f42f9c5e0337f95e1e6388 |
|
BLAKE2b-256 | 254cc362f18fafcde55e441511ed690a0ed8379495ca7c952eb9a2da178b5f6a |
File details
Details for the file algofuzz-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: algofuzz-0.1.1-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ac1f5d6e58ac366363a4d02acd9fa786911fa7b6a4f859033d53d64adcb8dae |
|
MD5 | 998030aebfaefbf5946809cfafd949bf |
|
BLAKE2b-256 | 91fd3f9d4f449e574496d8b7bd3e7645efd25c25c72c6d2ec3f8100893af34d4 |