fuzzyclust.graph.IsomapFCM#
- class fuzzyclust.graph.IsomapFCM(n_clusters=3, n_components=2, n_neighbors=10, radius=None, bridge_penalty=1.0, m=2.0, tol=0.0001, max_iter=300, init='random', n_init=1, random_state=None, verbose=0)[source]#
Bases:
BaseFuzzyClustererFuzzy c-means on the Isomap projection (Feil and Abonyi, Algorithm I).
The manifold exploration is left entirely to Isomap: geodesic distances on the neighborhood graph are embedded in \(q\) dimensions by classical multidimensional scaling, fuzzy c-means is run on the projected data, and every center is “re-projected” into the feature space as the sample whose projection is closest to it. The paper’s Algorithm II (
GeodesicFCM) avoids the projection step, which is the bottleneck of this approach: Isomap can only embed a connected graph, so disconnected components are bridged first (seegeodesic_distances()), and a projection that fails to unfold the manifold spoils the clustering.- Parameters:
- n_clusters
int, default=3 - n_components
int, default=2 Dimension \(q\) of the Isomap embedding.
- n_neighbors
int, default=10 - radius
floatorNone, default=None - bridge_penalty
float, default=1.0 Graph construction, see
GeodesicFCM(components are always connected here, because MDS needs finite distances).- m, tol, max_iter, init, n_init, random_state, verbose
Passed to the
FCMrun on the embedding.
- n_clusters
- Attributes:
- embedding_
ndarrayofshape(n_samples,n_components) Isomap coordinates \(\mathbf{y}_k\) of the training data.
- embedded_centers_
ndarrayofshape(n_clusters,n_components) FCM centers in the embedding.
- medoid_indices_
ndarrayofshape(n_clusters,) Samples closest to the centers in the embedding.
- cluster_centers_
ndarrayofshape(n_clusters,n_features) The re-projected centers
X[medoid_indices_].- membership_, labels_, distances_, objective_, objective_history_, n_iter_
Of the FCM run in the embedding.
- geodesic_objective_
float \(J\) evaluated with geodesic distances to the re-projected centers – the quantity the paper compares between the algorithms.
- residual_variance_
float Share of the MDS eigenvalue mass not captured by the embedding.
- geodesic_distances_, neighbors_graph_, n_components_, component_labels_, bridge_edges_
See
GeodesicFCM.
- embedding_
Notes
New samples are embedded through their nearest training sample (
predict_proba(),transform()): the proxy keeps training points exact and is adequate close to the manifold.References
[1]B. Feil, J. Abonyi, “Geodesic distance based fuzzy clustering”, in: Soft Computing in Industrial Applications, Advances in Soft Computing 39, Springer, 50–59, 2007.
[2]J. B. Tenenbaum, V. de Silva, J. C. Langford, “A global geometric framework for nonlinear dimensionality reduction”, Science 290, 2319–2323, 2000.
Examples
>>> from fuzzyclust.graph import IsomapFCM >>> from fuzzyclust.datasets import make_curved_manifold >>> X, y = make_curved_manifold(n_samples=300, random_state=0) >>> iso = IsomapFCM(n_clusters=2, n_neighbors=5, random_state=0).fit(X) >>> iso.embedding_.shape, iso.cluster_centers_.shape ((300, 2), (2, 2))
- fit(X, y=None)[source]#
Embed the data by Isomap, cluster the embedding with FCM, re-project the centers.
- Parameters:
- Xarray_like
ofshape(n_samples,n_features) - y
Ignored
- Xarray_like
- Returns:
- self
object
- self
Examples using fuzzyclust.graph.IsomapFCM#
Geodesic paths, the S-curve, and clustering of the Isomap projection