fuzzyclust.relational.make_mixed_blobs#

fuzzyclust.relational.make_mixed_blobs(n_samples=300, n_numeric=3, n_categorical=3, n_categories=3, n_clusters=3, cluster_std=1.0, center_distance=3.0, noise=0.25, random_state=None)[source]#

Records with Gaussian numeric attributes and categorical attributes around modes.

Every cluster has a numeric center (Gaussian with cluster_std) and a categorical mode; the categorical part is generated as in make_categorical_blobs(). Both parts carry the cluster structure, so a method that uses only one of them sees it less clearly than one that combines them with a sensible weight.

Parameters:
n_samplesint, default=300
n_numericint, default=3
n_categoricalint, default=3
n_categoriesint, default=3
n_clustersint, default=3
cluster_stdfloat, default=1.0
center_distancefloat, default=3.0

Distance between neighboring numeric centers: the centers are placed equally spaced on a circle in the first two numeric dimensions (on a line when there is one numeric attribute).

noisefloat, default=0.25

Probability that a categorical entry is replaced by a uniformly random category (which can coincide with the mode), as in make_categorical_blobs().

random_stateint, RandomState instance or None
Returns:
datasklearn.utils.Bunch

data – pandas.DataFrame with numeric columns x1, x2, ... and categorical columns c1, c2, ...; target; centers (n_clusters, n_numeric); modes – DataFrame of the planted modes.

Examples

>>> from fuzzyclust.relational import make_mixed_blobs
>>> d = make_mixed_blobs(n_samples=60, random_state=0)
>>> d.data.shape, d.data.select_dtypes(include="number").shape[1], list(d.data.columns)
((60, 6), 3, ['x1', 'x2', 'x3', 'c1', 'c2', 'c3'])

Examples using fuzzyclust.relational.make_mixed_blobs#

Fuzzy k-prototypes on mixed numeric and categorical data

Fuzzy k-prototypes on mixed numeric and categorical data

Gower’s dissimilarity versus one-hot encoding for mixed data

Gower's dissimilarity versus one-hot encoding for mixed data