get_sample_class_knnT_get_sample_class_knnGetSampleClassKnnGetSampleClassKnn (Operator)
Name
get_sample_class_knnT_get_sample_class_knnGetSampleClassKnnGetSampleClassKnn
— Return a training sample from the training data of a k-nearest neighbors
(k-NN) classifier.
Signature
Description
get_sample_class_knnget_sample_class_knnGetSampleClassKnnGetSampleClassKnnGetSampleClassKnn
reads a training sample from the
k-nearest neighbors (k-NN) classifier given by KNNHandleKNNHandleKNNHandleKNNHandleKNNHandle
that was
added with add_sample_class_knnadd_sample_class_knnAddSampleClassKnnAddSampleClassKnnAddSampleClassKnn
or
read_class_knnread_class_knnReadClassKnnReadClassKnnReadClassKnn
. The index of the sample is
specified with IndexSampleIndexSampleIndexSampleIndexSampleindexSample
. The index is counted from 0,
i.e., IndexSampleIndexSampleIndexSampleIndexSampleindexSample
must be a number between 0 and
NumSamples
- 1, where NumSamples
can be
determined with get_sample_num_class_knnget_sample_num_class_knnGetSampleNumClassKnnGetSampleNumClassKnnGetSampleNumClassKnn
. The training
sample is returned in FeaturesFeaturesFeaturesFeaturesfeatures
and ClassIDClassIDClassIDClassIDclassID
.
FeaturesFeaturesFeaturesFeaturesfeatures
is a feature vector of length
NumDim
(see create_class_knncreate_class_knnCreateClassKnnCreateClassKnnCreateClassKnn
), while ClassIDClassIDClassIDClassIDclassID
is the class label, which is a number between 0 and the
number of classes.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
KNNHandleKNNHandleKNNHandleKNNHandleKNNHandle
(input_control) class_knn →
HClassKnn, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the k-NN classifier.
IndexSampleIndexSampleIndexSampleIndexSampleindexSample
(input_control) integer →
HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the training sample.
FeaturesFeaturesFeaturesFeaturesfeatures
(output_control) real-array →
HTupleHTupleHtuple (real) (double) (double) (double)
Feature vector of the training sample.
ClassIDClassIDClassIDClassIDclassID
(output_control) integer-array →
HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Class of the training sample.
Result
If the parameters are valid the operator
get_sample_class_knnget_sample_class_knnGetSampleClassKnnGetSampleClassKnnGetSampleClassKnn
returns the value 2 (H_MSG_TRUE). If necessary,
an exception is raised.
Possible Predecessors
add_sample_class_train_dataadd_sample_class_train_dataAddSampleClassTrainDataAddSampleClassTrainDataAddSampleClassTrainData
See also
create_class_knncreate_class_knnCreateClassKnnCreateClassKnnCreateClassKnn
Module
Foundation