GClasses
GClasses::SOM::NodeWeightInitializationTrainingSetSample Class Reference

Detailed Description

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

#include <GSelfOrganizingMap.h>

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

Public Member Functions

 NodeWeightInitializationTrainingSetSample (GRand &rand)
 Create a TraningSetSample object that uses the random numbers generated by pRand. rand is assumed to have a lifetime exceeding the lifetime of this object. More...
 
virtual ~NodeWeightInitializationTrainingSetSample ()
 Virtual destructor for good memory hygiene. More...
 
virtual void setWeights (std::vector< Node > &nodes, GDistanceMetric &weightDistance, const 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. More...
 
- Public Member Functions inherited from GClasses::SOM::NodeWeightInitialization
virtual ~NodeWeightInitialization ()
 Virtual destructor for good memory hygiene. More...
 

Constructor & Destructor Documentation

GClasses::SOM::NodeWeightInitializationTrainingSetSample::NodeWeightInitializationTrainingSetSample ( GRand rand)

Create a TraningSetSample object that uses the random numbers generated by pRand. rand is assumed to have a lifetime exceeding the lifetime of this object.

virtual GClasses::SOM::NodeWeightInitializationTrainingSetSample::~NodeWeightInitializationTrainingSetSample ( )
inlinevirtual

Virtual destructor for good memory hygiene.

Member Function Documentation

virtual void GClasses::SOM::NodeWeightInitializationTrainingSetSample::setWeights ( std::vector< Node > &  nodes,
GDistanceMetric weightDistance,
const 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.