Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/RPEnsembleClass.R
Performs a biased majority vote over B1
base classifications to assign the test set.
1 | RPEnsembleClass(RP.out, n , n.val, n.test, p1, samplesplit, alpha, ...)
|
RP.out |
The result of a call to |
n |
Training set sample size |
n.test |
Test set sample size |
n.val |
Validation set sample size |
p1 |
Prior probability estimate |
samplesplit |
|
alpha |
The voting threshold |
... |
Optional further arguments if |
An observation in the test set is assigned to class 1 if B1*alpha
or more of the base classifications are class 1 (otherwise class 2).
A vector of length n.test
containing the class predictions of the test set (either 1 or 2).
Timothy I. Cannings and Richard J. Samworth
Cannings, T. I. and Samworth, R. J. (2017) Random-projection ensemble classification, J. Roy. Statist. Soc., Ser. B. (with discussion), 79, 959–1035
1 2 3 4 5 6 7 8 9 10 | Train <- RPModel(1, 50, 100, 0.5)
Test <- RPModel(1, 100, 100, 0.5)
Out <- RPParallel(XTrain = Train$x, YTrain = Train$y, XTest = Test$x,
d = 2, B1 = 50, B2 = 10, base = "LDA", projmethod = "Haar",
estmethod = "training", clustertype = "Default")
Class <- RPEnsembleClass(RP.out = Out, n = length(Train$y),
n.test = nrow(Test$x), p1 = sum(Train$y == 1)/length(Train$y),
splitsample = FALSE, alpha = RPalpha(Out, Y = Train$y,
p1 = sum(Train$y == 1)/length(Train$y)))
mean(Class != Test$y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.