artlib.elementary.HypersphereART ================================ .. py:module:: artlib.elementary.HypersphereART .. autoapi-nested-parse:: Hyperpshere ART :cite:`anagnostopoulos2000hypersphere`. Classes ------- .. autoapisummary:: artlib.elementary.HypersphereART.HypersphereART Module Contents --------------- .. py:class:: HypersphereART(rho: float, alpha: float, beta: float, r_hat: float) Bases: :py:obj:`artlib.common.BaseART.BaseART` Hypersphere ART for Clustering. This module implements Ellipsoid ART as first published in: :cite:`anagnostopoulos2000hypersphere`. .. # Anagnostopoulos, G. C., & Georgiopulos, M. (2000). .. # Hypersphere ART and ARTMAP for unsupervised and supervised, incremental .. # learning. .. # In Proc. IEEE International Joint Conference on Neural Networks (IJCNN) .. # (pp. 59–64). volume 6. doi:10.1109/IJCNN.2000.859373. Hyperpshere ART clusters data in Hyper-spheres similar to k-means with a dynamic k. .. py:method:: validate_params(params: dict) :staticmethod: Validate clustering parameters. :param params: Dictionary containing parameters for the algorithm. :type params: dict .. py:method:: category_distance(i: numpy.ndarray, centroid: numpy.ndarray, radius: float, params) -> float :staticmethod: Compute the category distance between a data sample and a centroid. :param i: Data sample. :type i: np.ndarray :param centroid: Cluster centroid. :type centroid: np.ndarray :param radius: Cluster radius. :type radius: float :param params: Dictionary containing parameters for the algorithm. :type params: dict :returns: Category distance. :rtype: float .. py:method:: category_choice(i: numpy.ndarray, w: numpy.ndarray, params: dict) -> tuple[float, Optional[dict]] Get the activation of the cluster. :param i: Data sample. :type i: np.ndarray :param w: Cluster weight or information. :type w: np.ndarray :param params: Dictionary containing parameters for the algorithm. :type params: dict :returns: * *float* -- Cluster activation. * *dict, optional* -- Cache used for later processing. .. py:method:: match_criterion(i: numpy.ndarray, w: numpy.ndarray, params: dict, cache: Optional[dict] = None) -> tuple[float, Optional[dict]] Get the match criterion of the cluster. :param i: Data sample. :type i: np.ndarray :param w: Cluster weight or information. :type w: np.ndarray :param params: Dictionary containing parameters for the algorithm. :type params: dict :param cache: Cache containing values from previous calculations. :type cache: dict, optional :returns: * *float* -- Cluster match criterion. * *dict* -- Cache used for later processing. .. py:method:: update(i: numpy.ndarray, w: numpy.ndarray, params: dict, cache: Optional[dict] = None) -> numpy.ndarray Get the updated cluster weight. :param i: Data sample. :type i: np.ndarray :param w: Cluster weight or information. :type w: np.ndarray :param params: Dictionary containing parameters for the algorithm. :type params: dict :param cache: Cache containing values from previous calculations. :type cache: dict, optional :returns: Updated cluster weight. :rtype: np.ndarray .. py:method:: new_weight(i: numpy.ndarray, params: dict) -> numpy.ndarray Generate a new cluster weight. :param i: Data sample. :type i: np.ndarray :param params: Dictionary containing parameters for the algorithm. :type params: dict :returns: New cluster weight. :rtype: np.ndarray .. py:method:: get_cluster_centers() -> List[numpy.ndarray] Get the centers of each cluster, used for regression. :returns: Cluster centroids. :rtype: list of np.ndarray .. py:method:: plot_cluster_bounds(ax: matplotlib.axes.Axes, colors: Iterable, linewidth: int = 1) Visualize the bounds of each cluster. :param ax: Figure axes. :type ax: matplotlib.axes.Axes :param colors: Colors to use for each cluster. :type colors: IndexableOrKeyable :param linewidth: Width of boundary line, by default 1. :type linewidth: int, optional