artlib.hierarchical.DeepARTMAP
Deep ARTMAP [12].
Classes
DeepARTMAP for Hierachical Supervised and Unsupervised Learning. |
Module Contents
- class artlib.hierarchical.DeepARTMAP.DeepARTMAP(modules: list[artlib.common.BaseART.BaseART])
Bases:
sklearn.base.BaseEstimator,sklearn.base.ClassifierMixin,sklearn.base.ClusterMixinDeepARTMAP for Hierachical Supervised and Unsupervised Learning.
This module implements DeepARTMAP, a generalization of the
ARTMAPclass [12] that allows an arbitrary number of data channels to be divisively clustered. DeepARTMAP support both supervised and unsupervised modes. If only two ART modules are provided, DeepARTMAP reverts to standardARTMAPwhere the first module is the A-module and the second module is the B-module. DeepARTMAP does not currently have a direct citation and is an original creation of this library.- modules
- layers: list[artlib.common.BaseARTMAP.BaseARTMAP] = []
- set_params(**params)
Set the parameters of this estimator.
- Parameters:
**params (dict) – Estimator parameters.
- Returns:
self – The estimator instance.
- Return type:
- property labels_: numpy.ndarray
Get the labels from the first layer.
- Returns:
The labels from the first ART layer.
- Return type:
np.ndarray
- property labels_deep_: numpy.ndarray
Get the deep labels from all layers.
- Returns:
Deep labels from all ART layers concatenated together.
- Return type:
np.ndarray
- property n_modules: int
Get the number of ART modules.
- Returns:
The number of ART modules.
- Return type:
- property n_layers: int
Get the number of layers.
- Returns:
The number of layers in DeepARTMAP.
- Return type:
- map_deep(level: int, y_a: numpy.ndarray | int) numpy.ndarray | int
Map a label from one arbitrary level to the highest (B) level.
- validate_data(X: list[numpy.ndarray], y: numpy.ndarray | None = None)
Validate the data before clustering.
- Parameters:
X (list of np.ndarray) – The input data sets for each module.
y (np.ndarray, optional) – The corresponding labels, by default None.
- Raises:
AssertionError – If the input data is inconsistent or does not match the expected format.
- prepare_data(X: numpy.ndarray | list[numpy.ndarray], y: numpy.ndarray | None = None) numpy.ndarray | Tuple[list[numpy.ndarray], numpy.ndarray | None]
Prepare the data for clustering.
- restore_data(X: numpy.ndarray | list[numpy.ndarray], y: numpy.ndarray | None = None) numpy.ndarray | Tuple[list[numpy.ndarray], numpy.ndarray | None]
Restore the data to its original state before preparation.
- fit(X: list[numpy.ndarray], y: numpy.ndarray | None = None, max_iter=1, match_tracking: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~'] = 'MT+', epsilon: float = 0.0)
Fit the DeepARTMAP model to the data.
- Parameters:
X (list of np.ndarray) – The input data sets for each module.
y (np.ndarray, optional) – The corresponding labels for supervised learning, by default None.
max_iter (int, optional) – The number of iterations to fit the model, by default 1.
match_tracking ({"MT+", "MT-", "MT0", "MT1", "MT~"}, optional) – The method to reset vigilance if a mismatch occurs, by default “MT+”.
epsilon (float, optional) – A small adjustment factor for match tracking, by default 0.0.
- Returns:
The fitted DeepARTMAP model.
- Return type:
- partial_fit(X: list[numpy.ndarray], y: numpy.ndarray | None = None, match_tracking: Literal['MT+', 'MT-', 'MT0', 'MT1', 'MT~'] = 'MT+', epsilon: float = 0.0)
Partially fit the DeepARTMAP model to the data.
- Parameters:
X (list of np.ndarray) – The input data sets for each module.
y (np.ndarray, optional) – The corresponding labels for supervised learning, by default None.
match_tracking ({"MT+", "MT-", "MT0", "MT1", "MT~"}, optional) – The method to reset vigilance if a mismatch occurs, by default “MT+”.
epsilon (float, optional) – A small adjustment factor for match tracking, by default 0.0.
- Returns:
The partially fitted DeepARTMAP model.
- Return type: