Table Of Contents

NaiveBayesModel test


test(self, frame, label_column, observation_columns=None)

[ALPHA] Predict test frame labels and return metrics.

Parameters:

frame : Frame

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

label_column : unicode

Column containing the actual label for each observation.

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:

: dict

A dictionary with binary classification metrics. The data returned is composed of the following keys:

‘accuracy’ : double
The proportion of predictions that are correctly identified
‘confusion_matrix’ : dictionary
A table used to describe the performance of a classification model
‘f_measure’ : double
The harmonic mean of precision and recall
‘precision’ : double
The proportion of predicted positive instances that are correctly identified
‘recall’ : double
The proportion of positive instances that are correctly identified.

Predict the labels for a test frame and run classification metrics on predicted and target labels.

Examples

See here for examples.