Skip to content

Commit

Permalink
added a tag for variable importance score method
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Nov 20, 2016
1 parent 3f4e947 commit 9d05859
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bookdown/06-Tags.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ md_format <- function(x) {
note_string <- if(!is.null(x$notes)) paste("Notes:", x$notes) else ""
cat(method_string, type_string, param_string, pkg_string, note_string, "\n\n", sep = "")
vi_string <- if(!is.null(x$varImp)) "A model-specific variable importance metric is available. " else ""
cat(method_string, type_string, param_string, pkg_string, vi_string, note_string, "\n\n", sep = "")
}
mods <- getModelInfo()
Expand Down
5 changes: 3 additions & 2 deletions bookdown/07-Similarity.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ opts_chunk$set(digits = 3, tidy = FALSE)
modelInfo <- getModelInfo()
tags <- vector(mode = "list", length = length(modelInfo))
Classification <- Regression <- ClassProbs <- rep(NA, length = length(modelInfo))
Classification <- Regression <- ClassProbs <- VarImpMethod <- rep(NA, length = length(modelInfo))
for(i in seq(along = modelInfo)){
tags[[i]] <- modelInfo[[i]]$tags
Classification[i] <- ifelse("Classification" %in% modelInfo[[i]]$type, 1, 0)
Regression[i] <- ifelse("Regression" %in% modelInfo[[i]]$type, 1, 0)
ClassProbs[i] <- ifelse(is.null(modelInfo[[i]]$prob), 0, 1)
VarImpMethod[i] <- ifelse(is.null(modelInfo[[i]]$varImp), 0, 1)
names(tags)[i] <- paste(modelInfo[[i]]$label,
" (", names(modelInfo)[i],
")", sep = "")
Expand Down Expand Up @@ -57,7 +58,7 @@ id_values$ID <- as.numeric(id_values$source_t) - 1
###################################################################
##
cutoff <- .58
cutoff <- .66
a <- b <- v <- NULL
for(i in 1:ncol(sim)) {
Expand Down

0 comments on commit 9d05859

Please sign in to comment.