I use random forest classifier in a multi class problem.
rf = RandomForestClassifier(()
rf.fit(train_X, train_y)
And then for prediction:
pred = rf.predict(test_X)
So then I want to compute the roc_auc_score like so:
roc_value = roc_auc_score(test_y, pred, average='weighted',
multi_class='ovr',labels=[0,1,2,3,4])
But this gives an error:
numpy.AxisError: axis 1 is out of bounds for array of dimension 1
How do I fix this?