Description Usage Arguments Value Author(s) See Also Examples
View source: R/predict.ranktree.R
Predict the median rankings in a tree-based structure built with ranktree
for new observations
1 2 |
object |
An object of the class "ranktree" |
newx |
A dataframe of the same nature of the predictor dataframe with which the tree has been built |
... |
System reserved (No specific usage) |
A list containing:
rankings | the fit in terms of rankings | |
orderings | the fit in terms of orderings | |
info | dataframe containing the terminal nodes in which the new x fall down, then the new x and the fit (in terms of rankings) |
Antonio D'Ambrosio antdambr@unina.it
1 2 3 4 5 6 7 8 9 10 11 12 13 | data(EVS)
EVS$rankings[is.na(EVS$rankings)] <- 3
set.seed(654)
training=sample(1911,1434)
tree <- ranktree(EVS$rankings[training,],EVS$predictors[training,],decrmin=0.001,num=50)
#use the function predict ro predict rankings for new predictors
rankfit <- predict(tree,newx=EVS$predictors[-training,])
#fit in terms of rankings
rankfit$rankings
#fit in terms of orderings
rankfit$orderings
# information about the fit (terminal node, predictor and fit (in terms of rankings))
rankfit$info
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.