Skip to main content
Ctrl+K

fuzzyclust

  • Installation
  • Example gallery
  • The book
  • API reference
  • Migrating from the MATLAB toolbox
    • Citing
    • Changelog
  • GitHub
  • Installation
  • Example gallery
  • The book
  • API reference
  • Migrating from the MATLAB toolbox
  • Citing
  • Changelog
  • GitHub

Section Navigation

  • Clustering algorithms and validation
    • Fuzzy c-means: memberships and the fuzziness exponent
    • Hard versus fuzzy partitions: k-means, k-medoids, and FCM
    • Gustafson–Kessel: clusters with their own shape
    • Gath–Geva: clusters of different size and density
    • Choosing the number of clusters with validity indices
    • Applying a fitted model to new data
    • Feature scaling on real data: the motorcycle data set
    • Working with pandas and scikit-learn: pipelines, DataFrames, and model selection
    • The fuzziness exponent m: from crisp cells to uniform memberships
    • Local optima and restarts: initializing Gustafson–Kessel on crossing lines
    • Distance norms: Euclidean, diagonal, and Mahalanobis fuzzy c-means
    • What makes a partition fuzzy: fuzzifiers, regularization, and annealing
    • Subtractive clustering: the number and location of clusters from density
    • Three routes to the number of clusters: merging, validity scan, and stability
  • Visualisation of clustering results
    • PCA versus Sammon mapping: preserving variance or distances
    • Fuzzy Sammon mapping: projecting clusters, not just data
    • Fuzzy self-organizing map: ordered prototypes by regularized FCM
    • Visual validation of the number of clusters with FUZZSAM
  • Robust and shape-oriented variants of fuzzy c-means
    • Possibilistic c-means: typicalities, scales and coincident clusters
    • Possibilistic fuzzy c-means: memberships and typicalities together
    • Noise clustering: a virtual cluster at constant distance δ
    • Kernel fuzzy c-means: rings and moons through the kernel trick
    • Fuzzy c-varieties: lines as prototypes, and the elliptotype compromise
    • Fuzzy c-shells: circles as prototypes
    • Learning which features matter: SCAD and the weighted FCM
    • Volume prototypes and adaptive cluster merging
  • Graph-based fuzzy clustering
    • Minimal spanning tree clustering: cutting, splitting, and Gath–Geva refinement
    • Inconsistent edges: Zahn’s criteria and the neighborhood depth
    • Number of clusters: volume-based validity and fuzzy cluster similarity
    • Geodesic-distance-based fuzzy clustering versus fuzzy c-means
    • Geodesic paths, the S-curve, and clustering of the Isomap projection
  • Clustering for model identification
    • Takagi–Sugeno model of a static nonlinearity: clusters become rules
    • Identification of a nonlinear dynamic system with free-run validation
    • MIMO Takagi–Sugeno model with local MIMO ARX consequents
    • Fuzzy c-regression models: switching regression with crossing lines
    • Supervised fuzzy clustering: classifier rules that carry class probabilities
    • Supervised fuzzy partitions as a priori discretization for decision trees
    • Hinging-hyperplane regression tree identified by fuzzy c-regression
  • Clustering of time series
    • Fuzzy segmentation of a multivariate time series
    • Bottom-up segmentation with PCA models versus fuzzy segmentation
    • Model-order selection by false nearest neighbors with a cluster-based threshold
    • State-space reconstruction and prediction of a chaotic time series
    • Model-free structure selection with mixed discrete and continuous inputs
  • Relational, categorical and mixed data
    • Relational fuzzy c-means and NERF for non-Euclidean data
    • Fuzzy c-medoids on dynamic-time-warping dissimilarities of time series
    • Fuzzy k-modes on categorical survey data
    • Fuzzy k-prototypes on mixed numeric and categorical data
    • Gower’s dissimilarity versus one-hot encoding for mixed data
    • Autocorrelation-based fuzzy clustering of time series
  • Incomplete, very large and image data
    • Clustering incomplete data: the four strategies of Hathaway and Bezdek
    • Imputation by clustering: accuracy of the completed values
    • Fuzzy c-means for very large data: rseFCM, spFCM and oFCM
    • Clustering a drifting stream chunk by chunk with partial_fit
    • Image segmentation under noise: six spatially constrained FCM variants
    • Spatial FCM: the neighborhood weight and the window size
  • Beyond a single unsupervised run
    • Fuzzy c-means with partial supervision: label fraction and weight
    • Pairwise constraints: must-link, cannot-link and competitive agglomeration
    • Fuzzy co-clustering of a document–term matrix
    • Collaborative fuzzy clustering across three data sites
    • Consensus of soft clusterings: a library beats a single run
    • The lifetime criterion of evidence accumulation
  • Example gallery

