RapidLib  v2.2.0
A simple library for interactive machine learning
seriesClassificationTemplate< T > Class Template Referencefinal

#include <seriesClassification.h>

Collaboration diagram for seriesClassificationTemplate< T >:
Collaboration graph

Classes

struct  minMax
 

Public Member Functions

 seriesClassificationTemplate ()
 
 ~seriesClassificationTemplate ()
 
bool train (const std::vector< trainingSeriesTemplate< T > > &seriesSet)
 
void reset ()
 
std::string run (const std::vector< std::vector< T > > &inputSeries)
 
run (const std::vector< std::vector< T > > &inputSeries, std::string label)
 
std::string runParallel (const std::vector< std::vector< T > > &inputSeries)
 
runParallel (const std::vector< std::vector< T > > &inputSeries, std::string label)
 
std::string runContinuous (const std::vector< T > &inputVector)
 
std::vector< T > getCosts () const
 
std::size_t getMinLength () const
 
std::size_t getMinLength (std::string label) const
 
std::size_t getMaxLength () const
 
std::size_t getMaxLength (std::string label) const
 
minMax< T > calculateCosts (std::string label) const
 
minMax< T > calculateCosts (std::string label1, std::string label2) const
 

Detailed Description

template<typename T>
class seriesClassificationTemplate< T >

Class for containing time series classifiers.

Currently only (fast)DTW.

Constructor & Destructor Documentation

◆ seriesClassificationTemplate()

Constructor, no params

◆ ~seriesClassificationTemplate()

Member Function Documentation

◆ calculateCosts() [1/2]

template<typename T >
seriesClassificationTemplate< T >::template minMax< T > seriesClassificationTemplate< T >::calculateCosts ( std::string  label) const

Calculate minimum and maximum cost between examples in a label.

Parameters
stringLabel to calculate
Returns
minMax struct containing min and max

◆ calculateCosts() [2/2]

template<typename T >
seriesClassificationTemplate< T >::template minMax< T > seriesClassificationTemplate< T >::calculateCosts ( std::string  label1,
std::string  label2 
) const

Calculate minimum and maximum cost between examples in one label and examples in a second.

Parameters
stringfirst label to compare
stringsecond label to compare
Returns
minMax struct containing min and max

◆ getCosts()

template<typename T >
std::vector< T > seriesClassificationTemplate< T >::getCosts

Get the costs that were calculated by the run method

Returns
A vector of floats or doubles, the cost of matching to each training series

◆ getMaxLength() [1/2]

template<typename T >
std::size_t seriesClassificationTemplate< T >::getMaxLength

Get maximum training series length

Returns
The maximum length training series

◆ getMaxLength() [2/2]

template<typename T >
std::size_t seriesClassificationTemplate< T >::getMaxLength ( std::string  label) const

Get maximum training series length from a specified label

Parameters
stringThe label to check
Returns
The maximum length training series of that label

◆ getMinLength() [1/2]

template<typename T >
std::size_t seriesClassificationTemplate< T >::getMinLength

Get minimum training series length

Returns
The minimum length training series

◆ getMinLength() [2/2]

template<typename T >
std::size_t seriesClassificationTemplate< T >::getMinLength ( std::string  label) const

Get minimum training series length from a specified label

Parameters
stringThe label to check
Returns
The minimum length training series of that label

◆ reset()

template<typename T >
void seriesClassificationTemplate< T >::reset

Reset model to its initial state, forget all costs and training data

◆ run() [1/2]

template<typename T >
std::string seriesClassificationTemplate< T >::run ( const std::vector< std::vector< T > > &  inputSeries)

Compare an input series to the stored training series

Parameters
std::vector<std::vector>vector of vectors, either float or double input data
Returns
The label of the closest training series.

◆ run() [2/2]

template<typename T >
T seriesClassificationTemplate< T >::run ( const std::vector< std::vector< T > > &  inputSeries,
std::string  label 
)

Compare an input series to all of the stored series with a specified label

Parameters
std::vector<std::vector>either float or double input data
Stringlabel to compare with
Returns
The lowest cost match, float or double

◆ runContinuous()

template<typename T >
std::string seriesClassificationTemplate< T >::runContinuous ( const std::vector< T > &  inputVector)

Compare an input series to all of the stored series with a specified label

Parameters
std::vector<T>one frame either float or double input data
Returns
The lowest cost match, float or double

◆ runParallel() [1/2]

template<typename T >
std::string seriesClassificationTemplate< T >::runParallel ( const std::vector< std::vector< T > > &  inputSeries)

Compare an input series to the stored training series. Parallel processing

Parameters
std::vector<std::vector>vector of vectors, either float or double input data
Returns
The label of the closest training series.

◆ runParallel() [2/2]

template<typename T >
T seriesClassificationTemplate< T >::runParallel ( const std::vector< std::vector< T > > &  inputSeries,
std::string  label 
)

Compare an input series to all of the stored series with a specified label. Parallel processing

Parameters
std::vector<std::vector>either float or double input data
Stringlabel to compare with
Returns
The lowest cost match, float or double

◆ train()

template<typename T >
bool seriesClassificationTemplate< T >::train ( const std::vector< trainingSeriesTemplate< T > > &  seriesSet)

Train on a specified set of trainingSeries

Parameters
std::vector<trainingSeries>A vector of training series

The documentation for this class was generated from the following files: