extract.rules | R Documentation |
Extract rules from a random forest (rfsrc)
object
extract.rules(object, subtrees = 5,
treedepth = 2,
digit = 2,
pairs = TRUE)
object |
A random forest |
subtrees |
Number of trees to extract rules |
treedepth |
Tree depth. The larger the number, the longer the extracted rules are. |
digit |
Digit to be displayed in the extracted rules. |
pairs |
Are varibles in |
rule |
Interpretable extracted rules. Note that the performance score displayed is inaccurate based on few samples. |
rule.raw |
Rules directly extracted from trees for prediction purpose |
data |
Data used to grow trees from the argument |
Ruijie Yin (Maintainer,<ruijieyin428@gmail.com>), Chen Ye and Min Lu
Lu M. Yin R. and Chen X.S. Ensemble Methods of Rank-Based Trees for Single Sample Classification with Gene Expression Profiles. Journal of Translational Medicine. 22, 140 (2024). doi: 10.1186/s12967-024-04940-2
data(tnbc)
obj <- rforest(subtype~., data = tnbc[1:100,c(1:5,337)])
objr <- extract.rules(obj)
objr$rule[,1:3]
#### extract rules from a regular random forest
library(randomForestSRC)
obj2 <- rfsrc(subtype~., data = tnbc[1:100,c(1:5,337)])
objr2 <- extract.rules(obj2, pairs = FALSE)
objr2$rule[,1:3]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.