语言

RegressionTreeBase 类

定义

用于向用户公开 Microsoft.ML.Trainers.FastTree.InternalRegressionTree's 和 Microsoft.ML.Trainers.FastTree.InternalQuantileRegressionTree's 属性的容器基类。 此类不应可变,因此它包含大量只读成员。

public abstract class RegressionTreeBase
type RegressionTreeBase = class
Public MustInherit Class RegressionTreeBase
继承
RegressionTreeBase
派生

属性

名称 说明
CategoricalSplitFlags

确定拆分函数的类型。 如果 CategoricalSplitFlags[i] 为 true,则 i-th 节点使用分类拆分函数。 否则,将使用传统的数字拆分。

LeafValues

LeafValues[i] 是第一个叶的已学习值。

LeftChild

LeftChild[i] 是当 (1) 由 NumericalSplitFeatureIndexes[i] 编制索引的数字特征小于或等于阈值 NumericalSplitThresholds[i] 时使用的 i-th 节点的子索引,或 (2) 由 GetCategoricalCategoricalSplitFeatureRangeAt(Int32)'s returned value with nodeIndex=i 为索引的分类特征不是 nodeIndex=i 的 GetCategoricalSplitFeaturesAt(Int32) 子集。 请注意,这种情况(1)仅在 CategoricalSplitFlags[i] 为 false 时发生,否则会发生 (2)。 非负返回的值表示节点(即,而不是叶):例如,2 表示基础 Microsoft.ML.Trainers.FastTree.RegressionTreeBase._tree中的第三个节点。 负返回的值表示叶;例如,-1 代表 ~基础 Microsoft.ML.Trainers.FastTree.RegressionTreeBase._tree中的第-1个叶。 请注意, ~ 是 C# 中的按位补运算符;有关详细信息,请参阅 https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-complement-operator。

NumberOfLeaves

树中的叶数。 请注意, NumberOfLeaves 不考虑非叶节点。

NumberOfNodes

树中的节点数。 这不包括任何叶子。 例如,具有 node0-node1>、node0-leaf3>、node1-leaf1、node1-leaf2 NumberOfNodes>>的NumberOfLeaves树应分别为 2 和 3。

NumericalSplitFeatureIndexes

NumericalSplitFeatureIndexes[i] 是使用第 i 节点的拆分函数的功能索引。 仅当 [i] 为 false 时 CategoricalSplitFlags,此值才有效。

NumericalSplitThresholds

NumericalSplitThresholds[i] 是 [ NumericalSplitFeatureIndexesi] 为功能编制索引的阈值,其中 i 是第二个节点的索引(例如,i 为第二个节点的 Microsoft.ML.Trainers.FastTree.RegressionTreeBase._tree1)。

RightChild

RightChild[i] 是当文档中描述的 LeftChild两个条件(1)和(2)时使用的 i-th 节点的子索引。 其返回值遵循所使用的 LeftChild格式。

SplitGains

通过在节点上拆分数据获得的增益。 它的 i-th 值从第 i 节点的拆分计算。

方法

名称 说明
GetCategoricalCategoricalSplitFeatureRangeAt(Int32)

返回在 nodeIndex 编制索引的节点中使用的分类阈值范围。 由 nodeIndex 编制索引的节点的分类拆分可以一次性考虑多个连续输入特征:其范围由 GetCategoricalCategoricalSplitFeatureRangeAt(Int32). 返回的值始终为 2 元素数组;其第 1 个元素是起始索引,第 2 个元素是特征段的结束索引。 仅当 [nodeIndex] 为 true 时 CategoricalSplitFlags,返回的值才有效。

GetCategoricalSplitFeaturesAt(Int32)

返回在 nodeIndex 编制索引的节点中使用的分类阈值。 如果已考虑的输入功能与所 GetCategoricalSplitFeaturesAt(Int32)返回的任何值不匹配,我们将它称为小于阈值的事件,因此 LeftChild[nodeIndex] 是输入应接下来返回的子节点。 仅当 [nodeIndex] 为 true 时 CategoricalSplitFlags,返回的值才有效。

适用于