Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

ranger: A Fast Implementation of Random Forests for High Dimensional Data in C++ and R

ranger implements random forests in C++ and R that scale to genome-wide data

  • Problem Common R random forest packages were not built for high dimensional data, and some ran out of memory on genome-wide data.
  • Method ranger writes the forest code once in C++ with only standard libraries and exposes it to R through a wrapper.
  • Results ranger's GWAS mode took 0.23 hours at mtry 5000, versus 101.24 hours for randomForest.

Why older forest packages stall on wide data

Random forests are used for gene expression, credit scoring and genome-wide association studies, so their software speed matters in practice. The original Fortran implementation had to be recompiled whenever the data or a parameter changed. The randomForest package is feature-rich and widely used, but it was not built for large numbers of features.

The party package and Willows share that weakness, and bigrf handles large data only for classification forests. Random Jungle was built for high dimensional data, but it runs only as a C++ application and can't be called from R. The authors therefore wanted a platform independent package that is simple to use from R and not slower than Random Jungle 2.1.

On GWAS-scale data the problem became concrete, because Rborist and bigrf without disk caching ran out of memory. A package that handles this scale has to keep memory use in check as well as runtime.

A C++ core behind an R wrapper

The key idea is to write the forest code once in C++ with only standard libraries, and to expose it to R through a wrapper. Because the core depends on nothing beyond the standard libraries, a standalone C++ build can be installed on up-to-date platforms. Rcpp turns the R package into a single install command, and the data stay inside R, so no external files are needed.

Parallel processing uses the C++11 thread library, and random numbers come from the random library.

Node splitting is the costliest step, because every one of the mtry candidate features must be scored as a split at each node. The runtime mode uses the first algorithm in large nodes and the second in small nodes, while the memory mode uses only the second. For GWAS data the features are minor allele counts of 0, 1 or 2, so the index already is the value and the sort can be skipped.

Drawing the mtry candidate features in each node was another bottleneck, and Knuth's sampling without replacement gave the major gain. Memory is saved by avoiding copies of the original data, using simple node structures and freeing memory early. Genotypes can be loaded from GenABEL objects into a compact binary format, but this path exists only in the R version.

The split criterion follows the task: the Gini index for classification, the estimated response variance for regression, and the log-rank test for survival.

Matching randomForest on error and importance

To test agreement, the authors compared out-of-bag errors and variable importance with randomForest under identical settings. They simulated a dichotomous endpoint with 2000 samples and 50 features, where a logit model gives an effect to 5 features and none to the other 45. They generated 200 such datasets and grew 5000 trees per forest with both packages on each dataset.

The out-of-bag errors showed no systematic difference between the packages, and the regression check gave similar results.

The importance check used 10,000 forests of 500 trees each, with node impurity as the split criterion. Gini importance and permutation importance were both computed, and the values for the five effect variables came out very similar for the two packages. So on these simulated designs ranger agrees with the reference package.

Runtime on small simulated classification data

The small benchmark varied the number of trees, features, samples and mtry, one at a time, with the other three held fixed. The fixed values were 500 trees, 1000 samples and 1000 features, and each run used a single core. Trees were grown until purity, and the results averaged 20 simulation repeats.

In every simulated scenario ranger outperformed the other four packages. For sample size all packages scaled superlinearly, but only ranger scaled almost linearly. ranger stayed the fastest at every mtry value tested.

The authors note that the gaps add up when several parameters grow together. They did not show those combined runs, so this combined effect is their observation only.

Runtime and memory at GWAS scale

The second benchmark simulated 10,000 subjects and 150,000 features, which the authors call a realistic GWAS scenario. Each forest had 1000 trees, and mtry was 5000, 15,000 or 135,000 features. randomForestSRC, Random Jungle and ranger ran on 12 cores, while the randomForest package can't multithread by itself.

At mtry of 5000, randomForest took 101.24 hours and used 39.05 GB. ranger in GWAS mode finished in 0.23 hours with a peak memory of 0.23 GB. The standard ranger mode took 0.56 hours and 11.26 GB, so the GWAS mode adds a further gain on top of the standard mode.

The save.memory option cut ranger's memory to 0.24 GB but raised its runtime to 0.93 hours. Random Jungle used very little memory, 0.40 GB, but took 1.51 hours at this mtry. The authors conclude that the GWAS mode had both the lowest runtime and the lowest memory of the compared packages.

Where Rborist beats ranger

With 100,000 samples and 100 features, ranger was fastest for dichotomous features, at 0.69 minutes. For continuous features ranger took 5.49 minutes, while Rborist took 2.13 minutes. So the ranking depends on the feature type, and Rborist is the faster choice for continuous features at this size.

To find the boundary, the authors ran 441 combinations of sample sizes from 10 to 100,000 and feature counts from 10 to 1000, using continuous features and 12 cores. ranger was faster at every feature count below 25,000 samples. Above that, Rborist won when features were few, and the threshold rose roughly linearly with sample size. ranger scaled slightly better with cores, so the exact threshold may shift on other hardware.

The authors turn this into a rule: Rborist for low dimensional data with n above 25,000, and ranger otherwise. That rule concerns runtime only, and memory-sparse settings call for save.memory while GWAS data call for the GWAS mode.

Limits of the evidence

Every benchmark uses simulated data, so the validation and runtime results don't show performance on real genotype or clinical data. The GWAS-scale study ran one simulated design, and randomForest (MC) could use only 3 cores at mtry 5000 and 2 cores at the other values because of memory. bigrf without disk caching ran out of memory, and with disk caching the authors stopped it after 16 days.

Rborist grows smaller classification trees than randomForest with default settings, so the packages don't always give the same trees. The GWAS format and mode exist only in the R version, which the authors advise for general use. The authors state they know of no faster random forest implementation for high dimensional data with many features.

Party and Willows were not included in the runtime comparison, so that claim was not tested against them.

Paper info

Authors
Marvin N. Wright, Andreas Ziegler
Venue
arXiv · Preprint
First published
2015-8-18
Added
2026-11-12
Updated
2018-5-17
Version
v2
arXiv
1508.04409
DOI
10.18637/jss.v077.i01
Category
stat.ML · stat.CO
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Marvin N. Wright, Andreas Ziegler (2015). ranger: A Fast Implementation of Random Forests for High Dimensional Data in C++ and R. arXiv:1508.04409v2. https://doi.org/10.18637/jss.v077.i01

BibTeX
@article{wright2015ranger,
  title = {{ranger: A Fast Implementation of Random Forests for High Dimensional Data in C++ and R}},
  author = {Marvin N. Wright and Andreas Ziegler},
  year = {2015},
  eprint = {1508.04409},
  archivePrefix = {arXiv},
  doi = {10.18637/jss.v077.i01},
  url = {https://arxiv.org/abs/1508.04409v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up