fuzzyclust.semisupervised#

Clustering with partial supervision.

Unsupervised clustering finds the structure the distance suggests, which is not always the structure the user means. This sub-package lets a little knowledge steer the partition:

Semi-supervised FCM and pairwise-constrained fuzzy clustering.

Classes#

SemiSupervisedFCM([n_clusters, alpha, m, ...])

Fuzzy c-means with partial supervision (Pedrycz and Waletzky, 1997).

PairwiseConstrainedFCM([n_clusters, alpha, ...])

Fuzzy clustering with pairwise constraints, PCCA (Grira, Crucianu, and Boujemaa).

Functions#

check_pairwise_constraints([must_link, ...])

Validate lists of pairwise constraints and return them as integer arrays (n_pairs, 2).

constraint_satisfaction(labels[, must_link, ...])

Fraction of satisfied must-link and cannot-link pairs under hard labels.

make_partially_labeled_pair([n_samples, ...])

Two long parallel groups whose natural split disagrees with the classes.

make_partial_labels(y[, fraction, ...])

Hide most labels of y: keep a random subset, set the rest to -1.

make_pairwise_constraints(y[, n_must_link, ...])

Draw random must-link and cannot-link pairs consistent with the labels y.

plot_label_propagation(X, y_partial[, ...])

Labeled seeds as large black-edged markers, the rest colored by the cluster they were pulled into.

plot_pairwise_constraints(X[, must_link, ...])

Overlay must-link (solid green) and cannot-link (dashed vermilion) pairs on a scatter plot.