Class ClusterBuilder
source code
object --+
|
ClusterBuilder
Provides one-dimensional time symmetric clustering. Every input that
is greater than all samples that come before or after it within a certain
window is reported.
key is a function that, when applied to the items being clustered,
yields a monotonically increasing quantity that is treated as the 'time'
of the item.
value is a function that, when applied to the items being clustered,
is the quantity that is maximized -- for example, SNR.
Note: This implementation is tuned for event-like datasets in which
sample times are widely and irregularly spaced. For dense, regularly
sampled data, there is a conceptually identical but practically much
simpler algorithm.
The cluster() and flush() routines both return generators. Both may
be called multiple times. History is retained between calls.
|
__init__(self,
key,
value,
window)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
flush(self,
max_key)
Proceed with clustering items in the history under the assumption
that there are no further items with a key less than max_key. |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
Inherited from object :
__class__
|
__init__(self,
key,
value,
window)
(Constructor)
| source code
|
x.__init__(...) initializes x; see help(type(x)) for signature
- Overrides:
object.__init__
- (inherited documentation)
|
Proceed with clustering items in the history under the assumption that
there are no further items with a key less than max_key. This method is
used internally, but the user may call this as well if information about
the absence of triggers is available independently from the triggers.
This may be useful in low latency applications.
|