FastTreeRegressionTrainer Class


The IEstimator<TTransformer> for training a decision tree regression model using FastTree.

public sealed class FastTreeRegressionTrainer : Microsoft.ML.Trainers.FastTree.BoostingFastTreeTrainerBase<Microsoft.ML.Trainers.FastTree.FastTreeRegressionTrainer.Options,Microsoft.ML.Data.RegressionPredictionTransformer<Microsoft.ML.Trainers.FastTree.FastTreeRegressionModelParameters>,Microsoft.ML.Trainers.FastTree.FastTreeRegressionModelParameters>
type FastTreeRegressionTrainer = class
    inherit BoostingFastTreeTrainerBase<FastTreeRegressionTrainer.Options, RegressionPredictionTransformer<FastTreeRegressionModelParameters>, FastTreeRegressionModelParameters>
Public NotInheritable Class FastTreeRegressionTrainer
Inherits BoostingFastTreeTrainerBase(Of FastTreeRegressionTrainer.Options, RegressionPredictionTransformer(Of FastTreeRegressionModelParameters), FastTreeRegressionModelParameters)


To create this trainer, use FastTree or FastTree(Options).

Input and Output Columns

The input label column data must be Single. The input features column data must be a known-sized vector of Single.

This trainer outputs the following columns:

Output Column Name Column Type Description
Score Single The unbounded score that was predicted by the model.

Trainer Characteristics

Machine learning task Regression
Is normalization required? No
Is caching required? No
Required NuGet in addition to Microsoft.ML Microsoft.ML.FastTree
Exportable to ONNX Yes

Training Algorithm Details

FastTree is an efficient implementation of the MART gradient boosting algorithm. Gradient boosting is a machine learning technique for regression problems. It builds each regression tree in a step-wise fashion, using a predefined loss function to measure the error for each step and corrects for it in the next. So this prediction model is actually an ensemble of weaker prediction models. In regression problems, boosting builds a series of such trees in a step-wise fashion and then selects the optimal tree using an arbitrary differentiable loss function.

MART learns an ensemble of regression trees, which is a decision tree with scalar values in its leaves. A decision (or regression) tree is a binary tree-like flow chart, where at each interior node one decides which of the two child nodes to continue to based on one of the feature values from the input. At each leaf node, a value is returned. In the interior nodes, the decision is based on the test x <= v where x is the value of the feature in the input sample and v is one of the possible values of this feature. The functions that can be produced by a regression tree are all the piece-wise constant functions.

The ensemble of trees is produced by computing, in each step, a regression tree that approximates the gradient of the loss function, and adding it to the previous tree with coefficients that minimize the loss of the new tree. The output of the ensemble produced by MART on a given instance is the sum of the tree outputs.

  • In case of a binary classification problem, the output is converted to a probability by using some form of calibration.
  • In case of a regression problem, the output is the predicted value of the function.
  • In case of a ranking problem, the instances are ordered by the output value of the ensemble.

For more information see:

Check the See Also section for links to examples of the usage.



The feature column that the trainer expects.

(Inherited from TrainerEstimatorBase<TTransformer,TModel>)

The optional groupID column that the ranking trainers expects.

(Inherited from TrainerEstimatorBaseWithGroupId<TTransformer,TModel>)

The label column that the trainer expects. Can be null, which indicates that label is not used for training.

(Inherited from TrainerEstimatorBase<TTransformer,TModel>)

The weight column that the trainer expects. Can be null, which indicates that weight is not used for training.

(Inherited from TrainerEstimatorBase<TTransformer,TModel>)


Info (Inherited from FastTreeTrainerBase<TOptions,TTransformer,TModel>)



Trains and returns a ITransformer.

(Inherited from TrainerEstimatorBase<TTransformer,TModel>)
Fit(IDataView, IDataView)

Trains a FastTreeRegressionTrainer using both training and validation data, returns a RegressionPredictionTransformer<TModel>.

GetOutputSchema(SchemaShape) (Inherited from TrainerEstimatorBase<TTransformer,TModel>)

Extension Methods

AppendCacheCheckpoint<TTrans>(IEstimator<TTrans>, IHostEnvironment)

Append a 'caching checkpoint' to the estimator chain. This will ensure that the downstream estimators will be trained against cached data. It is helpful to have a caching checkpoint before trainers that take multiple data passes.

WithOnFitDelegate<TTransformer>(IEstimator<TTransformer>, Action<TTransformer>)

Given an estimator, return a wrapping object that will call a delegate once Fit(IDataView) is called. It is often important for an estimator to return information about what was fit, which is why the Fit(IDataView) method returns a specifically typed object, rather than just a general ITransformer. However, at the same time, IEstimator<TTransformer> are often formed into pipelines with many objects, so we may need to build a chain of estimators via EstimatorChain<TLastTransformer> where the estimator for which we want to get the transformer is buried somewhere in this chain. For that scenario, we can through this method attach a delegate that will be called once fit is called.

Applies to

See also