R: Missing 'forest' argument when running randomForest -
i trying use randomforest classify set of data based on small percentage of 'training data'. keep receiving error
"error in predict(forest, ubertable, type = "prob") : argument "forest" missing, no default"
'forest' supposed list runs entire forest, mean? mean training set? or entire data set?
the code (sorry if it's long) follows:
function(ubertable, forest, perf=null, order.by = "percent") { require(randomforest) my.pred = predict(forest, ubertable, type="prob") ubertable$rf_score = my.pred[,2] if (is.null(perf)) { cat("no perf object available; cannot make explicit predictions. doing rankings only! \n") } else { cat("calculating exact operating point\n") my.alpha = calculate.operating.parameters(perf=perf, method="frequency")$op ubertable$rf_prediction = ifelse(my.pred[,2] <= my.alpha, "call", "noise") } ubertable2 = ubertable[0, ] ubertable2$rf_rank_within_day = numeric() (day in unique(ubertable$begin.file)) { subtable = ubertable[ubertable$begin.file == day, ] subtable = subtable[order(subtable$rf_score), ] subtable$rf_rank_within_day = 1:nrow(subtable) ubertable2 = rbind(ubertable2, subtable) } if(order.by == "percent") { ubertable2 = ubertable2[order(ubertable2$random.percent, ubertable2$begin.file), ] } else if (order.by == "rank_within_day") { ubertable2 = ubertable2[order(ubertable2$rf_rank_within_day), ] } else { stop(paste("unknown value order.by:", order.by)) } ubertable2 }
if helps data looks this:
call vs noise: noise noise noise noise call call call random.percent: 1 2 6 22 55 71 4 begin.file: foo.wav foo.wav foo.wav foo.wav (etc) ... many other columns spectroscopy info.
i cannot upload dataset @ work, can email if needed.
why getting error, , can fix it?
Comments
Post a Comment