語言

RegressionTreeBase 類別

定義

一個容器基底類別,用來向 Microsoft.ML.Trainers.FastTree.InternalRegressionTree使用者揭露 's 和 Microsoft.ML.Trainers.FastTree.InternalQuantileRegressionTree的屬性。 這個類別不應該是可變的,因此它包含大量唯讀成員。

public abstract class RegressionTreeBase
type RegressionTreeBase = class
Public MustInherit Class RegressionTreeBase
繼承
RegressionTreeBase
衍生

屬性

名稱 Description
CategoricalSplitFlags

確定分裂函數的類型。 若 CategoricalSplitFlags[i] 為真,第 i 個節點的 則使用類別分割函數。 否則,則使用傳統的數值分割法。

LeafValues

LeafValues[i] 是第 i 個葉子的學習值。

LeftChild

LeftChild[i] 是第 i 個節點的子索引,當(1) 由 NumericalSplitFeatureIndexes[i] 索引的數值特徵小於或等於閾值 NumericalSplitThresholds[i],或 (2) 由 GetCategoricalCategoricalSplitFeatureRangeAt(Int32)的 的類別特徵索引,且 nodeIndex=i 的回傳值不是 nodeIndex GetCategoricalSplitFeaturesAt(Int32) =i 的子集合。 請注意,(1) 的情況僅在 [i] 為假時 CategoricalSplitFlags發生,否則發生 (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

樹中的節點數量。 這不包括任何葉子。 例如,一棵樹的節點0->節點1、節點0->葉子3、節點1->葉子1、節點1->葉子2, NumberOfNodes 以及 NumberOfLeaves 節點3,分別應為2和3。

NumericalSplitFeatureIndexes

NumericalSplitFeatureIndexes[i] 是第 i 個節點的分割函數所用的特徵索引。 此值僅在 [i] 為假時 CategoricalSplitFlags有效。

NumericalSplitThresholds

NumericalSplitThresholds[i] 是特徵的閾值,索引為 NumericalSplitFeatureIndexes[i] ,其中 i 是第 i 個節點的索引(例如,i 為第 2 個節點 Microsoft.ML.Trainers.FastTree.RegressionTreeBase._tree的 1)。

RightChild

RightChild[i] 是第 i 個節點的子索引,當文件中描述 LeftChild的兩個條件 (1) 和 (2) 都不成立時所用。 其回傳值遵循 中 LeftChild所使用的格式。

SplitGains

透過在節點分割資料所獲得的收益。 其第 i 個值是從第 i 個節點的分裂點計算出來的。

方法

名稱 Description
GetCategoricalCategoricalSplitFeatureRangeAt(Int32)

回傳節點在nodeIndex所使用的類別閾值範圍。 節點的類別分割由 nodeIndex 索引,可以同時考慮多個連續輸入特徵;其範圍由 GetCategoricalCategoricalSplitFeatureRangeAt(Int32)表示。 回傳的值總是為 2 元素陣列;其第一元素是起始索引,第二元素是特徵段的內丁索引。 回傳的值僅在 [nodeIndex] 為真時 CategoricalSplitFlags才有效。

GetCategoricalSplitFeaturesAt(Int32)

回傳節點所使用的類別閾值,nodeIndex 索引。 如果所考慮的輸入特徵與 所 GetCategoricalSplitFeaturesAt(Int32)回傳的任何值不匹配,我們稱之為小於閾值事件,因此 LeftChild[nodeIndex] 是該輸入接下來應該前往的子節點。 回傳的值僅在 [nodeIndex] 為真時 CategoricalSplitFlags才有效。

適用於