artlib.elementary.QuadraticNeuronART

Quadratic Neuron ART [10], [11].

Classes

QuadraticNeuronART

Quadratic Neuron ART for Clustering.

Module Contents

class artlib.elementary.QuadraticNeuronART.QuadraticNeuronART(rho: float, s_init: float, lr_b: float, lr_w: float, lr_s: float)

Bases: artlib.common.BaseART.BaseART

Quadratic Neuron ART for Clustering.

This module implements Quadratic Neuron ART as first published in: [10], [11].

Quadratic Neuron ART clusters data in Hyper-ellipsoid by utilizing a quadratic neural network for activation and resonance.

static validate_params(params: dict)

Validate clustering parameters.

Parameters:

params (dict) – Dictionary containing parameters for the algorithm.

category_choice(i: numpy.ndarray, w: numpy.ndarray, params: dict) tuple[float, dict | None]

Get the activation of the cluster.

Parameters:
  • i (np.ndarray) – Data sample.

  • w (np.ndarray) – Cluster weight or information.

  • params (dict) – Dictionary containing parameters for the algorithm.

Returns:

  • float – Cluster activation.

  • dict, optional – Cache used for later processing.

match_criterion(i: numpy.ndarray, w: numpy.ndarray, params: dict, cache: dict | None = None) Tuple[float, Dict | None]

Get the match criterion of the cluster.

Parameters:
  • i (np.ndarray) – Data sample.

  • w (np.ndarray) – Cluster weight or information.

  • params (dict) – Dictionary containing parameters for the algorithm.

  • cache (dict, optional) – Cache containing values from previous calculations.

Returns:

  • float – Cluster match criterion.

  • dict – Cache used for later processing.

update(i: numpy.ndarray, w: numpy.ndarray, params: dict, cache: dict | None = None) numpy.ndarray

Get the updated cluster weight.

Parameters:
  • i (np.ndarray) – Data sample.

  • w (np.ndarray) – Cluster weight or information.

  • params (dict) – Dictionary containing parameters for the algorithm.

  • cache (dict, optional) – Cache containing values from previous calculations.

Returns:

Updated cluster weight, cache used for later processing.

Return type:

np.ndarray

new_weight(i: numpy.ndarray, params: dict) numpy.ndarray

Generate a new cluster weight.

Parameters:
  • i (np.ndarray) – Data sample.

  • params (dict) – Dictionary containing parameters for the algorithm.

Returns:

New cluster weight.

Return type:

np.ndarray

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: Iterable, 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.