turicreate.sound_classifier.SoundClassifier.predict

SoundClassifier.predict(dataset, output_type='class', verbose=True, batch_size=64)

Return predictions for dataset. Predictions can be generated as class labels or probabilities.

Parameters:
dataset : SFrame | SArray | dict

The audio data to be classified. If dataset is an SFrame, it must have a column with the same name as the feature used for model training, but does not require a target column. Additional columns are ignored.

output_type : {‘probability’, ‘class’, ‘probability_vector’}, optional

Form of the predictions which are one of:

  • ‘class’: Class prediction. For multi-class classification, this returns the class with maximum probability.
  • ‘probability’: Prediction probability associated with the True class (not applicable for multi-class classification)
  • ‘probability_vector’: Prediction probability associated with each class as a vector. Label ordering is dictated by the classes member variable.
verbose : bool, optional

If True, prints progress updates and model details.

batch_size : int, optional

If you are getting memory errors, try decreasing this value. If you have a powerful computer, increasing this value may improve performance.

Returns:
out : SArray

An SArray with the predictions.

See also

evaluate, classify

Examples

>>> probability_predictions = model.predict(data, output_type='probability')
>>> prediction_vector = model.predict(data, output_type='probability_vector')
>>> class_predictions = model.predict(data, output_type='class')