artlib.elementary.EllipsoidART ============================== .. py:module:: artlib.elementary.EllipsoidART .. autoapi-nested-parse:: Ellipsoid ART :cite:`anagnostopoulos2001a`, :cite:`anagnostopoulos2001b`. Classes ------- .. autoapisummary:: artlib.elementary.EllipsoidART.EllipsoidART Module Contents --------------- .. py:class:: EllipsoidART(rho: float, alpha: float, beta: float, mu: float, r_hat: float) Bases: :py:obj:`artlib.common.BaseART.BaseART` Ellipsoid ART for Clustering. This module implements Ellipsoid ART as first published in: :cite:`anagnostopoulos2001a`, :cite:`anagnostopoulos2001b`. .. # Anagnostopoulos, G. C., & Georgiopoulos, M. (2001a). .. # Ellipsoid ART and ARTMAP for incremental clustering and classification. .. # In Proc. IEEE International Joint Conference on Neural Networks (IJCNN) .. # (pp. 1221–1226). volume 2. doi:10.1109/IJCNN.2001.939535. .. # Anagnostopoulos, G. C., & Georgiopoulos, M. (2001b). .. # Ellipsoid ART and ARTMAP for incremental unsupervised and supervised learning. .. # In Aerospace/Defense Sensing, Simulation, and Controls (pp. 293– 304). .. # International Society for Optics and Photonics. doi:10.1117/12.421180. Ellipsoid ART clusters data in Hyper-ellipsoids. It is highly sensitive to sample presentation order as the second sample will determine the orientation of the principal axes. .. 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, major_axis: numpy.ndarray, params: dict) -> float :staticmethod: Calculate the distance between a sample and the cluster centroid. :param i: Data sample. :type i: np.ndarray :param centroid: Centroid of the cluster. :type centroid: np.ndarray :param major_axis: Major axis of the cluster. :type major_axis: np.ndarray :param params: Dictionary containing parameters for the algorithm. :type params: dict :returns: Distance between the sample and the cluster centroid. :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_2d_ellipsoids() -> List[Tuple[numpy.ndarray, float, float, float]] Get the 2D ellipsoids for visualization. :returns: Each tuple contains the centroid, width, height, and angle of an ellipsoid. :rtype: list of tuple .. 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: artlib.common.utils.IndexableOrKeyable, 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