F_VN_CreateRTreesModel

F_VN_CreateRTreesModel 1:

Create a random trees model of the specified type. The initial reference count is set to one if a new model is created and kept, otherwise. Models of this type neither support on-line training (sample by sample) nor retraining. Predictions can only be scalar.

Syntax

Definition:

FUNCTION F_VN_CreateRTreesModel : HRESULT
VAR_INPUT
    ipMlModel   : Reference To ITcVnMlModel;
    eRTreesType : ETcVnRTrees;
    hrPrev      : HRESULT;
END_VAR

F_VN_CreateRTreesModel 2: Inputs

Name

Type

Description

ipMlModel

Reference To ITcVnMlModel

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

eRTreesType

ETcVnRTrees

Random trees model type

hrPrev

HRESULT

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

F_VN_CreateRTreesModel 3: Return value

HRESULT

Further information

The function F_VN_CreateRTreesModel creates a Random Forest (RTrees) model.

Random Forest models

The Random Forest model uses decision trees whose branches are determined by a random process. The prediction of the RTrees models is determined from the results of the individual decision trees.

Parameter

Model

The created model is returned in the interface pointer ipMlModel.

Model type

eRTreesType specifies whether the Random Forest model is used for classification (TCVN_RT_CLASSIFIER) or for regression (TCVN_RT_REGRESSOR).

Expert parameters

The expert variants F_VN_CreateRTreesModelExp and F_VN_CreateRTreesModelExp2 contain additional parameters.

Application

For example, an RTrees model for regression can be created like this:

hr := F_VN_CreateRTreesModel(
    ipMlModel   := ipMlModel,
    eRTreesType := TCVN_RT_REGRESSOR,
    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