milia.cluster.models.birch#
BIRCH: clustering through a clustering-feature tree.
Classes
|
BIRCH (Zhang, Ramakrishnan and Livny, 1996). |
|
Validated hyperparameters of the BIRCH clusterer. |
- class milia.cluster.models.birch.Birch(n_clusters=3, threshold=0.5, branching_factor=50)#
Bases:
BaseClustererBIRCH (Zhang, Ramakrishnan and Livny, 1996).
- Parameters:
Examples
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> X = np.repeat(np.array([[0.0, 0.0], [6.0, 6.0], [0.0, 6.0]]), 20, axis=0) + rng.normal( ... scale=0.4, size=(60, 2) ... ) >>> Birch(n_clusters=3).fit(X).n_clusters_ 3
- class milia.cluster.models.birch.BirchConfig(*, name='birch', kind='clusterer', space=SearchSpace(n_clusters=(2, 12), threshold=(0.1, 1.0)), n_clusters=3, threshold=0.5, branching_factor=50)#
Bases:
BaseModelConfigValidated hyperparameters of the BIRCH clusterer.
Fields mirror
Birch’s constructor;spaceis the default Optuna search space. Build the clusterer withmake("clusterer", "birch", ...)orBirch(**config.params()).Examples
>>> BirchConfig().name 'birch'