artlib.elementary.HypersphereART
Hyperpshere ART [9].
Classes
Hypersphere ART for Clustering. |
Module Contents
- class artlib.elementary.HypersphereART.HypersphereART(rho: float, alpha: float, beta: float, r_hat: float)
Bases:
artlib.common.BaseART.BaseARTHypersphere ART for Clustering.
This module implements Ellipsoid ART as first published in: [9].
Hyperpshere ART clusters data in Hyper-spheres similar to k-means with a dynamic k.
- static validate_params(params: dict)
Validate clustering parameters.
- Parameters:
params (dict) – Dictionary containing parameters for the algorithm.
- static category_distance(i: numpy.ndarray, centroid: numpy.ndarray, radius: float, params) float
Compute the category distance between a data sample and a centroid.
- category_choice(i: numpy.ndarray, w: numpy.ndarray, params: dict) tuple[float, dict | None]
Get the activation of the cluster.
- Parameters:
i (np.ndarray) – Data sample.
w (np.ndarray) – Cluster weight or information.
params (dict) – Dictionary containing parameters for the algorithm.
- Returns:
float – Cluster activation.
dict, optional – Cache used for later processing.
- match_criterion(i: numpy.ndarray, w: numpy.ndarray, params: dict, cache: dict | None = None) tuple[float, dict | None]
Get the match criterion of the cluster.
- Parameters:
- Returns:
float – Cluster match criterion.
dict – Cache used for later processing.
- update(i: numpy.ndarray, w: numpy.ndarray, params: dict, cache: dict | None = None) numpy.ndarray
Get the updated cluster weight.
- new_weight(i: numpy.ndarray, params: dict) numpy.ndarray
Generate a new cluster weight.
- Parameters:
i (np.ndarray) – Data sample.
params (dict) – Dictionary containing parameters for the algorithm.
- Returns:
New cluster weight.
- Return type:
np.ndarray
- get_cluster_centers() List[numpy.ndarray]
Get the centers of each cluster, used for regression.
- Returns:
Cluster centroids.
- Return type:
list of np.ndarray
- plot_cluster_bounds(ax: matplotlib.axes.Axes, colors: Iterable, linewidth: int = 1)
Visualize the bounds of each cluster.
- Parameters:
ax (matplotlib.axes.Axes) – Figure axes.
colors (IndexableOrKeyable) – Colors to use for each cluster.
linewidth (int, optional) – Width of boundary line, by default 1.