Structure

MLBoostedTreeRegressor

A regressor based on a collection of decision trees combined with gradient boosting.

Declaration

struct MLBoostedTreeRegressor

Topics

Creating and Training a Model

init(trainingData: MLDataTable, targetColumn: String, featureColumns: [String]?, parameters: MLBoostedTreeRegressor.ModelParameters)

Creates a Boosted Tree Regressor from the feature columns in the training data to predict the values in the target column.

struct MLBoostedTreeRegressor.ModelParameters

Parameters that affect the process of training a model.

Evaluating a Model

var trainingMetrics: MLRegressorMetrics

Measurements of the regressor’s performance on the training data set.

var validationMetrics: MLRegressorMetrics

Measurements of the regressor’s performance on the validation data set.

func evaluation(on: MLDataTable) -> MLRegressorMetrics

Returns metrics describing the regressor’s performance on the provided labeled data.

Testing a Model with Unlabeled Data

var featureColumns: [String]

The column names used by the regressor when accepting input data for evaluation or prediction.

var targetColumn: String

The name of the column you want the regressor to make predictions for.

func predictions(from: MLDataTable) -> MLUntypedColumn

Predicts the target value from the provided data.

Saving a Model

func write(to: URL, metadata: MLModelMetadata?)

Exports a Core ML model file for use in your app.

func write(toFile: String, metadata: MLModelMetadata?)

Exports a Core ML model file for use in your app.

Inspecting a Model

var model: MLModel

The underlying Core ML model stored in memory.

let modelParameters: MLBoostedTreeRegressor.ModelParameters

The underlying parameters used when training the model.

Describing a Model

var description: String

A text representation of the boosted tree regressor.

var debugDescription: String

A text representation of the boosted tree regressor that’s suitable for output during debugging.

var playgroundDescription: Any

A description of the boosted tree regressor shown in a playground.

See Also

Supporting Regressor Types

struct MLLinearRegressor

A regressor that estimates the target as a linear function of the features.

struct MLDecisionTreeRegressor

A regressor that estimates the target by learning rules to split the data.

struct MLRandomForestRegressor

A regressor based on a collection of decision trees trained on subsets of the data.