r - Number of predictions in each run must be equal to the number of labels for each run -


i trying detect best auc using genetic algorithm in r. here code:

library(ga) library(rocr) realresult <- sample( c(t,f), 350, replace=true, prob=c( 0.5, 0.5) ) aucfitness<-function(scores){   res<-prediction(scores, realresult, label.ordering = null)   auc.tmp <- performance(res,"auc");    auc <- as.numeric(auc.tmp@y.values)   #  print(paste0("auc is: ",auc))   auc }  min <- 0.000654226 max <- 9433.873 ga <- ga(type = "real-valued", fitness = aucfitness, min = min, max = max, monitor = false,popsize = 350) summary(ga) 

but in line ga complains :

 error in prediction(scores, realresult, label.ordering = null) :    number of predictions in each run must equal number of labels each run. 

as see, have size of realresult 350 , popsize = 350, shouldn't face error


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -