Machine Learning Library
Public Member Functions | Static Public Member Functions | List of all members
CDatasetStatistic< Type > Class Template Reference

#include <CDatasetStatistic.h>

Inheritance diagram for CDatasetStatistic< Type >:
CObject< Type >

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 ()
 
- Public Member Functions inherited from CObject< Type >
 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

- Protected Attributes inherited from CObject< Type >
unsigned char ucVerbose
 

Detailed Description

template<class Type>
class CDatasetStatistic< Type >

Template class for CDatasetStatistics.

Constructor & Destructor Documentation

template<class Type >
CDatasetStatistic< Type >::CDatasetStatistic ( void  )

Constructor

template<class Type >
CDatasetStatistic< Type >::CDatasetStatistic ( CDataset< Type > *  ptDataset)

Constructor

template<class Type >
CDatasetStatistic< Type >::~CDatasetStatistic ( )

Default destructor.

Member Function Documentation

template<class Type >
virtual string CDatasetStatistic< Type >::className ( ) const
inlinevirtual

Returns the class name.

Reimplemented from CObject< Type >.

template<class Type >
static CMatrix<Type> CDatasetStatistic< Type >::covarianceMatrix ( const CDataset< Type > &  rtDs,
Type  tClassLabel 
)
static

Calculate covariance matrix of elements in rtDs with class label tClassLabel.

template<class Type >
static CMatrix<Type> CDatasetStatistic< Type >::covarianceMatrix ( const CDataset< Type > &  rtDs)
static

Calculate covariance matrix of elements in rtDs.

template<class Type >
void CDatasetStatistic< Type >::dumpStatistic ( )

Same as above, but data will be dumped to stdout

template<class Type >
CMatrix<Type> CDatasetStatistic< Type >::getAutoCorrelation ( void  )

Gets the auto-correlation matrix.

Returns
tACMatrix Auto-correlation matrix of the input data.
template<class Type >
CDataset<Type>* CDatasetStatistic< Type >::getData ( void  )

Gets the data

Returns
copy of the internal dataset
template<class Type >
CMatrix<Type> CDatasetStatistic< Type >::getLDA ( void  )

Gets the class independet LDA-matrix. (inv(within-class scatter)*between class scatter).

template<class Type >
CMatrix<Type> CDatasetStatistic< Type >::getSB ( void  )

Gets the between class scatter matrix.

template<class Type >
CMatrix<Type> CDatasetStatistic< Type >::getSW ( void  )

Gets the whitin class scatter matrix.

template<class Type >
int CDatasetStatistic< Type >::inputDimension ( void  )

Return the input dimesion

Returns
input dimension
template<class Type >
CDenseVector<Type> CDatasetStatistic< Type >::maxElements ( )

Calculates the maximal value for each feature of the input vector.

Returns
Vector with maximal values.
template<class Type >
static CDenseVector<Type> CDatasetStatistic< Type >::mean ( const CDataset< Type > &  rtDs,
Type  tClassLabel 
)
static

Calculate mean vector of elements in rtDs with class label tClassLabel.

template<class Type >
static CDenseVector<Type> CDatasetStatistic< Type >::mean ( const CDataset< Type > &  rtDs)
static

Calculate mean vector of elements in rtDs.

template<class Type >
CDenseVector<Type> CDatasetStatistic< Type >::minElements ( )

Calculates the minimal value for each feature of the input vector.

Returns
Vector with minimal values.
template<class Type >
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

Parameters
iSizenumber of dataset elements to consider for rank matrix
rMetricmetric to use for computation of distance in input space
template<class Type >
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

Parameters
iSizenumber of dataset elements to consider for rank matrix
rNodeCoordsnode coordinates in map space
rMetricMapmetric to compute node distances in map space
template<class Type >
void CDatasetStatistic< Type >::setData ( CDataset< Type > *  ptSet)

Sets the dataset

Parameters
ptSetPointer to the new dataset
template<class Type >
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

Parameters
iSizenumber of dataset elements to consider for rank list
rNodeCoordsnode coordinates in map space
rMetricMapmetric to compute node distances in map space
rMetricDatametric to compute distances in feature space
template<class Type >
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.

Parameters
rtMeanVector which will be filled with mean values
rtDeviationVector which will be filled with standard deviation
rtVarianceVector which will be filled with variance
template<class Type >
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.

Parameters
rtPatternPattern
rtMeanVector which will be filled with mean values
rtDeviationVector which will be filled with standard deviation
rtVarianceVector which will be filled with variance
Numberof items considered

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