Table of Contents

Class RTrees

Namespace
OpenCvSharp.ML
Assembly
OpenCvSharp.dll

The class implements the random forest predictor.

public class RTrees : DTrees, IDisposable, ICvPtrHolder
Inheritance
RTrees
Implements
Inherited Members

Constructors

RTrees(nint)

Creates instance by raw pointer cv::ml::RTrees*

protected RTrees(nint p)

Parameters

p nint

Properties

ActiveVarCount

The size of the randomly selected subset of features at each tree node and that are used to find the best split(s).

public int ActiveVarCount { get; set; }

Property Value

int

CalculateVarImportance

If true then variable importance will be calculated and then it can be retrieved by RTrees::getVarImportance. Default value is false.

public bool CalculateVarImportance { get; set; }

Property Value

bool

TermCriteria

The termination criteria that specifies when the training algorithm stops.

public TermCriteria TermCriteria { get; set; }

Property Value

TermCriteria

Methods

Create()

Creates the empty model.

public static RTrees Create()

Returns

RTrees

DisposeManaged()

Releases managed resources

protected override void DisposeManaged()

GetVarImportance()

Returns the variable importance array. The method returns the variable importance vector, computed at the training stage when CalculateVarImportance is set to true. If this flag was set to false, the empty matrix is returned.

public Mat GetVarImportance()

Returns

Mat

Load(string)

Loads and creates a serialized model from a file.

public static RTrees Load(string filePath)

Parameters

filePath string

Returns

RTrees

LoadFromString(string)

Loads algorithm from a String.

public static RTrees LoadFromString(string strModel)

Parameters

strModel string

he string variable containing the model you want to load.

Returns

RTrees