Class ClustererOfflineMixin
Defined in File utils.h
Inheritance Relationships
Base Type
public cpphots::interfaces::Clusterer(Class Clusterer)
Derived Types
public cpphots::GMMClusterer(Class GMMClusterer)public cpphots::KMeansClusterer(Class KMeansClusterer)
Class Documentation
-
class cpphots::ClustererOfflineMixin : public virtual cpphots::interfaces::Clusterer
Mixin for offline clusterers.
Classes using this mixin must call cluster in order to have it working correctly.
Subclassed by cpphots::GMMClusterer, cpphots::KMeansClusterer
Public Functions
-
virtual uint16_t cluster(const TimeSurfaceType &surface) override
Performs clustering.
If learning is enabled store the time surface. If learning is disabled do nothing.
- Parameters
surface – the timesurface to cluster
- Returns
0
-
virtual bool isOnline() const final
Check if clusterer can perform online cluster updates or not.
- Returns
true if it can
- Returns
false otherwise
-
virtual bool toggleLearning(bool enable = true) override
Enable or disable learning.
This affects whether the centroids are updated when Clusterer::cluster is called or not.
During the learning phase, output of Clusterer::cluster may be undefined, depending on the implementaton.
If learning is enabled start to store time surfaces. If learning is disabled call train with stored time surfaces.
- Parameters
enable – true if learning should be active, false otherwise
- Returns
the previous learning state
Protected Functions
-
bool isLearning() const
Check if learning is active.
- Returns
true if learning is active
- Returns
false otherwise
-
virtual uint16_t cluster(const TimeSurfaceType &surface) override