how to get confusion matrix in form of matrix and roc curve as graph

User 3238 | 2/22/2016, 8:23:44 AM

I am getting confusion matrix in the tabular form instead of matrix is there is a way to show this in form of matrix & if there is not a way do this then how can i print all the rows. print_rows() function is not working as the type of object is 'dict'. i also tried to convert this object to sframe and print it but again not getting expected result.

Also how to get graph of roc curve.


User 19 | 2/22/2016, 6:01:43 PM

Hi Bhanu,

The evaluate method returned a dictionary (i.e. 'dict') where the values are SFrames. To get the confusion matrix and print all rows, you can do

result = kdd_model.evaluate(test_data, metric='confusion_matrix') conf_mat = result['confusion_matrix'] conf_mat.print_rows(200)

Similarly, your second command gave you all the data needed to plot an ROC curve.

result = kdd_model.evaluate(test_data, metric='roc_curve') roc_curve = result['roc_curve']

Now you just need to use your plotting tool of choice to plot the ROC curve, or if you've run the above code you may then call

Let me know if that helps! Chris

User 3238 | 2/24/2016, 1:48:13 PM

Thanks ChrisDuBois,

I get the result i was expecting