Structure

MLSupportVectorClassifier

A classifier that predicts a binary target value by maximizing the separation between categories.

Declaration

struct MLSupportVectorClassifier

Topics

Creating and Training a Support Vector Classifier

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

Creates a Support Vector Classifier from the feature columns in the training data to predict the categories in the target column.

struct MLSupportVectorClassifier.ModelParameters

Parameters that affect the process of training a model.

let modelParameters: MLSupportVectorClassifier.ModelParameters

The underlying parameters used when training the model.

var targetColumn: String

The name of the column you selected at initialization to define which categories the classifier predicts.

var featureColumns: [String]

The names of the columns you selected at initialization to train the classifier.

Assessing Model Accuracy

var trainingMetrics: MLClassifierMetrics

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

var validationMetrics: MLClassifierMetrics

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

Evaluating a Support Vector Classifier

func evaluation(on: MLDataTable) -> MLClassifierMetrics

Evaluates the classifier on the provided labeled data.

Testing a Support Vector Classifier

func predictions(from: MLDataTable) -> MLUntypedColumn

Classifies the provided data into the target categories.

Saving a Support Vector Classifier

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.

Describing a Support Vector Classifier

var model: MLModel

The underlying Core ML model stored in memory.

var description: String

A text representation of the support vector classifier.

var debugDescription: String

A text representation of the support vector classifier that’s suitable for output during debugging.

var playgroundDescription: Any

A description of the support vector classifier shown in a playground.

See Also

Supporting Classifier Types

struct MLDecisionTreeClassifier

A classifier that predicts the target by creating rules to split the data.

struct MLRandomForestClassifier

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

struct MLBoostedTreeClassifier

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

struct MLLogisticRegressionClassifier

A classifier that predicts a discrete target value as a function of data features.