how do i get a optimal cutoff value(directly in the form of numeric) from roc curves?

+1 vote

Oct 17, 2019 in Python by Ram
• 130 points
378 views

1 answer to this question.

+1 vote

The optimal CutOff value is the point where there is high true positive rate and low false positive rate. According to this logic, you can use the below code to get the value:

optimal_idx = np.argmax(tpr - fpr)
optimal_threshold = thresholds[optimal_idx]
answered Oct 17, 2019 by Saira

Related Questions In Python

0 votes
1 answer

In NumPy how do I get the maximum of subsets? Python

You can use np.maximum.reduceat: >>> _, idx = np.unique(g, ...READ MORE

answered Nov 9, 2018 in Python by Nymeria
• 3,540 points
192 views
0 votes
1 answer

How can I get the count of a list in Python?

len() >>> mylist=[] >>> print len(mylist) 0 READ MORE

answered Dec 12, 2018 in Python by charlie_brown
• 7,760 points
187 views
+1 vote
1 answer
0 votes
1 answer

how do I check the length of an array in a python program?

lets say we have a list mylist = ...READ MORE

answered Mar 12, 2019 in Python by Mohammad
• 3,230 points
159 views
0 votes
0 answers

how do i get the list of all the keys in my dictionary?

can you give an example? with the ...READ MORE

May 6, 2019 in Python by Waseem
• 4,530 points
33 views
0 votes
1 answer

How do I trim the leading or trailing zeros from a 1d array in python?

Hey @Akki, you can use the numpy ...READ MORE

answered May 29, 2019 in Python by Wakir
394 views
+1 vote
1 answer
0 votes
1 answer

How do I create a dataframe using a dictionary in pandas?

Hi @Hannah, You need to define your dictionary ...READ MORE

answered Nov 18, 2019 in Python by Eric
80 views