F_VN_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:
FUNCTION F_VN_CreateRTreesModel : HRESULT
VAR_INPUT
ipMlModel : Reference To ITcVnMlModel;
eRTreesType : ETcVnRTrees;
hrPrev : HRESULT;
END_VAR
Inputs
Name |
Type |
Description |
---|---|---|
ipMlModel |
Reference To ITcVnMlModel |
Returns the created model (Non-zero interface pointers are reused.) |
eRTreesType |
Random trees model type | |
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
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 |