I am new to machine learning in python, therefore forgive my naive question. Is there a library in python for implementing neural networks, such that it gives me the ROC and AUC curves also. I know about libraries in python which implement neural networks but I am searching for a library which also helps me in plotting ROC, DET and AUC curves.
Share
In this case it makes sense to divide your question in 2 topics, since neural networks are hardly directly related to ROC curves.
Neural Networks
I think there’s nothing better to learn by example, so I’ll show you an approach to your problem using a binary classification problem trained by a Feed-Forward neural network, and inspired by this tutorial from pybrain.
First thing is to define a dataset. The easiest way to visualize is to use a binary dataset on a 2D plane, with points generated from normal distributions, each of them belonging to one of the 2 classes. This will be linearly separable in this case.
To visualize, it looks something like this:

Now you want to split it into training and test set:
And to create your network:
Now you need to train your network and see what results you get in the end:
Which gives you a very bad boundary at the beginning:

But in the end a pretty good result:
ROC curves
As for ROC curves, here is a nice and simple Python library to do it on a random toy problem:
Which gives you a single ROC curve:

Of course you can also plot multiple ROC curves on the same graph:
(remember that the diagonal just means that your classifier is random and that you’re probably doing something wrong)
You can probably easily use your modules in any of your classification tasks (not limited to neural networks) and it will produce ROC curves for you.
Now to get the class/probability needed to plot your ROC curve from your neural network, you just need to look at the activation of your neural network:
activateOnDatasetin pybrain will give you the probability for both classes (in my example above we just take the max of probabilities to determine which class to consider). From there, just transform it to the format expected by PyROC like forrandom_mixture_modeland it should give you your ROC curve.