ClassesClasses | | Operators

get_sample_class_gmmT_get_sample_class_gmmGetSampleClassGmmGetSampleClassGmm (Operator)

Name

get_sample_class_gmmT_get_sample_class_gmmGetSampleClassGmmGetSampleClassGmm — Return a training sample from the training data of a Gaussian Mixture Models (GMM).

Signature

get_sample_class_gmm( : : GMMHandle, NumSample : Features, ClassID)

Herror T_get_sample_class_gmm(const Htuple GMMHandle, const Htuple NumSample, Htuple* Features, Htuple* ClassID)

void GetSampleClassGmm(const HTuple& GMMHandle, const HTuple& NumSample, HTuple* Features, HTuple* ClassID)

HTuple HClassGmm::GetSampleClassGmm(Hlong NumSample, Hlong* ClassID) const

static void HOperatorSet.GetSampleClassGmm(HTuple GMMHandle, HTuple numSample, out HTuple features, out HTuple classID)

HTuple HClassGmm.GetSampleClassGmm(int numSample, out int classID)

Description

get_sample_class_gmmget_sample_class_gmmGetSampleClassGmmGetSampleClassGmmGetSampleClassGmm reads out a training sample from the Gaussian Mixture Model (GMM) given by GMMHandleGMMHandleGMMHandleGMMHandleGMMHandle that was stored with add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmm or add_samples_image_class_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmAddSamplesImageClassGmm. The index of the sample is specified with NumSampleNumSampleNumSampleNumSamplenumSample. The index is counted from 0, i.e., NumSampleNumSampleNumSampleNumSamplenumSample must be a number between 0 and NumSamplesNumSamplesNumSamplesNumSamplesnumSamples - 1, where NumSamplesNumSamplesNumSamplesNumSamplesnumSamples can be determined with get_sample_num_class_gmmget_sample_num_class_gmmGetSampleNumClassGmmGetSampleNumClassGmmGetSampleNumClassGmm. The training sample is returned in FeaturesFeaturesFeaturesFeaturesfeatures and ClassIDClassIDClassIDClassIDclassID. FeaturesFeaturesFeaturesFeaturesfeatures is a feature vector of length NumDimNumDimNumDimNumDimnumDim, while ClassIDClassIDClassIDClassIDclassID is its class (see add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmm and create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm).

get_sample_class_gmmget_sample_class_gmmGetSampleClassGmmGetSampleClassGmmGetSampleClassGmm can, for example, be used to reclassify the training data with classify_class_gmmclassify_class_gmmClassifyClassGmmClassifyClassGmmClassifyClassGmm in order to determine which training samples, if any, are classified incorrectly.

Execution Information

Parameters

GMMHandleGMMHandleGMMHandleGMMHandleGMMHandle (input_control)  class_gmm HClassGmm, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

GMM handle.

NumSampleNumSampleNumSampleNumSamplenumSample (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index of the stored training sample.

FeaturesFeaturesFeaturesFeaturesfeatures (output_control)  real-array HTupleHTupleHtuple (real) (double) (double) (double)

Feature vector of the training sample.

ClassIDClassIDClassIDClassIDclassID (output_control)  number HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Class of the training sample.

Example (HDevelop)

create_class_gmm (2, 2, [1,10], 'spherical', 'none', 2, 42, GMMHandle)
read_samples_class_gmm (GMMHandle, 'samples.gsf')
train_class_gmm (GMMHandle, 100, 1e-4, 'training', 1e-4, Centers, Iter)
* Reclassify the training samples
get_sample_num_class_gmm (GMMHandle, NumSamples)
for I := 0 to NumSamples-1 by 1
  get_sample_class_gmm (GMMHandle, I, Features, Class)
  classify_class_gmm (GMMHandle, Features, 2, ClassID, ClassProb,\
                      Density, KSigmaProb)
  if (not (Class == ClassProb[0]))
    * classified incorrectly
  endif
endfor
clear_class_gmm (GMMHandle)

Result

If the parameters are valid, the operator get_sample_class_gmmget_sample_class_gmmGetSampleClassGmmGetSampleClassGmmGetSampleClassGmm returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Possible Predecessors

add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmm, add_samples_image_class_gmmadd_samples_image_class_gmmAddSamplesImageClassGmmAddSamplesImageClassGmmAddSamplesImageClassGmm, read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmmReadSamplesClassGmm, get_sample_num_class_gmmget_sample_num_class_gmmGetSampleNumClassGmmGetSampleNumClassGmmGetSampleNumClassGmm

Possible Successors

classify_class_gmmclassify_class_gmmClassifyClassGmmClassifyClassGmmClassifyClassGmm, evaluate_class_gmmevaluate_class_gmmEvaluateClassGmmEvaluateClassGmmEvaluateClassGmm

See also

create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm

Module

Foundation


ClassesClasses | | Operators