
predict PPtree
PPclassify_MOD.Rd
Predict class for the test set with the fitted projection pursuit classification tree and calculate prediction error.
References
Lee, YD, Cook, D., Park JW, and Lee, EK(2013) PPtree: Projection Pursuit Classification Tree, Electronic Journal of Statistics, 7:1369-1386.
Examples
data(iris)
n <- nrow(iris)
tot <- c(1:n)
n.train <- round(n*0.9)
train <- sample(tot,n.train)
test <- tot[-train]
Tree.result <- PPTreeclass_MOD(formula = Species~.,data = iris[train,],PPmethod = "LDA")
PPclassify_MOD(Tree.result,test.data = iris[test,1:4], true.class = iris[test,5])
#> $predict.error
#> [1] 0
#>
#> $predict.class
#> [1] "setosa" "setosa" "setosa" "setosa" "versicolor"
#> [6] "versicolor" "versicolor" "versicolor" "versicolor" "versicolor"
#> [11] "virginica" "virginica" "virginica" "virginica" "virginica"
#>