Turicreate: Draw ROC curve

Created on 27 Feb 2018  路  7Comments  路  Source: apple/turicreate

How can I draw an ROC curve based on the output from results = model.evaluate(test_data)
It would be nice to have a function to draw ROC curves.

enhancement p3 visualization

Most helpful comment

Hi @johnyquest7 , thanks for your question

Theoretically, TC's visualization tool should allow you to plot the ROC by using the tc.show() function:

turicreate.show(ev['roc_curve']['fpr'], ev['roc_curve']['tpr'])

However, as mentioned in https://github.com/apple/turicreate/issues/142, it's not yet possible to request a specific plot type (a scatter plot in this case) - so sadly the plot won't show correctly for the moment.

The quickest workaround is to use matplotlib:

import matplotlib.pyplot as plt
plt.scatter(ev['roc_curve']['fpr'], ev['roc_curve']['tpr'])

If you're using Jupyter notebooks, you can add %matplotlib inline after importing matplotlib, this will make the drawing appear within the notebook.

All 7 comments

Hi @johnyquest7 , thanks for your question

Theoretically, TC's visualization tool should allow you to plot the ROC by using the tc.show() function:

turicreate.show(ev['roc_curve']['fpr'], ev['roc_curve']['tpr'])

However, as mentioned in https://github.com/apple/turicreate/issues/142, it's not yet possible to request a specific plot type (a scatter plot in this case) - so sadly the plot won't show correctly for the moment.

The quickest workaround is to use matplotlib:

import matplotlib.pyplot as plt
plt.scatter(ev['roc_curve']['fpr'], ev['roc_curve']['tpr'])

If you're using Jupyter notebooks, you can add %matplotlib inline after importing matplotlib, this will make the drawing appear within the notebook.

Tagging as an enhancement. We should consider adding out-of-the-box capability to plot ROC curves.

Hi,
how can I draw multiple-class with different colour based on ROC Curve? I'm using matplotlib here
```plt.figure()
plt.plot(results['roc_curve']['fpr'],
results['roc_curve']['tpr'],
color ='cornflowerblue',
label='ROC Curve class (area = %0.2f)' %results['auc'])
plt.plot([0, 1], [0, 1], color='navy', linestyle='--')
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.legend(loc="lower right")
plt.title('ROC curve')
plt.show()

This Function should be an adding out-of-the-box capability,I begin use the TuriCreate As a GraphLab User锛孖 want to find a Equivalent Function such as

model.show(view='Evaluation') # this is the old
turicreate.visualization.roc(model=model) # I think the new function

Is there an equivalent for model.show(view='Evaluation') to plot roc curves?

Is there an equivalent for model.show(view='Evaluation') to plot roc curves?

Sound like you want turicreate.evaluation.roc_curve.

Is there an equivalent for model.show(view='Evaluation') to plot roc curves?

Sound like you want turicreate.evaluation.roc_curve.

Do you have any idea on how to visualize it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fbomb111 picture fbomb111  路  3Comments

srikris picture srikris  路  4Comments

bobdillon48 picture bobdillon48  路  4Comments

tagy picture tagy  路  5Comments

alelordelo picture alelordelo  路  5Comments