Skip to content

Commit

Permalink
fixed object name bug
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Jul 15, 2015
1 parent aed5b84 commit 5f1e416
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/files/bartMachine.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ modelInfo <- list(label = "Bayesian Additive Regression Trees",
},
predictors = function(x, ...) colnames(x$X),
varImp = function(object, ...){
imps <- investigate_var_importance(x, plot = FALSE)
imps <- investigate_var_importance(object, plot = FALSE)
imps <- imps$avg_var_props - 1.96*imps$sd_var_props
missing_x <- !(colnames(x$X) %in% names(imps))
missing_x <- !(colnames(object$X) %in% names(imps))
if(any(missing_x)) {
imps2 <- rep(0, sum(missing_x))
names(imps2) <- colnames(x$X)[missing_x]
names(imps2) <- colnames(object$X)[missing_x]
imps <- c(imps, imps2)
}
out <- data.frame(Overall = as.vector(imps))
Expand Down

0 comments on commit 5f1e416

Please sign in to comment.