Share via


RegressionTreeBase Class

Definition

A container base class for exposing Microsoft.ML.Trainers.FastTree.InternalRegressionTree's and Microsoft.ML.Trainers.FastTree.InternalQuantileRegressionTree's attributes to users. This class should not be mutable, so it contains a lot of read-only members.

public abstract class RegressionTreeBase
type RegressionTreeBase = class
Public MustInherit Class RegressionTreeBase
Inheritance
RegressionTreeBase
Derived

Properties

CategoricalSplitFlags

Determine the types of splitting function. If CategoricalSplitFlags[i] is true, the i-th node's uses categorical splitting function. Otherwise, traditional numerical split is used.

LeafValues

LeafValues[i] is the learned value at the i-th leaf.

LeftChild

LeftChild[i] is the i-th node's child index used when (1) the numerical feature indexed by NumericalSplitFeatureIndexes[i] is less than or equal to the threshold NumericalSplitThresholds[i], or (2) the categorical features indexed by GetCategoricalCategoricalSplitFeatureRangeAt(Int32)'s returned value with nodeIndex=i is NOT a sub-set of GetCategoricalSplitFeaturesAt(Int32) with nodeIndex=i. Note that the case (1) happens only when CategoricalSplitFlags[i] is false and otherwise (2) occurs. A non-negative returned value means a node (i.e., not a leaf); for example, 2 means the 3rd node in the underlying Microsoft.ML.Trainers.FastTree.RegressionTreeBase._tree. A negative returned value means a leaf; for example, -1 stands for the ~(-1)-th leaf in the underlying Microsoft.ML.Trainers.FastTree.RegressionTreeBase._tree. Note that ~ is the bitwise complement operator in C#; for details, see https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-complement-operator.

NumberOfLeaves

Number of leaves in the tree. Note that NumberOfLeaves does not take non-leaf nodes into account.

NumberOfNodes

Number of nodes in the tree. This doesn't include any leaves. For example, a tree with node0->node1, node0->leaf3, node1->leaf1, node1->leaf2, NumberOfNodes and NumberOfLeaves should be 2 and 3, respectively.

NumericalSplitFeatureIndexes

NumericalSplitFeatureIndexes[i] is the feature index used the splitting function of the i-th node. This value is valid only if CategoricalSplitFlags[i] is false.

NumericalSplitThresholds

NumericalSplitThresholds[i] is the threshold on feature indexed by NumericalSplitFeatureIndexes[i], where i is the i-th node's index (for example, i is 1 for the 2nd node in Microsoft.ML.Trainers.FastTree.RegressionTreeBase._tree).

RightChild

RightChild[i] is the i-th node's child index used when the two conditions, (1) and (2), described in LeftChild's document are not true. Its return value follows the format used in LeftChild.

SplitGains

The gains obtained by splitting data at nodes. Its i-th value is computed from to the split at the i-th node.

Methods

GetCategoricalCategoricalSplitFeatureRangeAt(Int32)

Return categorical thresholds' range used at node indexed by nodeIndex. A categorical split at node indexed by nodeIndex can consider multiple consecutive input features at one time; their range is specified by GetCategoricalCategoricalSplitFeatureRangeAt(Int32). The returned value is always a 2-element array; its 1st element is the starting index and its 2nd element is the endining index of a feature segment. The returned value is valid only if CategoricalSplitFlags[nodeIndex] is true.

GetCategoricalSplitFeaturesAt(Int32)

Return categorical thresholds used at node indexed by nodeIndex. If the considered input feature does NOT matche any of values returned by GetCategoricalSplitFeaturesAt(Int32), we call it a less-than-threshold event and therefore LeftChild[nodeIndex] is the child node that input should go next. The returned value is valid only if CategoricalSplitFlags[nodeIndex] is true.

Applies to