CreateRTreesModel

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:

HRESULT CreateRTreesModel(
    HRESULT         hrPrev,
    ITcVnMlModel*&  ipMlModel,
    ETcVnRTrees     eRTreesType,
    ULONG           nMaxDepth = 5,
    ULONG           nMinSamples = 10,
    ULONG           nActiveVariables = 0,
    ULONG           nMaxIterations = 0,
    double          fEpsilon = 0.0,
    float           fRegressionAccuracy = 0,
    ITcVnContainer* ipClassPriors = nullptr
)

Parameters

Name

Type

Default

Description

hrPrev

HRESULT

 

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

ipMlModel

ITcVnMlModel*&

 

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

eRTreesType

ETcVnRTrees

 

Random trees model type

nMaxDepth

ULONG

5

Maximum tree depth (default: 5)

nMinSamples

ULONG

10

Minimum number of samples within a node required for splitting (default: 10)

nActiveVariables

ULONG

0

Number of variables considered for splitting (0 means sqrt(total number of variables); default: 0)

nMaxIterations

ULONG

0

Maximum number of iterations (disabled if it equals 0 and fEpsilon is different from 0.0; triggers the usage of the default value of 50 if nMaxIterations and fEpsilon equal 0)

fEpsilon

double

0.0

Maximum allowed difference of the error between two successive iterations (disabled if it equals 0.0 and nMaxIterations is different from 0; triggers the usage of the default value of 0.1 if nMaxIterations and fEpsilon equal 0)

fRegressionAccuracy

float

0

Termination criterion for regressors (only for regressors; set to default if not allowed; default: 0.0)

ipClassPriors

ITcVnContainer*

nullptr

Class priors (ContainerType_Vector_REAL or ContainerType_Vector_LREAL; only for classifiers; optional, set to 0 if not required or not allowed; default: 0)

CreateRTreesModel 1: Return value

HRESULT

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