示例#1
0
 public void FindGlobalBestSplit(LeafSplitCandidates smallerChildSplitCandidates,
                                 LeafSplitCandidates largerChildSplitCandidates,
                                 FindBestThresholdFromRawArrayFun findFunction,
                                 SplitInfo[] bestSplits)
 {
     return;
 }
 public void FindGlobalBestSplit(LeafSplitCandidates smallerChildSplitCandidates,
                                 LeafSplitCandidates largerChildSplitCandidates,
                                 Microsoft.ML.Runtime.FastTree.FindBestThresholdFromRawArrayFun findFunction,
                                 SplitInfo[] bestSplits)
 {
     Assert.True(_isInitEnv);
     Assert.True(_isInitTreeLearner);
     Assert.True(_isInitIteration);
     Assert.True(_isCache);
     _isCache = false;
     Assert.NotNull(smallerChildSplitCandidates);
     Assert.NotNull(bestSplits);
     return;
 }
        protected override void FindAndSetBestFeatureForLeaf(LeafSplitCandidates leafSplitCandidates)
        {
            if (SoftmaxTemperature != 0 || SplitFraction == 1.0)
            {
                base.FindAndSetBestFeatureForLeaf(leafSplitCandidates);
                return;
            }

            // REVIEW: Stupid, but changing actually changes all
            // FastForeset baselines. Improve later.
            var    infos       = leafSplitCandidates.FeatureSplitInfo;
            int    bestFeature = 0;
            double max         = infos[0].Gain;

            for (int i = 1; i < infos.Length; ++i)
            {
                if (infos[i].Gain > max && Rand.NextDouble() < SplitFraction || Double.IsNegativeInfinity(max))
                {
                    max = infos[bestFeature = i].Gain;
                }
            }
            SetBestFeatureForLeaf(leafSplitCandidates, bestFeature);
        }
示例#4
0
 void IParallelTraining.FindGlobalBestSplit(LeafSplitCandidates smallerChildSplitCandidates,
                                            LeafSplitCandidates largerChildSplitCandidates,
                                            FindBestThresholdFromRawArrayFun findFunction,
                                            SplitInfo[] bestSplits)
 {
 }