Error: no slot of name "actual.values" for this object of class "performance"

I am having an issue with the code below. It produce the above error message. Not sure where I am going wrong

library("ROCR")
pred <- prediction(predict,y_New)
performance(pred,"auc")@actual.values

perf <- performance(pred,"tpr","fpr")
plot(perf)

im not seeing actual.values as a slot on performance

library("ROCR")

nums <- 1:100
rands <-runif(100,0,1)
part_pred_labs <- ifelse(nums<50,
               ifelse(rands>.7,TRUE,FALSE),
               ifelse(rands>.3,TRUE,FALSE))
rand_pred_labs <- rands >.5


performance(prediction(nums,part_pred_labs),"auc")@y.values[[1]]
performance(prediction(nums,rand_pred_labs),"auc")@y.values[[1]]
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.