View source: R/getRuleMetric.R
getRuleMetric | R Documentation |
Assign outcomes to a conditions, and measure the rules
getRuleMetric(ruleExec, X, target)
ruleExec |
a set of rule conditions |
X |
predictor variable matrix |
target |
target variable |
a matrix including the condictions, predictions, and metrics
Houtao Deng, Interpreting Tree Ensembles with inTrees, technical report, 2014
library(RRF) data(iris) X <- iris[,1:(ncol(iris)-1)] target <- iris[,"Species"] rf <- RRF(X,as.factor(target),ntree=100) # build an ordinary RF treeList <- RF2List(rf) ruleExec <- extractRules(treeList,X) # transform to R-executable rules ruleExec <- unique(ruleExec) ruleMetric <- getRuleMetric(ruleExec,X,target) # measure rules
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.