22 references to NumberOfLeaves
Microsoft.ML.FastTree (19)
RegressionTree.cs (6)
140/// Number of leaves in the tree. Note that <see cref="NumberOfLeaves"/> does not take non-leaf nodes into account. 146/// node0->leaf3, node1->leaf1, node1->leaf2, <see cref="NumberOfNodes"/> and <see cref="NumberOfLeaves"/> should 213if (leafIndex < 0 || leafIndex >= NumberOfLeaves) 214throw Contracts.Except($"The input leaf index, {leafIndex}, is invalid. Its valid range is from 0 (inclusive) to {NumberOfLeaves} (exclusive)."); 229if (leafIndex < 0 || leafIndex >= NumberOfLeaves) 230throw Contracts.Except($"The input leaf index, {leafIndex}, is invalid. Its valid range is from 0 (inclusive) to {NumberOfLeaves} (exclusive).");
Utils\RegressionTreeBaseUtils.cs (13)
26var numberOfRows = trees.Select(tree => tree.NumberOfNodes).Sum() + trees.Select(tree => tree.NumberOfLeaves).Sum(); 44treeWeightsList.AddRange(Enumerable.Repeat(treeWeights[i], trees[i].NumberOfNodes + trees[i].NumberOfLeaves)); 47treeId.AddRange(Enumerable.Repeat(i, trees[i].NumberOfNodes + trees[i].NumberOfLeaves)); 51isLeaf.AddRange(Enumerable.Repeat(new ReadOnlyMemory<char>("Leaf node".ToCharArray()), trees[i].NumberOfLeaves)); 55leftChild.AddRange(Enumerable.Repeat(0, trees[i].NumberOfLeaves)); 59rightChild.AddRange(Enumerable.Repeat(0, trees[i].NumberOfLeaves)); 63numericalSplitFeatureIndexes.AddRange(Enumerable.Repeat(0, trees[i].NumberOfLeaves)); 67numericalSplitThresholds.AddRange(Enumerable.Repeat(0f, trees[i].NumberOfLeaves)); 71categoricalSplitFlags.AddRange(Enumerable.Repeat(false, trees[i].NumberOfLeaves)); 79splitGains.AddRange(Enumerable.Repeat(0d, trees[i].NumberOfLeaves)); 94categoricalSplitFeatures.AddRange(Enumerable.Repeat(new VBuffer<int>(), trees[i].NumberOfLeaves)); 95categoricalCategoricalSplitFeatureRange.AddRange(Enumerable.Repeat(new VBuffer<int>(), trees[i].NumberOfLeaves)); 126for (int j = 0; j < quantileTrees[i].NumberOfLeaves; j++)
Microsoft.ML.IntegrationTests (2)
IntrospectiveTraining.cs (2)
57Assert.Equal(5, tree.NumberOfLeaves); 101Assert.Equal(5, tree.NumberOfLeaves);
Microsoft.ML.Tests (1)
TrainerEstimators\TreeEstimators.cs (1)
890for (int j = 0; j < trees[i].NumberOfLeaves; j++)