turicreate.text_classifier.TextClassifier.classify¶
-
TextClassifier.classify(dataset)¶ Return a classification, for each example in the
dataset, using the trained model. The output SFrame contains predictions as both class labels as well as probabilities that the predicted value is the associated label.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.
Returns: - out : SFrame
An SFrame with model predictions i.e class labels and probabilities.
Examples
>>> import turicreate as tc >>> dataset = tc.SFrame({'rating': [1, 5], 'text': ['hate it', 'love it']}) >>> m = tc.text_classifier.create(dataset, 'rating', features=['text']) >>> output = m.classify(dataset)