neupy.algorithms.competitive.art module

class neupy.algorithms.competitive.art.ART1[source]

Adaptive Resonance Theory (ART1) Network for binary data clustering.

Parameters:
rho : float

Control reset action in training process. Value must be between 0 and 1, defaults to 0.5.

n_clusters : int

Number of clusters, defaults to 2. Min value is also 2.

step : float

Learning rate, defaults to 0.1.

show_epoch : int

This property controls how often the network will display information about training. It has to be defined as positive integer. For instance, number 100 mean that network shows summary at 1st, 100th, 200th, 300th … and last epochs.

Defaults to 1.

shuffle_data : bool

If it’s True than training data will be shuffled before the training. Defaults to True.

signals : dict, list or function

Function that will be triggered after certain events during the training.

verbose : bool

Property controls verbose output in terminal. The True value enables informative output in the terminal and False - disable it. Defaults to False.

Notes

  • Weights are not random, so the result will be always reproduceble.

Examples

>>> import numpy as np
>>> from neupy import algorithms
>>>
>>> data = np.array([
...     [0, 1, 0],
...     [1, 0, 0],
...     [1, 1, 0],
... ])
>>>>
>>> artnet = algorithms.ART1(
...     step=2,
...     rho=0.7,
...     n_clusters=2,
...     verbose=False
... )
>>> artnet.predict(data)
array([ 0.,  1.,  1.])

Methods

train(X) ART trains until all clusters are found.
predict(X) Each prediction trains a new network. It’s an alias to the train method.
fit(*args, **kwargs) Alias to the train method.
n_clusters = None[source]
options = {'n_clusters': Option(class_name='ART1', value=IntProperty(name="n_clusters")), 'rho': Option(class_name='ART1', value=ProperFractionProperty(name="rho")), 'show_epoch': Option(class_name='BaseNetwork', value=IntProperty(name="show_epoch")), 'shuffle_data': Option(class_name='BaseNetwork', value=Property(name="shuffle_data")), 'signals': Option(class_name='BaseNetwork', value=Property(name="signals")), 'step': Option(class_name='BaseNetwork', value=NumberProperty(name="step")), 'verbose': Option(class_name='Verbose', value=VerboseProperty(name="verbose"))}[source]
predict(X)[source]
rho = None[source]
train(X)[source]

Method train neural network.

Parameters:
X_train : array-like
y_train : array-like or None
X_test : array-like or None
y_test : array-like or None
epochs : int

Defaults to 100.

epsilon : float or None

Defaults to None.