artlib.topological.DualVigilanceART
Dual Vigilance ART [19].
Classes
Dual Vigilance ART for Clustering. |
Module Contents
- class artlib.topological.DualVigilanceART.DualVigilanceART(base_module: artlib.common.BaseART.BaseART, rho_lower_bound: float)
Bases:
artlib.common.BaseART.BaseARTDual Vigilance ART for Clustering.
This module implements Dual Vigilance ART as first published in: [19].
Dual Vigilance ART allows a
BaseARTmodule to cluster with both an upper and lower vigilance value. The upper-vigilance value allows theBaseARTmodule to cluster normally, however, data is simultaneously clustered using the lower vigilance level to combine multiple base ART categories into a single abstracted category. This permits clusters to be combined to form arbitrary shapes. For example if theBaseARTmodule isFuzzyART, a Dual Vigilance Fuzzy ART clustering result would look like a series of hyper-boxes forming an arbitrary geometry.- base_module
- rho_lower_bound
- prepare_data(X: numpy.ndarray) numpy.ndarray
Prepare data for clustering.
- Parameters:
X (np.ndarray) – The dataset.
- Returns:
Prepared data from the base module.
- Return type:
np.ndarray
- restore_data(X: numpy.ndarray) numpy.ndarray
Restore data to its state prior to preparation.
- Parameters:
X (np.ndarray) – The dataset.
- Returns:
Restored data from the base module.
- Return type:
np.ndarray
- property n_clusters: int
Get the current number of clusters.
- Returns:
The number of clusters.
- Return type:
- property dim_
Get the dimensionality of the data from the base module.
- Returns:
Dimensionality of the data.
- Return type:
- property labels_
Get the labels from the base module.
- Returns:
Labels for the data.
- Return type:
np.ndarray
- property W: List
Get the weights from the base module.
- Returns:
Weights of the clusters.
- Return type:
list of np.ndarray
- check_dimensions(X: numpy.ndarray)
Check that the data has the correct dimensions.
- Parameters:
X (np.ndarray) – The dataset.
- validate_data(X: numpy.ndarray)
Validate the data prior to clustering.
- Parameters:
X (np.ndarray) – The dataset.
- static validate_params(params: dict)
Validate clustering parameters.
- Parameters:
params (dict) – Dictionary containing parameters for the algorithm.
- _match_tracking(cache: List[Dict] | Dict, epsilon: float, params: List[Dict] | Dict, method: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~']) bool
Adjust match tracking based on the method and epsilon value.
- Parameters:
- Returns:
True if match tracking continues, False otherwise.
- Return type:
- _set_params(new_params)
- step_fit(x: numpy.ndarray, match_reset_func: Callable | None = None, match_tracking: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~'] = 'MT+', epsilon: float = 0.0) int
Fit the model to a single sample.
- Parameters:
x (np.ndarray) – Data sample.
match_reset_func (callable, optional) – A callable accepting the data sample, a cluster weight, the params dict, and the cache dict. Returns True if the cluster is valid for the sample, False otherwise.
match_tracking ({"MT+", "MT-", "MT0", "MT1", "MT~"}, optional) – Method for resetting match criterion, by default “MT+”.
epsilon (float, optional) – Epsilon value used for adjusting match criterion, by default 0.0.
- Returns:
Cluster label of the input sample.
- Return type:
- step_pred(x) int
Predict the label for a single sample.
- Parameters:
x (np.ndarray) – Data sample.
- Returns:
Cluster label of the input sample.
- Return type:
- get_cluster_centers() List[numpy.ndarray]
Get the centers of each cluster, used for regression.
- Returns:
Cluster centroids.
- Return type:
list of np.ndarray
- plot_cluster_bounds(ax: matplotlib.axes.Axes, colors: artlib.common.utils.IndexableOrKeyable, linewidth: int = 1)
Visualize the bounds of each cluster.
- Parameters:
ax (matplotlib.axes.Axes) – Figure axes.
colors (IndexableOrKeyable) – Colors to use for each cluster.
linewidth (int, optional) – Width of boundary line, by default 1.