turicreate.svm_classifier.SVMClassifier.classify

SVMClassifier.classify(dataset, missing_value_action='auto')

Return a classification, for each example in the dataset, using the trained SVM model. The output SFrame contains predictions as class labels (0 or 1) associated with the the example.

Parameters:
dataset : SFrame

Dataset of new observations. Must include columns with the same names as the features used for model training, but does not require a target column. Additional columns are ignored.

missing_value_action : str, optional

Action to perform when missing values are encountered. This can be one of:

  • ‘auto’: Default to ‘impute’
  • ‘impute’: Proceed with evaluation by filling in the missing values with the mean of the training data. Missing values are also imputed if an entire column of data is missing during evaluation.
  • ‘error’ : Do not proceed with prediction and terminate with an error message.
Returns:
out : SFrame

An SFrame with model predictions i.e class labels.

See also

create, evaluate, predict

Examples

>>> data =  turicreate.SFrame('https://static.turi.com/datasets/regression/houses.csv')
>>> data['is_expensive'] = data['price'] > 30000
>>> model = turicreate.svm_classifier.create(data, target='is_expensive',
                              features=['bath', 'bedroom', 'size'])
>>> classes = model.classify(data)