artlib.common.BaseARTMAP ======================== .. py:module:: artlib.common.BaseARTMAP .. autoapi-nested-parse:: Base class for all ARTMAP objects. Classes ------- .. autoapisummary:: artlib.common.BaseARTMAP.BaseARTMAP Module Contents --------------- .. py:class:: BaseARTMAP Bases: :py:obj:`sklearn.base.BaseEstimator`, :py:obj:`sklearn.base.ClassifierMixin`, :py:obj:`sklearn.base.ClusterMixin` Generic implementation of Adaptive Resonance Theory MAP (ARTMAP) .. py:attribute:: map :type: dict[int, int] .. py:method:: set_params(**params) Set the parameters of this estimator. Specific redefinition of `sklearn.BaseEstimator.set_params` for ARTMAP classes. :param \*\*params: Estimator parameters. :type \*\*params: dict :returns: **self** -- Estimator instance. :rtype: object .. py:method:: map_a2b(y_a: Union[numpy.ndarray, int]) -> Union[numpy.ndarray, int] Map an a-side label to a b-side label. :param y_a: Side A label(s). :type y_a: Union[np.ndarray, int] :returns: Side B cluster label(s). :rtype: Union[np.ndarray, int] .. py:method:: validate_data(X: numpy.ndarray, y: numpy.ndarray) :abstractmethod: Validate the data prior to clustering. :param X: Dataset A. :type X: np.ndarray :param y: Dataset B. :type y: np.ndarray .. py:method:: fit(X: numpy.ndarray, y: numpy.ndarray, max_iter=1, match_tracking: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~'] = 'MT+', epsilon: float = 1e-10) :abstractmethod: Fit the model to the data. :param X: Dataset A. :type X: np.ndarray :param y: Dataset B. :type y: np.ndarray :param max_iter: Number of iterations to fit the model on the same dataset. :type max_iter: int, optional :param match_tracking: Method for resetting match criterion. :type match_tracking: {"MT+", "MT-", "MT0", "MT1", "MT~"}, optional :param epsilon: Epsilon value used for adjusting match criterion, by default 1e-10. :type epsilon: float, optional .. py:method:: partial_fit(X: numpy.ndarray, y: numpy.ndarray, match_tracking: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~'] = 'MT+', epsilon: float = 1e-10) :abstractmethod: Partial fit the model to the data. :param X: Dataset A. :type X: np.ndarray :param y: Dataset B. :type y: np.ndarray :param match_tracking: Method for resetting match criterion. :type match_tracking: {"MT+", "MT-", "MT0", "MT1", "MT~"}, optional :param epsilon: Epsilon value used for adjusting match criterion, by default 1e-10. :type epsilon: float, optional .. py:method:: predict(X: numpy.ndarray, clip: bool = False) -> numpy.ndarray :abstractmethod: Predict labels for the data. :param X: Dataset A. :type X: np.ndarray :param clip: clip the input values to be between the previously seen data limits :type clip: bool :returns: B-side labels for the data. :rtype: np.ndarray .. py:method:: predict_ab(X: numpy.ndarray, clip: bool = False) -> tuple[numpy.ndarray, numpy.ndarray] :abstractmethod: Predict labels for the data, both A-side and B-side. :param X: Dataset A. :type X: np.ndarray :param clip: clip the input values to be between the previously seen data limits :type clip: bool :returns: A-side labels for the data, B-side labels for the data. :rtype: tuple[np.ndarray, np.ndarray] .. py:method:: plot_cluster_bounds(ax: matplotlib.axes.Axes, colors: artlib.common.utils.IndexableOrKeyable, linewidth: int = 1) :abstractmethod: 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 .. py:method:: visualize(X: numpy.ndarray, y: numpy.ndarray, ax: Optional[matplotlib.axes.Axes] = None, marker_size: int = 10, linewidth: int = 1, colors: Optional[artlib.common.utils.IndexableOrKeyable] = None) :abstractmethod: Visualize the clustering of the data. :param X: Dataset. :type X: np.ndarray :param y: Sample labels. :type y: np.ndarray :param ax: Figure axes, by default None. :type ax: matplotlib.axes.Axes, optional :param marker_size: Size used for data points, by default 10. :type marker_size: int, optional :param linewidth: Width of boundary line, by default 1. :type linewidth: int, optional :param colors: Colors to use for each cluster, by default None. :type colors: IndexableOrKeyable, optional