The following code is giving error: TypeError: 'numpy.int64' object is not iterable.
for k, v in y_true_pred:y_true.append[v[0]]y_pred.append[v[1]]y_pred_prob.append[v[2]]
for k, v in y_true_pred:
y_true.append[v[0]]
y_pred.append[v[1]]
y_pred_prob.append[v[2]]
In this code, y_true_pred is a dictionary. How can I fix the error?
You are missing "items()" after "y_true_pred". That's why you are getting the error. Make the following change and it should work.
for k, v in y_true_pred.items(): y_true.append[v[0]] y_pred.append[v[1]] y_pred_prob.append[v[2]]