Machine Learning Library
|
#include <CDatasetStatistic.h>
Public Member Functions | |
CDatasetStatistic (void) | |
CDatasetStatistic (CDataset< Type > *ptDataset) | |
int | inputDimension (void) |
void | setData (CDataset< Type > *ptSet) |
virtual string | className () const |
Returns the class name. More... | |
CDataset< Type > * | getData (void) |
CMatrix< Type > | getAutoCorrelation (void) |
CMatrix< Type > | getLDA (void) |
CMatrix< Type > | getSW (void) |
CMatrix< Type > | getSB (void) |
CDenseVector< Type > | maxElements () |
CDenseVector< Type > | minElements () |
void | statistic (CDenseVector< Type > &rtMean, CDenseVector< Type > &rtDeviation, CDenseVector< Type > &rtVariance) const |
int | statistic (const CDenseVector< Type > &rtPattern, CDenseVector< Type > &rtMean, CDenseVector< Type > &rtDeviation, CDenseVector< Type > &rtVariance) const |
CDataset< float > * | rankInputSpace (int iSize, CMetric< Type > &rMetric) |
CDataset< float > * | rankMapSpace (int iSize, CDataset< double > &rNodeCoords, CMetric< double > &rMetricMap) |
float | spearman (int iSize, CDataset< double > &rNodeCoords, CMetric< double > &rMetricMap, CMetric< Type > &rMetricData) |
void | dumpStatistic () |
~CDatasetStatistic () | |
![]() | |
CObject () | |
Constructor. More... | |
virtual | ~CObject () |
Destructor. More... | |
virtual bool | serialize (fstream &stream, IO_MODE mode=READ) |
Read/write from binary stream. More... | |
virtual bool | serialize2 (CArchiv &tArchiv) |
void | setVerbose (VERBOSE_LEVEL tVerbose) |
Set the verbose level. More... | |
VERBOSE_LEVEL | verbose (void) const |
Return current verbose level. More... | |
virtual bool | isA (const char *acClass) const |
Check if the object is an instance of the class with given name. More... | |
DATATYPE | dataType () const |
Returns the template data type. More... | |
Static Public Member Functions | |
static CDenseVector< Type > | mean (const CDataset< Type > &rtDs, Type tClassLabel) |
Calculate mean vector of elements in rtDs with class label tClassLabel. More... | |
static CDenseVector< Type > | mean (const CDataset< Type > &rtDs) |
Calculate mean vector of elements in rtDs. More... | |
static CMatrix< Type > | covarianceMatrix (const CDataset< Type > &rtDs, Type tClassLabel) |
Calculate covariance matrix of elements in rtDs with class label tClassLabel. More... | |
static CMatrix< Type > | covarianceMatrix (const CDataset< Type > &rtDs) |
Calculate covariance matrix of elements in rtDs. More... | |
Additional Inherited Members | |
![]() | |
unsigned char | ucVerbose |
Template class for CDatasetStatistics.
CDatasetStatistic< Type >::CDatasetStatistic | ( | void | ) |
Constructor
CDatasetStatistic< Type >::CDatasetStatistic | ( | CDataset< Type > * | ptDataset | ) |
Constructor
CDatasetStatistic< Type >::~CDatasetStatistic | ( | ) |
Default destructor.
|
inlinevirtual |
Returns the class name.
Reimplemented from CObject< Type >.
|
static |
Calculate covariance matrix of elements in rtDs with class label tClassLabel.
|
static |
Calculate covariance matrix of elements in rtDs.
void CDatasetStatistic< Type >::dumpStatistic | ( | ) |
Same as above, but data will be dumped to stdout
CMatrix<Type> CDatasetStatistic< Type >::getAutoCorrelation | ( | void | ) |
Gets the auto-correlation matrix.
CDataset<Type>* CDatasetStatistic< Type >::getData | ( | void | ) |
Gets the data
CMatrix<Type> CDatasetStatistic< Type >::getLDA | ( | void | ) |
Gets the class independet LDA-matrix. (inv(within-class scatter)*between class scatter).
CMatrix<Type> CDatasetStatistic< Type >::getSB | ( | void | ) |
Gets the between class scatter matrix.
CMatrix<Type> CDatasetStatistic< Type >::getSW | ( | void | ) |
Gets the whitin class scatter matrix.
int CDatasetStatistic< Type >::inputDimension | ( | void | ) |
Return the input dimesion
CDenseVector<Type> CDatasetStatistic< Type >::maxElements | ( | ) |
Calculates the maximal value for each feature of the input vector.
|
static |
Calculate mean vector of elements in rtDs with class label tClassLabel.
|
static |
Calculate mean vector of elements in rtDs.
CDenseVector<Type> CDatasetStatistic< Type >::minElements | ( | ) |
Calculates the minimal value for each feature of the input vector.
CDataset<float>* CDatasetStatistic< Type >::rankInputSpace | ( | int | iSize, |
CMetric< Type > & | rMetric | ||
) |
Computes for each element a ranked list of distances to the other elements. Uses the input vectors for the computation of the distances. Creates a new dataset where for each item, – the input vector contains the ranked list of the IDs and – the output vector the corresponding list of distances
iSize | number of dataset elements to consider for rank matrix |
rMetric | metric to use for computation of distance in input space |
CDataset<float>* CDatasetStatistic< Type >::rankMapSpace | ( | int | iSize, |
CDataset< double > & | rNodeCoords, | ||
CMetric< double > & | rMetricMap | ||
) |
Similar to above, but use the distances in the map space. Additionally expects the distances of each data item to the prototype vectors (used for better sorting of distances in map space) Creates a new dataset where for each item, – the input vector contains the ranked list of the IDs and – the output vector the corresponding list of distances
Expects the following data structure: this->ptData input vectors: vectors in input space (unused) output vectors: component 0: ID of best match unit in SOM 1: distance to prototype vector
rNodeCoords input vectors: coordinates of nodes in map space output vectors: unused
iSize | number of dataset elements to consider for rank matrix |
rNodeCoords | node coordinates in map space |
rMetricMap | metric to compute node distances in map space |
void CDatasetStatistic< Type >::setData | ( | CDataset< Type > * | ptSet | ) |
Sets the dataset
ptSet | Pointer to the new dataset |
float CDatasetStatistic< Type >::spearman | ( | int | iSize, |
CDataset< double > & | rNodeCoords, | ||
CMetric< double > & | rMetricMap, | ||
CMetric< Type > & | rMetricData | ||
) |
Computes Spearmann's rho
Expects the following data structure this->ptData input vectors: vectors in input space output vectors: component 0: ID of best match unit in SOM 1: distance to prototype vector
rNodeCoords input vectors: coordinates of nodes in map space output vectors: unused
iSize | number of dataset elements to consider for rank list |
rNodeCoords | node coordinates in map space |
rMetricMap | metric to compute node distances in map space |
rMetricData | metric to compute distances in feature space |
void CDatasetStatistic< Type >::statistic | ( | CDenseVector< Type > & | rtMean, |
CDenseVector< Type > & | rtDeviation, | ||
CDenseVector< Type > & | rtVariance | ||
) | const |
Calculates several statistics for the input vectors. Each statistical value corresponds to one feature of the input vectors.
rtMean | Vector which will be filled with mean values |
rtDeviation | Vector which will be filled with standard deviation |
rtVariance | Vector which will be filled with variance |
int CDatasetStatistic< Type >::statistic | ( | const CDenseVector< Type > & | rtPattern, |
CDenseVector< Type > & | rtMean, | ||
CDenseVector< Type > & | rtDeviation, | ||
CDenseVector< Type > & | rtVariance | ||
) | const |
Same as above, but for calculation of the statistical values, only items with output vector equal to rtPattern are considered.
rtPattern | Pattern |
rtMean | Vector which will be filled with mean values |
rtDeviation | Vector which will be filled with standard deviation |
rtVariance | Vector which will be filled with variance |
Number | of items considered |