View source: R/PPclassify_MOD.R
PPclassify_MOD | R Documentation |
Predict class for the test set with the fitted projection pursuit classification tree and calculate prediction error.
PPclassify_MOD(Tree.result,test.data,true.class=NULL,...)
Tree.result |
PPtreeclass object |
test.data |
the test dataset |
true.class |
true class of test dataset if available |
... |
arguments to be passed to methods |
predict.class predicted class
predict.error number of the prediction errors
Lee, YD, Cook, D., Park JW, and Lee, EK(2013) PPtree: Projection Pursuit Classification Tree, Electronic Journal of Statistics, 7:1369-1386.
data(penguins)
penguins <- na.omit(penguins[, -c(2,7, 8)])
require(rsample)
penguins_spl <- rsample::initial_split(penguins, strata=species)
penguins_train <- training(penguins_spl)
penguins_test <- testing(penguins_spl)
penguins_ppt <- PPTreeclass_MOD(species~bill_len + bill_dep +
flipper_len + body_mass, data = penguins_train, PPmethod = "LDA")
PPclassify_MOD(penguins_ppt, test.data=penguins_test[,-1], true.class = penguins_test$species)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.