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