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 inmake_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_samples
int, default=300 - n_numeric
int, default=3 - n_categorical
int, default=3 - n_categories
int, default=3 - n_clusters
int, default=3 - cluster_std
float, default=1.0 - center_distance
float, 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).
- noise
float, 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_state
int,RandomStateinstanceorNone
- n_samples
- Returns:
- data
sklearn.utils.Bunch data–pandas.DataFramewith numeric columnsx1, x2, ...and categorical columnsc1, c2, ...;target;centers(n_clusters, n_numeric);modes– DataFrame of the planted modes.
- data
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
Gower’s dissimilarity versus one-hot encoding for mixed data