Skip to content

add_sample_class_train_dataAddSampleClassTrainDataAddSampleClassTrainDataadd_sample_class_train_dataT_add_sample_class_train_data🔗

Short description🔗

add_sample_class_train_dataAddSampleClassTrainDataAddSampleClassTrainDataadd_sample_class_train_dataT_add_sample_class_train_data — Add a training sample to training data.

Signature🔗

add_sample_class_train_data( class_train_data ClassTrainDataHandle, string Order, number Features, integer ClassID )void AddSampleClassTrainData( const HTuple& ClassTrainDataHandle, const HTuple& Order, const HTuple& Features, const HTuple& ClassID )static void HOperatorSet.AddSampleClassTrainData( HTuple classTrainDataHandle, HTuple order, HTuple features, HTuple classID )def add_sample_class_train_data( class_train_data_handle: HHandle, order: str, features: Sequence[float], class_id: Sequence[int] ) -> None

Herror T_add_sample_class_train_data( const Htuple ClassTrainDataHandle, const Htuple Order, const Htuple Features, const Htuple ClassID )

void HClassTrainData::AddSampleClassTrainData( const HString& Order, const HTuple& Features, const HTuple& ClassID ) const

void HClassTrainData::AddSampleClassTrainData( const char* Order, const HTuple& Features, const HTuple& ClassID ) const

void HClassTrainData::AddSampleClassTrainData( const wchar_t* Order, const HTuple& Features, const HTuple& ClassID ) const (Windows only)

void HClassTrainData.AddSampleClassTrainData( string order, HTuple features, HTuple classID )

Description🔗

add_sample_class_train_dataAddSampleClassTrainData adds a training sample to the training data given by ClassTrainDataHandleclassTrainDataHandleclass_train_data_handle. The training sample is given by Featuresfeaturesfeatures and ClassIDclassIDclass_id. Featuresfeaturesfeatures is the feature vector of the sample, and consequently must be a real vector of length NumDimnumDimnum_dim, as specified in create_class_train_dataCreateClassTrainData. ClassIDclassIDclass_id is the class of the sample. More than one training sample can be added at once. In this case the parameter Orderorderorder defines in which order the elements of the feature vectors are passed in Featuresfeaturesfeatures. If it is set to 'row'"row", the first training sample comes first, the second comes second, and so on. If it is set to 'column'"column", the first dimension of all feature vectors comes first, and then the second dimension of all feature vectors, and so on. The third possible mode for Orderorderorder is 'feature_column'"feature_column". This mode expects features which were grouped before with set_feature_lengths_class_train_dataSetFeatureLengthsClassTrainData to come completely and row-wise before the second feature, and so on.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

ClassTrainDataHandleclassTrainDataHandleclass_train_data_handle (input_control, state is modified) class_train_data → (handle)HTuple (HHandle)HClassTrainData, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the training data.

Orderorderorder (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

The order of the feature vector.

Default: 'row'"row"
List of values: 'column', 'feature_column', 'row'"column", "feature_column", "row"

Featuresfeaturesfeatures (input_control) number-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Feature vector of the training sample.

ClassIDclassIDclass_id (input_control) integer-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Class of the training sample.

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

create_class_train_dataCreateClassTrainData

Possible successors

add_class_train_data_svmAddClassTrainDataSvm, add_class_train_data_knnAddClassTrainDataKnn, add_class_train_data_gmmAddClassTrainDataGmm, add_class_train_data_mlpAddClassTrainDataMlp

See also

create_class_train_dataCreateClassTrainData

Module🔗

Foundation