artlib.optimized.backends.cpp.BinaryFuzzyART
Fuzzy ART [8].
Classes
BinaryFuzzyART for Clustering. optimized with C++ |
Module Contents
- class artlib.optimized.backends.cpp.BinaryFuzzyART.BinaryFuzzyART(rho: float)
Bases:
artlib.elementary.BinaryFuzzyART.BinaryFuzzyARTBinaryFuzzyART 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
BinaryFuzzyART.- _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.
- Parameters:
labels_a_out (np.ndarray) – A 1D numpy array containing the a-side labels from fitting
weights_arrays (np.ndarray) – A 2D numpy array where rows are the Fuzzy ART weights
incremental (bool, default=False) – This flag is set to true when synchronizing after a partial_fit
- fit(X: numpy.ndarray, y: numpy.ndarray | None = None, match_reset_func: Callable | None = 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.
- Parameters:
X (np.ndarray) – The dataset.
y (np.ndarray, optional) – Not used. For compatibility.
match_reset_func (callable, optional) – A callable that influences cluster creation. Not used. For compatibility.
max_iter (int, default=1) – Number of iterations to fit the model on the same dataset.
match_tracking ({"MT+", "MT-", "MT0", "MT1", "MT~"}, default="MT+") – Method for resetting match criterion. Not used. For compatibility.
epsilon (float, default=0.0) – Epsilon value used for adjusting match criterion. Not used. For compatibility.
verbose (bool, default=False) – If True, displays progress of the fitting process. Not used. For compatibility.
leave_progress_bar (bool, default=True) – If True, leaves thge progress of the fitting process. Only used when verbose=True Not used. For compatibility.
- partial_fit(X: numpy.ndarray, match_reset_func: Callable | None = None, match_tracking: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~'] = 'MT+', epsilon: float = 0.0)
Iteratively fit the model to the data.
- Parameters:
X (np.ndarray) – The dataset.
match_reset_func (callable, optional) – A callable that influences cluster creation. Not used. For compatibility.
match_tracking ({"MT+", "MT-", "MT0", "MT1", "MT~"}, default="MT+") – Method for resetting match criterion. Not used. For compatibility.
epsilon (float, default=0.0) – Epsilon value used for adjusting match criterion. Not used. For compatibility.