fuzzyclust.semisupervised.plot_pairwise_constraints#

fuzzyclust.semisupervised.plot_pairwise_constraints(X, must_link=None, cannot_link=None, labels=None, centers=None, ax=None, legend=True, violated_only=False, **kwargs)[source]#

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

Parameters:
Xarray_like of shape (n_samples, 2)
must_link, cannot_linkarray_like of shape (n_pairs, 2), optional
labelsarray_like of shape (n_samples,), optional

Hard labels for the colors; also used to mark violated constraints (drawn thicker) when given.

centersarray_like of shape (n_clusters, 2), optional
axmatplotlib Axes, optional
legendbool, default=True
violated_onlybool, default=False

Draw only the constraints the labels violate.

**kwargs

Passed to fuzzyclust.plotting.plot_clusters().

Returns:
axmatplotlib Axes

Examples using fuzzyclust.semisupervised.plot_pairwise_constraints#

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

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