reset password
Author Message
itzzspencer
Posts: 5
Posted 05:40 Nov 16, 2019 |

I've followed the steps from Lab 5 to implement a ROC curve, but I'm getting an NaN error for the area under curve part. It says "No positive samples in y_true, true positive value should be meaningless". Just to make sure, I've also tried using the non shortened database, but I still get the same results. I'm not sure what i'm doing wrong

 

SonicDrone
Posts: 3
Posted 14:53 Nov 16, 2019 |

Converting the AHD column to binary solved this for me

itzzspencer
Posts: 5
Posted 17:06 Nov 16, 2019 |

Got it thanks 

mpourhoma
Posts: 39
Posted 21:17 Nov 16, 2019 |

In your function "metrics.roc_curve", the pos_label = 1 by default. However, in this new dataset, the positive label is "Yes" not 1!

So, you can simply change it to pos_label = "Yes",  Or convert the label to binary in the dataset.

 

itzzspencer
Posts: 5
Posted 04:48 Nov 17, 2019 |

Interesting! Thank you!