PPclassify | R Documentation |
Predict class for the test set and calculate prediction error after finding the PPtree structure, .
PPclassify( Tree.result, test.data = NULL, Rule = 1, true.class = NULL)
Tree.result |
the result of PP.Tree |
test.data |
the test dataset |
Rule |
split rule 1:mean of two group means, 2:weighted mean, 3: mean of max(left group) and min(right group), 4: weighted mean of max(left group) and min(right group) |
true.class |
true class of test dataset if available |
predict.class predicted class
predict.error prediction error
Lee, YD, Cook, D., Park JW, and Lee, EK(2013) PPtree: Projection pursuit classification tree, Electronic Journal of Statistics, 7:1369-1386.
#crab data set
set.seed(143)
idx <-sample(1:200, 150)
Tree.crab <- PPtree_split('Type~.', data = crab[idx,], PPmethod = 'LDA', size.p = 1)
Tree.crab
PPclassify(Tree.crab, test.data = crab[-idx, 2:6], Rule = 1,true.class = crab[-idx, 1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.