F_VN_CreateNbcModel

F_VN_CreateNbcModel 1:

Create a normal Bayes classifier of the specified type. The initial reference count is set to one if a new model is created and kept, otherwise. In order to train normal Bayes classifiers, a sufficiently high number of samples is required for each class. It depends on the number of features and the distribution of the data. Hence, it needs to be tested for each application. Models of this type do not support on-line training (sample by sample). For the retraining of such classifier models, the set of presented classes must be identical to the previous learning steps. Otherwise, an exception is raised.

Syntax

Definition:

FUNCTION F_VN_CreateNbcModel : HRESULT
VAR_INPUT
    ipMlModel : Reference To ITcVnMlModel;
    eNbcType  : ETcVnNbc;
    hrPrev    : HRESULT;
END_VAR

F_VN_CreateNbcModel 2: Inputs

Name

Type

Description

ipMlModel

Reference To ITcVnMlModel

Returns the created model (Non-zero interface pointers are reused.)

eNbcType

ETcVnNbc

Normal Bayes classifier type

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_CreateNbcModel 3: Return value

HRESULT

Further information

The function F_VN_CreateNbcModel creates a Normal Bayes Classifier (NBC) model.

Normal Bayes Classifier models

The Normal Bayes Classifier creates a mixture model in which each class is represented by a Gaussian distribution. The parameters of these Gaussian functions are determined during training.

Parameter

Model

The created model is returned in the interface pointer ipMlModel.

Model type

eNbcType specifies whether NBC is used for classification (TCVN_NBC_CLASSIFIER) or for anomaly detection (TCVN_NBC_NOVELTY_DETECTOR).

Application

For example, an NBC model for classification can be created like this:

hr := F_VN_CreateNbcModel(
    ipMlModel   := ipMlModel,
    eNbcType    := TCVN_NBC_CLASSIFIER,
    hrPrev      := hr);

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