5 writes to NumLeaves
Microsoft.ML.FastTree (5)
TreeEnsemble\InternalRegressionTree.cs (5)
95
NumLeaves
= 1;
101
NumLeaves
= buffer.ToInt(ref position);
199
NumLeaves
= Utils.Size(splitFeatures) + 1;
271
NumLeaves
= reader.ReadInt32();
1070
++
NumLeaves
;
59 references to NumLeaves
Microsoft.ML.FastTree (59)
FastTree.cs (2)
3085
for (int leafIndex = 0; leafIndex < tree.
NumLeaves
; leafIndex++)
3292
public int NumLeaves => _regTree.
NumLeaves
;
FastTreeClassification.cs (1)
406
for (int l = 0; l < tree.
NumLeaves
; ++l)
FastTreeRanking.cs (1)
935
for (int l = 0; l < tree.
NumLeaves
; ++l)
FastTreeRegression.cs (1)
450
for (int l = 0; l < tree.
NumLeaves
; ++l)
FastTreeTweedie.cs (1)
408
for (int l = 0; l < tree.
NumLeaves
; ++l)
RegressionTree.cs (2)
142
public int NumberOfLeaves => _tree.
NumLeaves
;
168
_leafValues = ImmutableArray.Create(_tree.LeafValues, 0, _tree.
NumLeaves
);
Training\DocumentPartitioning.cs (9)
55
: this(dataset.NumDocs, tree.
NumLeaves
)
84
List<int>[] perLeafDocumentLists = Enumerable.Range(0, tree.
NumLeaves
)
85
.Select(x => new List<int>(innerLoopSize / tree.
NumLeaves
))
100
_leafCount = Enumerable.Range(0, tree.
NumLeaves
)
106
var cumulativeLength = _leafCount.CumulativeSum<int>().Take(tree.
NumLeaves
- 1);
110
Contracts.Assert(_documents.Length == _leafBegin[tree.
NumLeaves
- 1] + _leafCount[tree.
NumLeaves
- 1]);
111
actions = new Action[tree.
NumLeaves
];
113
for (int leaf = 0; leaf < tree.
NumLeaves
; leaf++)
Training\Parallel\SingleTrainer.cs (2)
51
double[] means = new double[tree.
NumLeaves
];
52
for (int l = 0; l < tree.
NumLeaves
; ++l)
Training\ScoreTracker.cs (3)
105
Parallel.For(0, tree.
NumLeaves
, new ParallelOptions { MaxDegreeOfParallelism = BlockingThreadPool.NumThreads }, (leaf) =>
202
var actions = new Action[tree.
NumLeaves
];
203
Parallel.For(0, tree.
NumLeaves
, new ParallelOptions { MaxDegreeOfParallelism = BlockingThreadPool.NumThreads },
Training\TreeLearners\FastForestLeastSquaresTreeLearner.cs (1)
39
targets, weights, _quantileSampleCount, Rand, tree.
NumLeaves
, out distributionWeights), distributionWeights);
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (1)
265
bestLeaf = BestSplitInfoPerLeaf.Select(info => info.Gain).ArgMax(tree.
NumLeaves
);
TreeEnsemble\InternalQuantileRegressionTree.cs (6)
81
Contracts.Check(sampleCount == _labelsDistribution.Length /
NumLeaves
, "Bad quantile sample count");
82
Contracts.Check(_instanceWeights == null || sampleCount == _instanceWeights.Length /
NumLeaves
, "Bad quantile weight count");
113
leafSamples = new double[
NumLeaves
][];
114
leafSampleWeights = new double[
NumLeaves
][];
116
var sampleCountPerLeaf = _labelsDistribution != null ? _labelsDistribution.Length /
NumLeaves
: 1;
117
for (int i = 0; i <
NumLeaves
; ++i)
TreeEnsemble\InternalRegressionTree.cs (27)
204
Thresholds = new uint[
NumLeaves
- 1];
368
writer.Write(
NumLeaves
);
440
checker(
NumLeaves
> 1, "non-positive number of leaves");
442
checker(numMaxLeaves >=
NumLeaves
, "inconsistent number of leaves with maximum leaf capacity");
497
checker(Utils.Size(RawThresholds) == 0 || RawThresholds.Length ==
NumLeaves
- 1, "bad rawthreshold length");
508
return
NumLeaves
.SizeInBytes() +
528
NumLeaves
.ToByteArray(buffer, ref position);
606
/// <see cref="NumNodes"/> and <see cref="
NumLeaves
"/> should be 2 and 3, respectively.
608
public int NumNodes =>
NumLeaves
- 1;
660
/// <param name="leaf">A 0-based index to specify a leaf node. This value should be smaller than <see cref="
NumLeaves
"/>.</param>
744
if (
NumLeaves
== 1)
763
if (
NumLeaves
== 1)
844
if (
NumLeaves
== 1)
925
if (
NumLeaves
== 1)
983
if (
NumLeaves
== 1)
984
return Enumerable.Range(0,
NumLeaves
);
1023
int indexOfNewNonLeaf =
NumLeaves
- 1;
1060
GtChild[indexOfNewNonLeaf] = ~
NumLeaves
;
1061
LeafValues[
NumLeaves
] = gtValue;
1088
int numNodes =
NumLeaves
- 1;
1107
int numNodes =
NumLeaves
- 1;
1132
int numNodes =
NumLeaves
- 1;
1180
int numNonLeaves =
NumLeaves
- 1;
1313
int numNonLeaves =
NumLeaves
- 1;
1329
for (int n = 0; n <
NumLeaves
; ++n)
1347
Contracts.Assert(-
NumLeaves
<= node && node < NumNodes);
1360
int numNonLeaves =
NumLeaves
- 1;
TreeEnsemble\TreeEnsembleCombiner.cs (2)
74
for (int i = 0; i < tNew.
NumLeaves
; i++)
96
for (int i = 0; i < t.
NumLeaves
; i++)