No project description provided
Project description
fuzzy-c-means
fuzzy-c-means
is a Python module implementing the Fuzzy C-means clustering algorithm.
installation
the fuzzy-c-means
package is available in PyPI. to install, simply type the following command:
pip install fuzzy-c-means
command line interface
You can read the CLI.md file for more information about this tool.
basic clustering example
simple example of use the fuzzy-c-means
to cluster a dataset in two groups:
importing libraries
%matplotlib inline
import numpy as np
from fcmeans import FCM
from matplotlib import pyplot as plt
creating artificial data set
n_samples = 3000
X = np.concatenate((
np.random.normal((-2, -2), size=(n_samples, 2)),
np.random.normal((2, 2), size=(n_samples, 2))
))
fitting the fuzzy-c-means
fcm = FCM(n_clusters=2)
fcm.fit(X)
showing results
# outputs
fcm_centers = fcm.centers
fcm_labels = fcm.predict(X)
# plot result
f, axes = plt.subplots(1, 2, figsize=(11,5))
axes[0].scatter(X[:,0], X[:,1], alpha=.1)
axes[1].scatter(X[:,0], X[:,1], c=fcm_labels, alpha=.1)
axes[1].scatter(fcm_centers[:,0], fcm_centers[:,1], marker="+", s=500, c='w')
plt.savefig('images/basic-clustering-output.jpg')
plt.show()
to more examples, see the examples/ folder.
how to cite fuzzy-c-means package
if you use fuzzy-c-means
package in your paper, please cite it in your publication.
@software{dias2019fuzzy,
author = {Madson Luiz Dantas Dias},
title = {fuzzy-c-means: An implementation of Fuzzy $C$-means clustering algorithm.},
month = may,
year = 2019,
publisher = {Zenodo},
doi = {10.5281/zenodo.3066222},
url = {https://git.io/fuzzy-c-means}
}
citations
- Gene-Based Clustering Algorithms: Comparison Between Denclue, Fuzzy-C, and BIRCH
- Analisis Data Log IDS Snort dengan Algoritma Clustering Fuzzy C-Means
- Comparative Analysis between the k-means and Fuzzy c-means Algorithms to Detect UDP Flood DDoS Attack on a SDN/NFV Environment
- Mixture-of-Experts Variational Autoencoder for Clustering and Generating from Similarity-Based Representations on Single Cell Data
- Fuzzy Clustering: an Application to Distributional Reinforcement Learning
contributing and support
this project is open for contributions. here are some of the ways for you to contribute:
- bug reports/fix
- features requests
- use-case demonstrations
please open an issue with enough information for us to reproduce your problem. A minimal, reproducible example would be very helpful.
to make a contribution, just fork this repository, push the changes in your fork, open up an issue, and make a pull request!
contributors
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
Hashes for fuzzy_c_means-1.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8bec08e003b5fe8ed8de0ac244748fb830c5932d1c61d0fb7905e7d686eb904 |
|
MD5 | b4c1d5c61477e96882124e3b94a19e6b |
|
BLAKE2b-256 | 984d149f76eeb0c6361d8bd3256cd1ba9cbc475038139580e98693a6559ce6c5 |