Machine Learning Library
|
SOM class for Self Organizing Maps with arbitrary topology. More...
#include <MysqlDatabase.h>
Public Member Functions | |
CSOM (CMetric< double > *ptTheGridMetric=new CEuclideanMetric< double >()) | |
CSOM (const CSOM< Type > &SOM) | |
Copy constructor. More... | |
~CSOM () | |
Descructor. More... | |
void | setGridMetric (CMetric< double > *ptMetric) |
void | setDataMetric (CMetric< Type > *ptMetric) |
CMetric< Type > * | getDataMetricPtr () |
void | setAlphaRate (CLearnRate< Type > *ptRate) |
void | setSigmaRate (CLearnRate< Type > *ptRate) |
void | setKernel (CKernel< Type > *ptTheKernel) |
CSomTopology< Type > * | topologyPtr () |
CDataset< Type > & | metaData () |
Returns the meta data dataset containing some statistics like node sizes. More... | |
void | setMetaData (int iPos, Type *ptTheData) |
float | getMeta4Node (int iNode, int iPos) |
void | setUpdateSteps (int iVal) |
CLearnRate< Type > & | getAlphaRate () |
CLearnRate< Type > & | getSigmaRate () |
CKernel< Type > & | getKernel () |
void | setLabel (int iNode, string strLabel) |
string | getLabel (int iNode) |
void | applyDataset (CDataset< Type > &rtDataset, int iMode=COPY_CLASSCOUNT) |
void | setUnit (int iNode, CDenseVector< Type > &rtVec) |
int | setCartesianTopology (vector< int > &rviNbUnits) |
int | setHyperbolicTopology (int iNeighbours, int iRings, int iVisible=3) |
void | setUnitsFromDataset (CDataset< Type > &rtData) |
void | setUnitsFromDatasetRandom (CDataset< Type > &rtData) |
void | setUnitsAlongVectors (vector< CDenseVector< Type > > cVectors, vector< Type > cMin, vector< Type > cMax) |
void | train (CDataset< Type > &rtTrainSet) |
void | trainTopology (CDataset< Type > &rtTrainSet) |
void | trainGrowing (CDataset< Type > &rtTrainSet, float fGrowParam) |
CDataset< double > & | nodeData () |
Type | minimal_wiring (CMetric< Type > &cMetric) |
void | dump (void) |
Dumps the entire SOM to cout. More... | |
void | uMat (vector< Type > &rvtDist, Type fNeighborhood) |
int | getNumNodes () |
int | getNumVisibleNodes () |
int | getVisibleNode (int iPos) |
void | copyNodeAttributes (int iContext, int iAttrib, float *pfTarget, float &fMin, float &fMax, float *pfSource=NULL) |
void | copyNodeDistances (float *pfDist) |
bool | selectNode (int iNode, bool bSelect) |
int | getNumSelectedNodes () |
int | getSelectedNodes (bool bFirst) |
int | getBestMatchID () |
Type | getNodeDistance (int iN1, int iN2) |
void | setFlowSize (int iNumItems) |
int | getFlowSize () |
void | setFlowItem (int iPos, int *piNodes, char *pcDate, unsigned long iTime) |
void | computeFlow (float *pfParams) |
void | getFlow (int iPos, float *pfTarget, char *pcDate) |
int | getChildren (int iNode, int *piChildren) |
float | getProgress () |
![]() | |
CClusterAlgorithm (CMetric< Type > *ptMetric=new CEuclideanMetric< Type >()) | |
virtual | ~CClusterAlgorithm () |
void | setMetric (CMetric< Type > *ptMetric) |
CDataset< Type > | getReferenceVectors () const |
CDataset< Type > & | referenceVectors () |
Type | rmse (const CDataset< Type > &tDataset) const |
int | nearestNode (const CVector< Type > &rtPattern) const |
Type | nearestNodeDistance (const CVector< Type > &rtPattern) const |
bool | serialize (fstream &stream, IO_MODE mode) |
![]() | |
CObject () | |
Constructor. More... | |
virtual | ~CObject () |
Destructor. More... | |
virtual bool | serialize2 (CArchiv &tArchiv) |
virtual string | className () const |
Returns the class name. More... | |
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... | |
Public Attributes | |
vector< string > | vTopicNames |
Meta data: topic names. More... | |
Friends | |
class | CHyperbolicTopology< Type > |
Additional Inherited Members | |
![]() | |
CDataset< Type > | tReferenceVectors |
CMetric< Type > * | ptMetric |
![]() | |
unsigned char | ucVerbose |
SOM class for Self Organizing Maps with arbitrary topology.
CSOM< Type >::CSOM | ( | CMetric< double > * | ptTheGridMetric = new CEuclideanMetric< double >() | ) |
Constrcutor creates a new SOM instance
ptTheGridMetric | The metric to use for distance computation of nodes on the grid. |
void CSOM< Type >::applyDataset | ( | CDataset< Type > & | rtDataset, |
int | iMode = COPY_CLASSCOUNT |
||
) |
Throws an entire dataset onto the SOM. Copy class count statistics or reference vectors to meta statistics or append list of BMUs for each input vector of the dataset to the output vector depending on the value of iMode.
iMode | Switch between different modes: COPY_CLASSCOUNT (1), COPY_PROTOTYPE (2), APPEND_BMUS (4) |
void CSOM< Type >::computeFlow | ( | float * | pfParams | ) |
void CSOM< Type >::copyNodeAttributes | ( | int | iContext, |
int | iAttrib, | ||
float * | pfTarget, | ||
float & | fMin, | ||
float & | fMax, | ||
float * | pfSource = NULL |
||
) |
void CSOM< Type >::copyNodeDistances | ( | float * | pfDist | ) |
void CSOM< Type >::dump | ( | void | ) |
Dumps the entire SOM to cout.
|
inline |
|
inline |
int CSOM< Type >::getChildren | ( | int | iNode, |
int * | piChildren | ||
) |
void CSOM< Type >::getFlow | ( | int | iPos, |
float * | pfTarget, | ||
char * | pcDate | ||
) |
|
inline |
string CSOM< Type >::getLabel | ( | int | iNode | ) |
|
inline |
Type CSOM< Type >::getNodeDistance | ( | int | iN1, |
int | iN2 | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
int CSOM< Type >::getSelectedNodes | ( | bool | bFirst | ) |
|
inline |
|
inline |
Returns the meta data dataset containing some statistics like node sizes.
Calculate minimal wiring.
ctTestSet | Reference to a test set. |
ctMetric | Reference to a metric. |
bool CSOM< Type >::selectNode | ( | int | iNode, |
bool | bSelect | ||
) |
void CSOM< Type >::setAlphaRate | ( | CLearnRate< Type > * | ptRate | ) |
Set the learning rate for the learning stepwidth alpha
ptRate | The new alpha rate. |
int CSOM< Type >::setCartesianTopology | ( | vector< int > & | rviNbUnits | ) |
Initializes the position of the nodes in the output space. The function set the node vectors according to an equidistant grid, while the number of nodes in each dimension can be specified using rviNbUnits.
rviNbUnits | Reference to an vector holding the number of nodes/dimension. |
Set the data metric
ptMetric | The new metric to use for computation of distances in the data space - This is used to compute the best match node. |
void CSOM< Type >::setFlowItem | ( | int | iPos, |
int * | piNodes, | ||
char * | pcDate, | ||
unsigned long | iTime | ||
) |
void CSOM< Type >::setFlowSize | ( | int | iNumItems | ) |
Set the grid metric
ptMetric | The new metric to use. |
int CSOM< Type >::setHyperbolicTopology | ( | int | iNeighbours, |
int | iRings, | ||
int | iVisible = 3 |
||
) |
Initializes the position of the nodes in the output space. Places the nodes on a regular grid obtained by a tessellation of the hyperbolic plane H2 with congruent triangles.
iNeighbours | Number of neighbours each node will have |
iRings | Number of rings around center node |
iVisible | Number of visible rings which are passed to VTK |
Set the kernel for the neighborhood function.
ptTheKernel | The new kernel to use for computation of h. |
void CSOM< Type >::setLabel | ( | int | iNode, |
string | strLabel | ||
) |
void CSOM< Type >::setMetaData | ( | int | iPos, |
Type * | ptTheData | ||
) |
void CSOM< Type >::setSigmaRate | ( | CLearnRate< Type > * | ptRate | ) |
Set the rate for the neighborhood width
ptRate | The new learning rate for the neighborhood parameter sigma. |
void CSOM< Type >::setUnit | ( | int | iNode, |
CDenseVector< Type > & | rtVec | ||
) |
void CSOM< Type >::setUnitsAlongVectors | ( | vector< CDenseVector< Type > > | cVectors, |
vector< Type > | cMin, | ||
vector< Type > | cMax | ||
) |
Initializes the position of the prototype vectors in the input space. The function set prototype vectors along the given vectors.
rtData | Reference to an CDataset. |
Initializes the position of the prototype vectors in the input space. The function set prototype vectors according to a given dataset.
rtData | Reference to an CDataset. |
Initializes the position of the prototype vectors in the input space. The function set prototype vectors according to a random selection of vectors from a given dataset.
rtData | Reference to an CDataset. |
|
inline |
|
inline |
Cluster given dataset
tDataset | Reference to dataset |
Implements CClusterAlgorithm< Type >.
Referenced by CCartesianTopology< Type >::train().
|
inline |
void CSOM< Type >::uMat | ( | vector< Type > & | rvtDist, |
Type | fNeighborhood | ||
) |
Calculates the average inter-node distance between a reference vector and it neighbors in a given distance in the output space.
rvtDist | Reference to a vector with the average inter-node distance. |
fNeighborhood | Range of the neighborhood (default 1.0). |
|
friend |
vector<string> CSOM< Type >::vTopicNames |
Meta data: topic names.