GClasses

GClasses::SOM::NodeWeightInitializationTrainingSetSample Class Reference

Initializes the weights to a random sample of rows from the training set. More...

#include <GSelfOrganizingMap.h>

Inheritance diagram for GClasses::SOM::NodeWeightInitializationTrainingSetSample:
GClasses::SOM::NodeWeightInitialization

List of all members.

Public Member Functions

 NodeWeightInitializationTrainingSetSample (GRand *pRand=NULL)
 Create a TraningSetSample object that uses the random numbers generated by pRand. pRand is assumed to have a lifetime exceeding the lifetime of this object. If pRand is NULL, uses the global random number generator.
virtual void setWeights (std::vector< Node > &nodes, GDistanceMetric &weightDistance, GMatrix *pIn) const
 Sets the weights of the nodes in the vector nodes to the a random sample of the rows of pIn chosen without replacement. Note that there must be at least as many vectors in pIn as there are nodes in nodes. Also, note that in the current implementation, if the number of nodes is close to the number of weights, selecting without replacement can take a very long time.
virtual ~NodeWeightInitializationTrainingSetSample ()
 Virtual destructor for good memory hygiene.

Detailed Description

Initializes the weights to a random sample of rows from the training set.


Constructor & Destructor Documentation

GClasses::SOM::NodeWeightInitializationTrainingSetSample::NodeWeightInitializationTrainingSetSample ( GRand pRand = NULL)

Create a TraningSetSample object that uses the random numbers generated by pRand. pRand is assumed to have a lifetime exceeding the lifetime of this object. If pRand is NULL, uses the global random number generator.

virtual GClasses::SOM::NodeWeightInitializationTrainingSetSample::~NodeWeightInitializationTrainingSetSample ( ) [inline, virtual]

Virtual destructor for good memory hygiene.


Member Function Documentation

virtual void GClasses::SOM::NodeWeightInitializationTrainingSetSample::setWeights ( std::vector< Node > &  nodes,
GDistanceMetric weightDistance,
GMatrix pIn 
) const [virtual]

Sets the weights of the nodes in the vector nodes to the a random sample of the rows of pIn chosen without replacement. Note that there must be at least as many vectors in pIn as there are nodes in nodes. Also, note that in the current implementation, if the number of nodes is close to the number of weights, selecting without replacement can take a very long time.

see comment on NodeWeightInitialization::setWeights

Implements GClasses::SOM::NodeWeightInitialization.