fuzzyclust.collaborative.make_collaborative_sites#

fuzzyclust.collaborative.make_collaborative_sites(n_clusters=3, n_samples_per_cluster=100, n_sites=2, n_features_per_site=2, spreads=(0.6, 1.3), box=8.0, swap_fraction=0.0, random_state=None)[source]#

The same objects described at several data sites by different features.

Every object belongs to one of n_clusters groups. Site \(p\) observes its own n_features_per_site Gaussian features around site-specific group centers with a site-specific spread, so the same group structure is seen clearly at a site with a small spread and blurred at a site with a large one. With swap_fraction > 0 a share of the objects is moved to another group at the last site only, which gives the sites a genuine disagreement about those objects.

Parameters:
n_clustersint, default=3
n_samples_per_clusterint, default=100
n_sitesint, default=2
n_features_per_siteint or sequence of int, default=2
spreadssequence of float, default=(0.6, 1.3)

Standard deviation of the groups at every site (cycled if shorter than n_sites).

boxfloat, default=8.0

Side of the cube the group centers are drawn from (every site has its own centers).

swap_fractionfloat, default=0.0

Share of the objects whose group is changed at the last site.

random_stateint, RandomState instance or None
Returns:
Xslist of ndarray, each of shape (n_samples, n_features_p)
yndarray of shape (n_samples,)

Group of every object (as seen by all sites but the swapped objects of the last one).

Examples

>>> from fuzzyclust.collaborative import make_collaborative_sites
>>> Xs, y = make_collaborative_sites(n_sites=3, n_features_per_site=(2, 3, 2), random_state=0)
>>> [X.shape for X in Xs]
[(300, 2), (300, 3), (300, 2)]

Examples using fuzzyclust.collaborative.make_collaborative_sites#

Collaborative fuzzy clustering across three data sites

Collaborative fuzzy clustering across three data sites