get_sample_class_knnT_get_sample_class_knnGetSampleClassKnnGetSampleClassKnnget_sample_class_knn (Operator)
Name
get_sample_class_knnT_get_sample_class_knnGetSampleClassKnnGetSampleClassKnnget_sample_class_knn
— Return a training sample from the training data of a k-nearest neighbors
(k-NN) classifier.
Signature
Description
get_sample_class_knnget_sample_class_knnGetSampleClassKnnGetSampleClassKnnGetSampleClassKnnget_sample_class_knn
reads a training sample from the
k-nearest neighbors (k-NN) classifier given by KNNHandleKNNHandleKNNHandleKNNHandleKNNHandleknnhandle
that was
added with add_sample_class_knnadd_sample_class_knnAddSampleClassKnnAddSampleClassKnnAddSampleClassKnnadd_sample_class_knn
or
read_class_knnread_class_knnReadClassKnnReadClassKnnReadClassKnnread_class_knn
. The index of the sample is
specified with IndexSampleIndexSampleIndexSampleIndexSampleindexSampleindex_sample
. The index is counted from 0,
i.e., IndexSampleIndexSampleIndexSampleIndexSampleindexSampleindex_sample
must be a number between 0 and
NumSamplesNumSamplesNumSamplesNumSamplesnumSamplesnum_samples
- 1, where NumSamplesNumSamplesNumSamplesNumSamplesnumSamplesnum_samples
can be
determined with get_sample_num_class_knnget_sample_num_class_knnGetSampleNumClassKnnGetSampleNumClassKnnGetSampleNumClassKnnget_sample_num_class_knn
. The training
sample is returned in FeaturesFeaturesFeaturesFeaturesfeaturesfeatures
and ClassIDClassIDClassIDClassIDclassIDclass_id
.
FeaturesFeaturesFeaturesFeaturesfeaturesfeatures
is a feature vector of length
NumDimNumDimNumDimNumDimnumDimnum_dim
(see create_class_knncreate_class_knnCreateClassKnnCreateClassKnnCreateClassKnncreate_class_knn
), while ClassIDClassIDClassIDClassIDclassIDclass_id
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
KNNHandleKNNHandleKNNHandleKNNHandleKNNHandleknnhandle
(input_control) class_knn →
HClassKnn, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the k-NN classifier.
IndexSampleIndexSampleIndexSampleIndexSampleindexSampleindex_sample
(input_control) integer →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the training sample.
FeaturesFeaturesFeaturesFeaturesfeaturesfeatures
(output_control) real-array →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Feature vector of the training sample.
ClassIDClassIDClassIDClassIDclassIDclass_id
(output_control) integer-array →
HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Class of the training sample.
Result
If the parameters are valid the operator
get_sample_class_knnget_sample_class_knnGetSampleClassKnnGetSampleClassKnnGetSampleClassKnnget_sample_class_knn
returns the value TRUE. If necessary,
an exception is raised.
Possible Predecessors
add_sample_class_train_dataadd_sample_class_train_dataAddSampleClassTrainDataAddSampleClassTrainDataAddSampleClassTrainDataadd_sample_class_train_data
See also
create_class_knncreate_class_knnCreateClassKnnCreateClassKnnCreateClassKnncreate_class_knn
Module
Foundation