Package mdp :: Package nodes :: Class _OneDimensionalHitParade
[hide private]
[frames] | no frames]

Class _OneDimensionalHitParade


Class to produce hit-parades (i.e., a list of the locally largest and smallest values) out of a one-dimensional time-series.
Instance Methods [hide private]
 
__init__(self, n, d, real_dtype='d', integer_dtype='l')
Initializes an object of type 'OneDimensionalHitParade'.
tuple
get_maxima(self)
Return the tuple defining the maxima fulfilling specified criteria.
tuple
get_minima(self)
Return the tuple defining the minima fulfilling specified criteria.
 
update(self, inp)

Inherited from unreachable.newobject: __long__, __native__, __nonzero__, __unicode__, next

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, n, d, real_dtype='d', integer_dtype='l')
(Constructor)

 
Initializes an object of type 'OneDimensionalHitParade'.
Parameters:
  • n (int) - Number of maxima and minima to remember.
  • d (int) - Minimum gap between two hits.
  • real_dtype (numpy.dtype or str) - Datatype of sequence items
  • integer_dtype (numpy.dtype or str) - Datatype of sequence indices
Overrides: object.__init__

get_maxima(self)

 
Return the tuple defining the maxima fulfilling specified criteria.
Returns: tuple
A tuple containing maxima and their corresponding indices as numpy.ndarrays (see example in definition of the method OneDimensionalHitParade.update). The maxima are sorted in descending order.

get_minima(self)

 
Return the tuple defining the minima fulfilling specified criteria.
Returns: tuple
A tuple containing minima and their corresponding indices as numpy.ndarrays (see example in definition of the OneDimensionalHitParade.update() function). The minima are sorted in descending order.

update(self, inp)

 
Parameters:
  • inp (tuple) - A time series, defined by a tuple of numpy.ndarrays with the first element containing the values and the second containing the corresponding index. An example can be given by:

    >>> indices = numpy.array([0,1,2])
    >>> values = numpy.array([100,101,100])
    >>> avalidtuple = (indices,values)