r-ranger

Construction of confusion matrix

喜夏-厌秋 提交于 2020-05-15 21:23:40
问题 I have a question concerning the construction of confusion matrix from the below link: Ranger Predicted Class Probability of each row in a data frame If I have the following code for example (as explained by the answer in the link): library(ranger) library(caret) idx = sample(nrow(iris),100) data = iris data$Species = factor(ifelse(data$Species=="versicolor",1,0)) Train_Set = data[idx,] Test_Set = data[-idx,] mdl <- ranger(Species ~ ., ,data=Train_Set,importance="impurity", save.memory = TRUE

Construction of confusion matrix

此生再无相见时 提交于 2020-05-15 21:20:06
问题 I have a question concerning the construction of confusion matrix from the below link: Ranger Predicted Class Probability of each row in a data frame If I have the following code for example (as explained by the answer in the link): library(ranger) library(caret) idx = sample(nrow(iris),100) data = iris data$Species = factor(ifelse(data$Species=="versicolor",1,0)) Train_Set = data[idx,] Test_Set = data[-idx,] mdl <- ranger(Species ~ ., ,data=Train_Set,importance="impurity", save.memory = TRUE

R ranger confusion.matrix is larger than supposed when using expand.grid and purrr::pmap

给你一囗甜甜゛ 提交于 2020-04-17 14:18:08
问题 Sorry for all the purrr related questions today, still trying to figure out how to make efficient use of it. So with some help from SO I managed to get random forest ranger model running based on input values coming from a data.frame. This is accomplished using purrr::pmap . However, I don't understand how the return values are generated from the called function. Consider this example: library(ranger) data(iris) Input_list <- list(iris1 = iris, iris2 = iris) # let's assume these are different