Skip to content

Commit

Permalink
add se in extra slot and keep prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin Wright committed May 12, 2017
1 parent 91b2ef4 commit d7c111c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ predict.ranger.forest <- function(object, data, predict.all = FALSE,
jack <- (n - 1) / n * rowSums((jack.n - yhat)^2)
bias <- (exp(1) - 1) * n / result$num.trees^2 * rowSums((result$predictions - yhat)^2)
jab <- pmax(jack - bias, 0)
result$predictions <- sqrt(jab)
result$se <- sqrt(jab)

## Response as predictions
result$predictions <- yhat
}

class(result) <- "ranger.prediction"
Expand Down

0 comments on commit d7c111c

Please sign in to comment.