Questions tagged [r-ranger]
69 questions
1
vote
2 answers
How to extract predictors from parsnip fit object
I have the following prediction model:
library(tidymodels)
data(ames)
set.seed(4595)
data_split <- initial_split(ames, strata = "Sale_Price", prop = 0.75)
ames_train <- training(data_split)
ames_test <- testing(data_split)
rec <-…

littleworth
- 4,781
- 6
- 42
- 76
1
vote
1 answer
Imputation of target using mlr3
After studying the sources describing mlr3 and looking at the given examples I still couldn't find any answer about how to impute the target variable during a regression task, when it has missings. I want to use Ranger, but it can't deal with…

Nucore
- 107
- 1
- 13
1
vote
1 answer
Hyperparameters not changing results from random forest regression trees
I am trying to tune the hyperparameters of a random forest regression model and all of the accuracy measures are exactly the same, regardless of changes to hyperparameters. I've tested the same code on the "diamonds" dataset and have been able to…

katefull06
- 183
- 6
1
vote
1 answer
Making caret train rf faster when ranger is not an option
The website I am trying to run the code is using an old version of R and does not accept ranger as the library. I have to use the caret package. I am trying to process about 800,000 lines in my train data frame and here is the code I use
control <-…

Ilayda Göden
- 69
- 3
1
vote
0 answers
How to obtain expected time to death from ranger survival predictions?
I am trying to obtain the expected time to death from ranger predictions. Given the code below, how do I estimate the time to death from the survival probability in predictions$survival?
library(survival)
library(ranger)
data <- pbc
data <-…

Luca_brasi
- 89
- 7
1
vote
2 answers
How to set ranger as default file manager
Related: Here, Here, Here, & Here.
I want to be able to use gui applications with ranger, e.g., I want to click a desktop folder icon & have it open in ranger.
Steps I take & errors that follow:
Set…

mw3modderman
- 13
- 2
1
vote
0 answers
How to get 95% CI or prediction interval for a predicted probability obtained from a random forest model using caret package in R?
My goal is to save the model as an input object for an R Shiny app and then for a new subject, insert inputs in the app, and calculate predicted probabilities and associated 95% CI (or prediction intervals).
I did the following to save the…

Blain Waan
- 393
- 2
- 4
- 17
1
vote
0 answers
how to take a digest of a ranger object in R
I want a checksum on a ranger object. (random forest)
Can I do that in memory, without writing to a file?
Here is my dummy code:
library(digest)
digest(my_ranger_object, algo = "sha1", serialize = T)
I get the following error:
Error in…

EngrStudent
- 1,924
- 31
- 46
1
vote
1 answer
R ranger treeInfo final nodes have the same class
When I use ranger for a classification model and treeInfo() to extract a tree, I see that sometimes a split results in two identical terminal nodes.
Is this expected behaviour? Why does it make sense to introduce a split where the final nodes are…

David
- 9,216
- 4
- 45
- 78
1
vote
0 answers
Why am I getting a missing value for the standard errors when using ranger package through mlr3? My data set has no missing values
My data set (be) is just a generic series and I am using 2 lagged values of the series as predictors. When I run ranger through mlr3 I get an error saying there are missing values in pdata$se, don't know what is wrong, there are no missing values…

sagrules
- 31
- 1
- 7
1
vote
0 answers
Bug in ranger learner with predict.all = TRUE
I would like to have all the predictions of a random forest from the package {ranger} stored in an ml3 Prediction Object, and then use the predictions of the individual trees as features for another learner.
The following code then follows to the…

Robin.Huewel
- 11
- 1
1
vote
1 answer
Error when trying to use ranger into caret
I have a dataset "df_train" that contains all my explanatory variables and my target variable (xxx1). Furthermore, I have another dataset that contains the weights to use when fitting Random Forest (xxx2 column). I am trying to implement 3-fold cv…

Nicolas123
- 131
- 1
- 8
1
vote
3 answers
How to save a parsnip model fit (from ranger)?
I have a parsnip model (from ranger), roughly from here:
# install.packages("tidymodels")
data(cells, package = "modeldata")
rf_mod <-
rand_forest(trees = 100) %>%
set_engine("ranger") %>%
…

dfrankow
- 20,191
- 41
- 152
- 214
1
vote
1 answer
How to set up data for "ranger" in R. Error: Missing data in columns
Code:
ranger(outcome~., data, num.trees=500, probability=TRUE)
Error: Missing data in columns
Is there a format that the data needs to be in? How to get past this error?

helicon
- 23
- 3
1
vote
1 answer
How to plot OOB error vs. Number of trees using ranger?
I want to obtain the optimal number of trees for random forest by plotting the OOB error vs. Number of trees and see at which point the error plateaus. However, as my problem involves text mining, my training data is of sparse matrix type i.e., in…

mlfos
- 11
- 2