fuzzyclust.semisupervised.make_partially_labeled_pair#

fuzzyclust.semisupervised.make_partially_labeled_pair(n_samples=300, length=8.0, gap=3.0, width=0.3, label_fraction=0.1, random_state=None)[source]#

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

Each class is a Gaussian stretched along the first axis (standard deviation length/4) and narrow along the second (width); the two classes are gap apart along the second axis. With two clusters and \(m=2\), FCM does not separate the two bars: the variance along the bars is so dominant that the optimum is a tilted boundary that cuts both bars, a compromise between a left/right and a top/bottom split. Labeled samples rotate the partition toward the classes – the more labels, the further – which makes the data set a sensitive probe of partial supervision.

Parameters:
n_samplesint, default=300
lengthfloat, default=8.0

Extent of the groups along the first axis (four standard deviations).

gapfloat, default=3.0

Distance between the group centers along the second axis.

widthfloat, default=0.3

Standard deviation across the groups.

label_fractionfloat, default=0.1

Share of samples that keep their label in y_partial.

random_stateint, RandomState instance or None
Returns:
Xndarray of shape (n_samples, 2)
yndarray of shape (n_samples,)

True class (0 or 1).

y_partialndarray of shape (n_samples,)

Partial labels, -1 for the unlabeled samples.

Examples using fuzzyclust.semisupervised.make_partially_labeled_pair#

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