A regressor that estimates the target as a linear function of the features.
SDKs
- macOS 10.14+
- Xcode 10.0+
Framework
- Create ML
Declaration
struct MLLinearRegressor
A regressor that estimates the target as a linear function of the features.
SDKs
Framework
struct MLLinearRegressor
init(training Data: MLData Table, target Column: String, feature Columns: [String]?, parameters: MLLinear Regressor .Model Parameters)
Creates a Linear Regressor from the feature columns in the training data to predict the values in the target column.
struct MLLinear Regressor .Model Parameters
Parameters that affect the process of training a model.
let model Parameters: MLLinear Regressor .Model Parameters
The underlying parameters used when training the model.
var target Column: String
The name of the column you selected at initialization to define which feature the regressor predicts.
var feature Columns: [String]
The names of the columns you selected at initialization to train the regressor.
var training Metrics: MLRegressor Metrics
Measurements of the regressor’s performance on the training data set.
var validation Metrics: MLRegressor Metrics
Measurements of the regressor’s performance on the validation data set.
func evaluation(on: MLData Table) -> MLRegressor Metrics
Returns metrics describing the regressor’s performance on the provided labeled data.
func predictions(from: MLData Table) -> MLUntyped Column
Predicts the target value from the provided data.
func write(to: URL, metadata: MLModel Metadata?)
Exports a Core ML model file for use in your app.
func write(to File: String, metadata: MLModel Metadata?)
Exports a Core ML model file for use in your app.
var model: MLModel
The underlying Core ML model stored in memory.
var description: String
A text representation of the linear regressor.
var debug Description: String
A text representation of the linear regressor that’s suitable for output during debugging.
var playground Description: Any
A description of the linear regressor shown in a playground.
struct MLDecision Tree Regressor
A regressor that estimates the target by learning rules to split the data.
struct MLRandom Forest Regressor
A regressor based on a collection of decision trees trained on subsets of the data.
struct MLBoosted Tree Regressor
A regressor based on a collection of decision trees combined with gradient boosting.