Questions tagged [r-ranger]

69 questions
0
votes
0 answers

How does the ranger random forest package calculate MSE and R squared OOB?

model=ranger(mpg~.,data=mtcars) Call: ranger(mpg ~ ., data = mtcars) Type: Regression Number of trees: 500 Sample size: 32 Number of independent variables: 10 Mtry: …
Herman Toothrot
  • 1,463
  • 3
  • 23
  • 53
0
votes
0 answers

Why is rfe not working with resample in mlr3 R?

I am currently making an RFE thanks to the mlr3 package following this methodology: https://doi.org/10.3390/rs14215381. When I use the resample function to optimize the random forest parameters based on the new variable selection, the command does…
0
votes
1 answer

Customized loss function for Random Forest for Regression in R

I want to implement my own customized loss function for a random forest regression in R. I found this Random Forests with a Customized Loss Function on how to do it in python, however not in R. I would think that maybe the mlr3 package lets you…
0
votes
0 answers

Review performance of smaller model subsets of a large Random Forest model?

I'm constrained by the memory footprint / size of my Random Forest model so would prefer the number of trees be as low as possible and the depth of trees to be as shallow as possible while minimizing any impact on performance. Rather than needing to…
0
votes
1 answer

Forest with ranger predictions on non-continuous data

I'm creating a random forest model with ranger in R that training on MNIST pixel data and predicting the number that the pixels represent (0-9). After creating my model with the following code and looking at the predictions, many of my predicted…
amatof
  • 175
  • 1
  • 13
0
votes
1 answer

`mtry` in R language `ranger`

Which of the following understanding is true? The number of features that we can use per tree (we bootstrap a subset of features) The number of features that we use for each split With equivalent function RandomForestClassifier.max_features in…
Cloudy
  • 58
  • 6
0
votes
1 answer

Is there an R function in the ranger package that can combine two random forest model?

Due to the size of my RAM, I decided to split my data into two and fit two different random forest models using the ranger r package. Is there a function in ranger that allows me to combine these two models into onefor prediction?
KEN
  • 55
  • 5
0
votes
1 answer

Error in calculating confusion matrix or contigency table for multiclassification using ranger

I am invoking ranger to model a multi-classification problem of a big mixed-data frame (where some categorical variables have more than 53 levels). Training and Testsing runs without any problem. However, interpretting confusion matrix/ contigency…
Ray
  • 321
  • 2
  • 12
0
votes
1 answer

Error while computing confusion matrix for multiclassification using ranger

I am trying to compute the confusion matrix of a multi-classification problem of a very big data frame, which is divided and scaled as Train_Scale and Test_Scale (scales of Train set are used for scaling Test) sets. Ranger was used to do…
Ray
  • 321
  • 2
  • 12
0
votes
1 answer

Format of predictions is invalid. It couldn't be coerced to a list Error in r

I am using ranger to fit random forest. As evaluation metric, I am using roc-auc-score, by cvAUC. After making predictions, when I try to evaluate the auc score, I get an error: Format of predictions is invalid. It couldn't be coerced to a list. I…
Mine
  • 831
  • 1
  • 8
  • 27
0
votes
0 answers

In MLR3 Ranger setting class.weights, error "Assertion on 'xs' failed: class.weights: Must have length 1"

I would like to set the class.weights parameter using a Ranger classifier in MLR3. In the base Ranger package, the class.weights parameter takes a vector. When trying to set the same parameter in MLR3, I get an error. # create a dummy dataset and…
zmek
  • 53
  • 7
0
votes
0 answers

Prediction Intervals from Quantile Regression Forests have higher coverage than expected?

Question: What factors may cause the prediction interval to have wider coverage than would be expected? Particularly with regard to quantile regression forests with the ranger package? Specific Context + REPREX: I am using quantile regression…
0
votes
1 answer

Can the out of bag error for a random forests model in R's TidyModel's framework be obtained?

If you directly use the ranger function, one can obtain the out-of-bag error from the resulting ranger class object. If instead, one proceeds by way of setting up a recipe, model specification/engine, with tuning parameters, etc., how can we extract…
0
votes
1 answer

Random forest algorithm for multiple columns

I would like to perform a random forest for multiple species using ranger. I can manage to do this separately for each individual species, although when I select for multiple species I get the following error: detection_freq <-…
Lime
  • 738
  • 5
  • 17
0
votes
1 answer

R caret random forests ggplot modify legend

How do I modify the default plot legend produced by applying ggplot to a caret object built using the ranger algorithm? For example, suppose I would like the legend title to be, "Splitting algo" instead of the default, "Splitting…
user1491868
  • 596
  • 4
  • 15
  • 42