Example gallery#

Every example is a self-contained script that generates its own data, explains the idea of the method and shows the effect of its parameters. The same scripts are rendered here, downloadable as Jupyter notebooks, and quoted in the book.

Clustering algorithms and validation#

Hard and fuzzy partitioning (k-means, k-medoids, FCM, GK, GG), evaluating new data, choosing the number of clusters and working with pandas / scikit-learn. Also: generalized fuzzifiers and deterministic annealing, subtractive and mountain clustering, compatible cluster merging and stability-based selection of the number of clusters.

Fuzzy c-means: memberships and the fuzziness exponent

Fuzzy c-means: memberships and the fuzziness exponent

Hard versus fuzzy partitions: k-means, k-medoids, and FCM

Hard versus fuzzy partitions: k-means, k-medoids, and FCM

Gustafson–Kessel: clusters with their own shape

Gustafson–Kessel: clusters with their own shape

Gath–Geva: clusters of different size and density

Gath–Geva: clusters of different size and density

Choosing the number of clusters with validity indices

Choosing the number of clusters with validity indices

Applying a fitted model to new data

Applying a fitted model to new data

Feature scaling on real data: the motorcycle data set

Feature scaling on real data: the motorcycle data set

Working with pandas and scikit-learn: pipelines, DataFrames, and model selection

Working with pandas and scikit-learn: pipelines, DataFrames, and model selection

The fuzziness exponent m: from crisp cells to uniform memberships

The fuzziness exponent m: from crisp cells to uniform memberships

Local optima and restarts: initializing Gustafson–Kessel on crossing lines

Local optima and restarts: initializing Gustafson--Kessel on crossing lines

Distance norms: Euclidean, diagonal, and Mahalanobis fuzzy c-means

Distance norms: Euclidean, diagonal, and Mahalanobis fuzzy c-means

What makes a partition fuzzy: fuzzifiers, regularization, and annealing

What makes a partition fuzzy: fuzzifiers, regularization, and annealing

Subtractive clustering: the number and location of clusters from density

Subtractive clustering: the number and location of clusters from density

Three routes to the number of clusters: merging, validity scan, and stability

Three routes to the number of clusters: merging, validity scan, and stability

Visualisation of clustering results#

Projecting high-dimensional data and cluster prototypes to the plane (PCA, Sammon mapping, fuzzy Sammon mapping), measuring how faithful the picture is, and fuzzy self-organizing maps.

PCA versus Sammon mapping: preserving variance or distances

PCA versus Sammon mapping: preserving variance or distances

Fuzzy Sammon mapping: projecting clusters, not just data

Fuzzy Sammon mapping: projecting clusters, not just data

Fuzzy self-organizing map: ordered prototypes by regularized FCM

Fuzzy self-organizing map: ordered prototypes by regularized FCM

Visual validation of the number of clusters with FUZZSAM

Visual validation of the number of clusters with FUZZSAM

Robust and shape-oriented variants of fuzzy c-means#

Fuzzy c-means assumes compact, roughly spherical clusters and is pulled away by outliers. These examples relax one assumption at a time: the possibilistic c-means (absolute typicalities, their scale parameters and the coincident-cluster failure), the possibilistic fuzzy c-means (memberships and typicalities with the a/b trade-off), noise clustering (a virtual noise cluster at constant distance δ), kernel fuzzy c-means (rings and moons with a kernel-width scan), fuzzy c-varieties and c-elliptotypes (lines as prototypes on crossing and collinear segments, compared with GK) and fuzzy c-shells (circles as prototypes on concentric and intersecting circles with radius recovery), volume prototypes with adaptive merging, and feature weighting (weighted FCM and SCAD) that learns which variables matter.

Possibilistic c-means: typicalities, scales and coincident clusters

Possibilistic c-means: typicalities, scales and coincident clusters

Possibilistic fuzzy c-means: memberships and typicalities together

Possibilistic fuzzy c-means: memberships and typicalities together

Noise clustering: a virtual cluster at constant distance δ

