artlib.optimized.backends.cpp.BinaryFuzzyART ============================================ .. py:module:: artlib.optimized.backends.cpp.BinaryFuzzyART .. autoapi-nested-parse:: Fuzzy ART :cite:`carpenter1991fuzzy`. Classes ------- .. autoapisummary:: artlib.optimized.backends.cpp.BinaryFuzzyART.BinaryFuzzyART Module Contents --------------- .. py:class:: BinaryFuzzyART(rho: float) Bases: :py:obj:`artlib.elementary.BinaryFuzzyART.BinaryFuzzyART` BinaryFuzzyART for Clustering. optimized with C++ This module implements BinaryFuzzyART FuzzyART is a non-modular clustering model for binary input data which has been highly optimized for run-time performance. Fit and predict functions are implemented in c++ for efficient execution. This class acts as a wrapper for the underlying c++ functions and to provide compatibility with the artlib style and usage. Functionally, FuzzyART behaves as a special case of :class:`~artlib.elementary.BinaryFuzzyART.BinaryFuzzyART`. .. py:method:: _synchronize_cpp_results(labels_a_out: numpy.ndarray, weights_arrays: list[numpy.ndarray], incremental: bool = False) Synchronize the python class with the output of the c++ code. :param labels_a_out: A 1D numpy array containing the a-side labels from fitting :type labels_a_out: np.ndarray :param weights_arrays: A 2D numpy array where rows are the Fuzzy ART weights :type weights_arrays: np.ndarray :param incremental: This flag is set to true when synchronizing after a partial_fit :type incremental: bool, default=False .. py:method:: fit(X: numpy.ndarray, y: Optional[numpy.ndarray] = None, match_reset_func: Optional[Callable] = None, max_iter=1, match_tracking: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~'] = 'MT+', epsilon: float = 0.0, verbose: bool = False, leave_progress_bar: bool = True) Fit the model to the data. :param X: The dataset. :type X: np.ndarray :param y: Not used. For compatibility. :type y: np.ndarray, optional :param match_reset_func: A callable that influences cluster creation. Not used. For compatibility. :type match_reset_func: callable, optional :param max_iter: Number of iterations to fit the model on the same dataset. :type max_iter: int, default=1 :param match_tracking: Method for resetting match criterion. Not used. For compatibility. :type match_tracking: {"MT+", "MT-", "MT0", "MT1", "MT~"}, default="MT+" :param epsilon: Epsilon value used for adjusting match criterion. Not used. For compatibility. :type epsilon: float, default=0.0 :param verbose: If True, displays progress of the fitting process. Not used. For compatibility. :type verbose: bool, default=False :param leave_progress_bar: If True, leaves thge progress of the fitting process. Only used when verbose=True Not used. For compatibility. :type leave_progress_bar: bool, default=True .. py:method:: partial_fit(X: numpy.ndarray, match_reset_func: Optional[Callable] = None, match_tracking: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~'] = 'MT+', epsilon: float = 0.0) Iteratively fit the model to the data. :param X: The dataset. :type X: np.ndarray :param match_reset_func: A callable that influences cluster creation. Not used. For compatibility. :type match_reset_func: callable, optional :param match_tracking: Method for resetting match criterion. Not used. For compatibility. :type match_tracking: {"MT+", "MT-", "MT0", "MT1", "MT~"}, default="MT+" :param epsilon: Epsilon value used for adjusting match criterion. Not used. For compatibility. :type epsilon: float, default=0.0 .. py:method:: predict(X: numpy.ndarray, clip: bool = False) -> numpy.ndarray Predict labels for the data. :param X: Data set A. :type X: np.ndarray :param clip: clip the input values to be between the previously seen data limits :type clip: bool :returns: B labels for the data. :rtype: np.ndarray