Array NaN values? ValueError: continuous format is not supported - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Homework (https://python-forum.io/forum-9.html) +--- Thread: Array NaN values? ValueError: continuous format is not supported (/thread-7327.html) |
Array NaN values? ValueError: continuous format is not supported - metalray - Jan-04-2018 Hi, I do have this ValueError: continuous format is not supported problem again. auc_roc = roc_auc_score(fpr, tpr) #"roc_auc" is a classification or ranking metric, not a regression metric. So it doesn't accept continuous #However, I see no NaN values according to my test: for num in fpr: if num != num: print ('This array has a NaN element') #all good, no nan in fpr break for num in tpr: if num != num: print ('This array has a NaN element') #all good, no nan in tpr breakfpr and tpr have a few hundred rows so I dont think I can print them here. RE: Array NaN values? ValueError: continuous format is not supported - buran - Jan-04-2018 please, repost/edit your post in order to show correct indentation of your code. Indentation matter in python. Also, when post traceback, post the full traceback, in error tags, not just the last line. finally, num != num will NEVER evaluate True, so you if statements is useless
RE: Array NaN values? ValueError: continuous format is not supported - sparkz_alot - Jan-04-2018 (Jan-04-2018, 08:44 AM)metalray Wrote: pr and tpr have a few hundred rows so I dont think I can print them here. You don't need to post them all, just a few so the snippet can be tested. RE: Array NaN values? ValueError: continuous format is not supported - metalray - Jan-05-2018 OK, thanks for the hints. I have the feeling the continous format error is not because of NaN values. The array does look a bit odd with all the spaces in it. def new_model(): print(fpr) print(tpr) print(np.argwhere(np.isnan(fpr))) print(np.argwhere(np.isnan(tpr))) auc_roc = roc_auc_score(fpr, tpr) return new_model()fpr: [ 0. 0.98952194 1. ] tpr: [ 0. 0.98547329 1. ]
|