F_VN_TrainSampleClass
Train a classifier with a single sample.
Syntax
Definition:
FUNCTION F_VN_TrainSampleClass : HRESULT
VAR_INPUT
ipClassifier : ITcVnMlModel;
ipSample : ITcUnknown;
nClass : DINT;
hrPrev : HRESULT;
END_VAR
Inputs
Name |
Type |
Description |
---|---|---|
ipClassifier |
Classifier to be used | |
ipSample |
Container holding a single input sample (ContainerType_Vector_REAL or ContainerType_Vector_LREAL) | |
nClass |
DINT |
Class label to be learnt |
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
Further information
The function F_VN_TrainSampleClass
trains a classifier model with a sample.
Parameter
Classifier model
The previously created classifier model must be transferred to ipClassifier
.
Sample
The sample container is transferred to ipSample
. The type of container must be ContainerType_Vector_REAL
or ContainerType_Vector_LREAL
.
Class
The target class for the sample is transferred as nClass
.
Application
For example, a classifier model can be trained with single samples as follows:
hr := F_VN_TrainSampleClass(
ipClassifier := ipMlModel,
ipSample := ipSample,
nClass := nClass,
hrPrev := hr);
Related functions
Required License
TC3 Vision Machine Learning
System Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT V3.1.4024.54 or later | PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU | Tc3_Vision |