Noise clustering: a virtual cluster at constant distance δ

Kernel fuzzy c-means: rings and moons through the kernel trick

Kernel fuzzy c-means: rings and moons through the kernel trick

Fuzzy c-varieties: lines as prototypes, and the elliptotype compromise

Fuzzy c-varieties: lines as prototypes, and the elliptotype compromise

Fuzzy c-shells: circles as prototypes

Fuzzy c-shells: circles as prototypes

Learning which features matter: SCAD and the weighted FCM

Learning which features matter: SCAD and the weighted FCM

Volume prototypes and adaptive cluster merging

Volume prototypes and adaptive cluster merging

Graph-based fuzzy clustering#

Clusters of arbitrary shape found through a graph over the samples: the hybrid minimal spanning tree / Gath–Geva algorithm (inconsistent-edge cutting, volume-based splitting, GG refinement, validation of the number of clusters and similarity of the resulting fuzzy clusters) and fuzzy c-medoid clustering with geodesic distances on a k-nearest-neighbour graph, compared with fuzzy c-means and with clustering of the Isomap projection on rings, moons, spirals and the S-curve.

Minimal spanning tree clustering: cutting, splitting, and Gath–Geva refinement

Minimal spanning tree clustering: cutting, splitting, and Gath–Geva refinement

Inconsistent edges: Zahn’s criteria and the neighborhood depth

Inconsistent edges: Zahn's criteria and the neighborhood depth

Number of clusters: volume-based validity and fuzzy cluster similarity

Number of clusters: volume-based validity and fuzzy cluster similarity

Geodesic-distance-based fuzzy clustering versus fuzzy c-means

Geodesic-distance-based fuzzy clustering versus fuzzy c-means

Geodesic paths, the S-curve, and clustering of the Isomap projection

Geodesic paths, the S-curve, and clustering of the Isomap projection

Clustering for model identification#

Fuzzy clusters in the product space of inputs and outputs are local models: Takagi–Sugeno fuzzy models of static functions and of SISO / MIMO dynamic systems (modified Gath–Geva clustering), switching regression with fuzzy c-regression models, fuzzy classifiers from supervised clustering, supervised fuzzy partitions for decision trees, and hinging-hyperplane regression trees.

Takagi–Sugeno model of a static nonlinearity: clusters become rules

Takagi–Sugeno model of a static nonlinearity: clusters become rules

Identification of a nonlinear dynamic system with free-run validation

Identification of a nonlinear dynamic system with free-run validation

MIMO Takagi–Sugeno model with local MIMO ARX consequents

MIMO Takagi–Sugeno model with local MIMO ARX consequents

Fuzzy c-regression models: switching regression with crossing lines

Fuzzy c-regression models: switching regression with crossing lines

Supervised fuzzy clustering: classifier rules that carry class probabilities

Supervised fuzzy clustering: classifier rules that carry class probabilities

Supervised fuzzy partitions as a priori discretization for decision trees

Supervised fuzzy partitions as a priori discretization for decision trees

Hinging-hyperplane regression tree identified by fuzzy c-regression

Hinging-hyperplane regression tree identified by fuzzy c-regression

Clustering of time series#

Fuzzy segmentation of multivariate time series with local PCA models (modified Gath–Geva clustering with a time prototype) against the bottom-up baseline, model-order selection of NARX models by false nearest neighbours with a cluster-based threshold, state-space reconstruction and prediction of chaotic series by clustering in the delay-embedded space, and model-free structure selection for models with mixed discrete and continuous inputs.

Fuzzy segmentation of a multivariate time series

Fuzzy segmentation of a multivariate time series

Bottom-up segmentation with PCA models versus fuzzy segmentation

Bottom-up segmentation with PCA models versus fuzzy segmentation

Model-order selection by false nearest neighbors with a cluster-based threshold

Model-order selection by false nearest neighbors with a cluster-based threshold

State-space reconstruction and prediction of a chaotic time series

State-space reconstruction and prediction of a chaotic time series

Model-free structure selection with mixed discrete and continuous inputs

Model-free structure selection with mixed discrete and continuous inputs

Relational, categorical and mixed data#

