FastTreeRegressionTrainer Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
- Inheritance
Remarks
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:
- Wikipedia: Gradient boosting (Gradient tree boosting).
- Greedy function approximation: A gradient boosting machine.
Check the See Also section for links to examples of the usage.
Fields
FeatureColumn |
The feature column that the trainer expects. (Inherited from TrainerEstimatorBase<TTransformer,TModel>) |
GroupIdColumn |
The optional groupID column that the ranking trainers expects. (Inherited from TrainerEstimatorBaseWithGroupId<TTransformer,TModel>) |
LabelColumn |
The label column that the trainer expects. Can be |
WeightColumn |
The weight column that the trainer expects. Can be |
Properties
Info | (Inherited from FastTreeTrainerBase<TOptions,TTransformer,TModel>) |
Methods
Fit(IDataView, IDataView) |
Trains a FastTreeRegressionTrainer using both training and validation data, returns a RegressionPredictionTransformer<TModel>. |
Fit(IDataView) |
Trains and returns a ITransformer. (Inherited from TrainerEstimatorBase<TTransformer,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. |