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:
SemiSupervisedFCM– fuzzy c-means with partial supervision (Pedrycz and Waletzky, 1997): a few labeled samples (y == -1marks the unlabeled ones) pull the prototypes toward the classes;PairwiseConstrainedFCM– pairwise-constrained competitive agglomeration, PCCA (Grira, Crucianu and Boujemaa, 2006): must-link and cannot-link pairs are penalized when violated, optionally with the competitive agglomeration term that lets the number of clusters shrink;constraint_satisfaction(),check_pairwise_constraints()– utilities for pairwise constraints;make_partially_labeled_pair(),make_partial_labels(),make_pairwise_constraints()– data generators;plot_label_propagation(),plot_pairwise_constraints()– matplotlib helpers.
Semi-supervised FCM and pairwise-constrained fuzzy clustering.
Classes#
|
Fuzzy c-means with partial supervision (Pedrycz and Waletzky, 1997). |
|
Fuzzy clustering with pairwise constraints, PCCA (Grira, Crucianu, and Boujemaa). |
Functions#
|
Validate lists of pairwise constraints and return them as integer arrays |
|
Fraction of satisfied must-link and cannot-link pairs under hard |
|
Two long parallel groups whose natural split disagrees with the classes. |
|
Hide most labels of |
|
Draw random must-link and cannot-link pairs consistent with the labels |
|
Labeled seeds as large black-edged markers, the rest colored by the cluster they were pulled into. |
|
Overlay must-link (solid green) and cannot-link (dashed vermilion) pairs on a scatter plot. |