Fuzzy clustering when the objects are not feature vectors or the mean is meaningless: relational fuzzy c-means as the exact dual of FCM on a matrix of squared distances and its non-Euclidean extension with the adaptive β-spread (NERF), fuzzy c-medoids on dynamic-time-warping dissimilarities of time series with the linear-complexity candidate search, fuzzy k-modes on categorical survey data, fuzzy k-prototypes on mixed records with the weight γ, Gower’s coefficient as a bridge between mixed data and the relational algorithms, and autocorrelation-based clustering of time series.

Relational fuzzy c-means and NERF for non-Euclidean data

Relational fuzzy c-means and NERF for non-Euclidean data

Fuzzy c-medoids on dynamic-time-warping dissimilarities of time series

Fuzzy c-medoids on dynamic-time-warping dissimilarities of time series

Fuzzy k-modes on categorical survey data

Fuzzy k-modes on categorical survey data

Fuzzy k-prototypes on mixed numeric and categorical data

Fuzzy k-prototypes on mixed numeric and categorical data

Gower’s dissimilarity versus one-hot encoding for mixed data

Gower's dissimilarity versus one-hot encoding for mixed data

Autocorrelation-based fuzzy clustering of time series

Autocorrelation-based fuzzy clustering of time series

Incomplete, very large and image data#

Fuzzy c-means meets three realities of data that the textbook setting leaves out. Values are missing: the four strategies of Hathaway and Bezdek (whole data, partial distances, optimal completion, nearest prototype) are compared across missingness rates, and the imputation that optimal completion delivers is examined. Data are very large or arrive as a stream: random sample and extend, single-pass and online FCM are compared with the literal FCM on 200 000 points in time and agreement, and a drifting stream is processed chunk by chunk with partial_fit. The data are an image: spatially constrained variants (FCM_S, FCM_S1/S2, EnFCM, FGFCM, FLICM) are compared with pixel-wise FCM under increasing Gaussian and salt-and-pepper noise, and the neighborhood weight and window size are studied.

Clustering incomplete data: the four strategies of Hathaway and Bezdek

Clustering incomplete data: the four strategies of Hathaway and Bezdek

Imputation by clustering: accuracy of the completed values

Imputation by clustering: accuracy of the completed values

Fuzzy c-means for very large data: rseFCM, spFCM and oFCM

Fuzzy c-means for very large data: rseFCM, spFCM and oFCM

Clustering a drifting stream chunk by chunk with partial_fit

Clustering a drifting stream chunk by chunk with partial_fit

Image segmentation under noise: six spatially constrained FCM variants

Image segmentation under noise: six spatially constrained FCM variants

Spatial FCM: the neighborhood weight and the window size

Spatial FCM: the neighborhood weight and the window size

Beyond a single unsupervised run#

Fuzzy clustering that uses more than one data matrix and one random start: partial supervision by a few class labels (Pedrycz–Waletzky) and by must-link / cannot-link pairs (pairwise-constrained competitive agglomeration), co-clustering of the rows and columns of a document–term matrix (FCCM, Fuzzy CoDoK), collaborative clustering of the same objects at several data sites that exchange only partition matrices, and consensus clustering of a library of soft partitions (co-association matrix, consensus functions, evidence accumulation and the lifetime criterion for the number of clusters).

Fuzzy c-means with partial supervision: label fraction and weight

Fuzzy c-means with partial supervision: label fraction and weight

Pairwise constraints: must-link, cannot-link and competitive agglomeration

Pairwise constraints: must-link, cannot-link and competitive agglomeration

Fuzzy co-clustering of a document–term matrix

Fuzzy co-clustering of a document--term matrix

Collaborative fuzzy clustering across three data sites

Collaborative fuzzy clustering across three data sites

Consensus of soft clusterings: a library beats a single run

Consensus of soft clusterings: a library beats a single run

The lifetime criterion of evidence accumulation

The lifetime criterion of evidence accumulation

Download all examples in Python source code: auto_examples_python.zip

Download all examples in Jupyter notebooks: auto_examples_jupyter.zip

Gallery generated by Sphinx-Gallery

previous

Installation

next

Clustering algorithms and validation

On this page
  • Clustering algorithms and validation
  • Visualisation of clustering results
  • Robust and shape-oriented variants of fuzzy c-means
  • Graph-based fuzzy clustering
  • Clustering for model identification
  • Clustering of time series
  • Relational, categorical and mixed data
  • Incomplete, very large and image data
  • Beyond a single unsupervised run
Show Source

© Copyright 2026, János Abonyi.

Created using Sphinx 9.1.1.