Cross-validated FPR/TPR are not provided by default.

You need to provide your own function to gridSearchCV if you want to know their 
values .

From: shalu jhanwar [mailto:shalu.jhanwa...@gmail.com]
Sent: Friday, October 24, 2014 11:36 AM
To: Pagliari, Roberto
Subject: Fwd: [Scikit-learn-general] Regarding TPR and FPR

Hey Roberto,

Could you please suggest something for my below query?

thanks!
S.
---------- Forwarded message ----------
From: shalu jhanwar 
<shalu.jhanwa...@gmail.com<mailto:shalu.jhanwa...@gmail.com>>
Date: Fri, Oct 24, 2014 at 4:33 PM
Subject: Re: [Scikit-learn-general] Regarding TPR and FPR
To: 
scikit-learn-general@lists.sourceforge.net<mailto:scikit-learn-general@lists.sourceforge.net>

Hi,

thanks for the reply. I want to make a ROC (as attachment) to compare 
classifiers on my dataset. That's why I need mean TPR and FPR of all the cross 
validations.

Any suggestion??

Shalu

On Fri, Oct 24, 2014 at 4:09 PM, Pagliari, Roberto 
<rpagli...@appcomsci.com<mailto:rpagli...@appcomsci.com>> wrote:
It depends on what you are doing. If all you need to do is to compute TPR and 
FPR, and you don’t need ROC, you can use the confusion_matrix module.

Assuming you have two classes,

from sklearn.metrics import confusion_matrix
# some code
cm = confusion_matrix(y_test, y_pred)
TPR = cm[1][1] / (cm[0][1]+cm[1][1]); FPR=cm[0][1]/(cm[0][0]+cm[0][1])


From: shalu jhanwar 
[mailto:shalu.jhanwa...@gmail.com<mailto:shalu.jhanwa...@gmail.com>]
Sent: Friday, October 24, 2014 3:07 AM
To: 
scikit-learn-general@lists.sourceforge.net<mailto:scikit-learn-general@lists.sourceforge.net>
Subject: [Scikit-learn-general] Regarding TPR and FPR

Hi scikit users,

Can anyone let me know that how can i get mean TPR and mean FPR to plot ROC 
using scikit?

I'm referring to http://scikit-learn.org/stable/auto_examples/plot_roc.html 
link.

Any idea would be appreciated?

Thanks in advance.

Shalu

------------------------------------------------------------------------------

_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net<mailto:Scikit-learn-general@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general


------------------------------------------------------------------------------
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to