Table Of Contents

NaiveBayesModel predict


predict(self, frame, observation_columns=None)

[ALPHA] Predict labels for data points using trained Naive Bayes model.

Parameters:

frame : <bound method AtkEntityType.__name__ of <trustedanalytics.rest.jsonschema.AtkEntityType object at 0x7f9e686f3fd0>>

A frame whose labels are to be predicted. By default, predict is run on the same columns over which the model is trained.

observation_columns : list (default=None)

Column(s) containing the observations whose labels are to be predicted. By default, we predict the labels over columns the NaiveBayesModel was trained on.

Returns:

: <bound method AtkEntityType.__name__ of <trustedanalytics.rest.jsonschema.AtkEntityType object at 0x7f9e686f3fd0>>

Frame containing the original frame’s columns and a column with the predicted label.

Predict the labels for a test frame using trained Naive Bayes model,
and create a new frame revision with existing columns and a new predicted label’s column.

Examples

>>> my_model = ta.NaiveBayesModel(name='naivebayesmodel')
>>> my_model.train(train_frame, 'name_of_label_column',['name_of_observation_column(s)'])
>>> output = my_model.predict(predict_frame, ['name_of_observation_column(s)'])
>>> output.inspect(5)