Python Forum
Array NaN values? ValueError: continuous format is not supported
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array NaN values? ValueError: continuous format is not supported
#4
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. ]


Error:
ValueError Traceback (most recent call last) <ipython-input-2-82b3904c67a1> in <module>() 85 #print('auc on validation set {}'.format(auc_roc)) 86 return #roc_auc ---> 87 blight_model() 88 89 #The target variable is compliance = <ipython-input-2-82b3904c67a1> in blight_model() 80 81 #"roc_auc" is a classification or ranking metric, not a regression metric. So it doesn't accept continuous ---> 82 auc_roc = roc_auc_score(fpr, tpr) 83 84 /opt/conda/lib/python3.5/site-packages/sklearn/metrics/ranking.py in roc_auc_score(y_true, y_score, average, sample_weight) 258 return _average_binary_score( 259 _binary_roc_auc_score, y_true, y_score, average, --> 260 sample_weight=sample_weight) 261 262 /opt/conda/lib/python3.5/site-packages/sklearn/metrics/base.py in _average_binary_score(binary_metric, y_true, y_score, average, sample_weight) 79 y_type = type_of_target(y_true) 80 if y_type not in ("binary", "multilabel-indicator"): ---> 81 raise ValueError("{0} format is not supported".format(y_type)) 82 83 if y_type == "binary": ValueError: continuous format is not supported
Reply


Messages In This Thread
RE: Array NaN values? ValueError: continuous format is not supported - by metalray - Jan-05-2018, 08:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to multiply tuple values in array? EngiPorem 3 3,032 Aug-27-2021, 03:26 AM
Last Post: naughtyCat
  ValueError: setting an array element with a sequence ying9309 2 7,694 Jul-15-2018, 07:04 AM
Last Post: ying9309
  reshaping numpy array ValueError: total size of new array must be unchanged metalray 0 5,923 Jul-15-2017, 05:41 PM
Last Post: metalray
  ValueError: shape mismatch: value array of shape... ulrich48155 2 23,742 Jul-10-2017, 02:17 PM
Last Post: ulrich48155

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020