dotnet / dotnet/machinelearning

FastTreeRegressionTrainer leaves memory allocation happens before actually yes knowing how many leaves are actually yes needed by the model

Open
#7,435 0 comments 0 reactions 0 assignees View on GitHub
area-Trees untriaged
Dominant language
C#
Stars
9.4k
Forks
2k
Avg merge
2d 20h
Merged PRs (30d)
11

Description

my purpose is to allow the model to create as many leaves as it wants. is there a way to achieve that without allocating 8gb of memory for each tree trainer?
```
var options = new FastTreeRegressionTrainer.Options
{
NumberOfLeaves=int.MaxValue
}
```
```
System.OutOfMemoryException: Array dimensions exceeded supported range.
at Microsoft.ML.Trainers.FastTree.DocumentPartitioning..ctor(Int32 numDocuments, Int32 maxLeaves)
at Microsoft.ML.Trainers.FastTree.TreeLearner..ctor(Dataset trainData, Int32 numLeaves)
at Microsoft.ML.Trainers.FastTree.LeastSquaresRegressionTreeLearner..ctor(Dataset trainData, Int32 numLeaves, Int32 minDocsInLeaf, Double entropyCoefficient, Double featureFirstUsePenalty, Double featureReusePenalty, Double softmaxTemperature, Int32 histogramPoolSize, Int32 randomSeed, Double splitFraction, Boolean filterZeros, Boolean allowEmptyTrees, Double gainConfidenceLevel, Int32 maxCategoricalGroupsPerNode, Int32 maxCategoricalSplitPointPerNode, Double bsrMaxTreeOutput, IParallelTraining parallelTraining, Double minDocsPercentageForCategoricalSplit, Bundle bundling, Int32 minDocsForCategoricalSplit, Double bias, IHost host)
at Microsoft.ML.Trainers.FastTree.BoostingFastTreeTrainerBase`3.ConstructTreeLearner(IChannel ch)
at Microsoft.ML.Trainers.FastTree.BoostingFastTreeTrainerBase`3.ConstructOptimizationAlgorithm(IChannel ch)
at Microsoft.ML.Trainers.FastTree.FastTreeRegressionTrainer.ConstructOptimizationAlgorithm(IChannel ch)
at Microsoft.ML.Trainers.FastTree.FastTreeTrainerBase`3.Initialize(IChannel ch)
at Microsoft.ML.Trainers.FastTree.FastTreeTrainerBase`3.TrainCore(IChannel ch)
at Microsoft.ML.Trainers.FastTree.FastTreeRegressionTrainer.TrainModelCore(TrainContext context)
at Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
at Microsoft.ML.Trainers.TrainerEstimatorBase`2.Fit(IDataView input)
at Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
at Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.