Description Usage Arguments Author(s) Examples
Prepare data for sankeyPlot from GBM or randomForest model object.
1 2 3 4 5 6 7 8 9 10 |
tree_model |
This could be either GBM or randomForest model object. |
treeInd |
An integer to specify the tree index from forest. |
Sixiang Hu
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
data(iris)
iris.mod <- gbm(Species ~ ., distribution="multinomial",
data=iris, n.trees=2000, shrinkage=0.01,
cv.folds=5, verbose=FALSE, n.cores=1)
tree_data <- tree2data(iris.mod,1)
library(networkD3)
sankeyNetwork(tree_data[[1]],tree_data[[2]],Source="src",Target="tar",
Value="value",NodeID="name")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.