RPEnsembleClass: Classifies the test set using the random projection ensemble...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/RPEnsembleClass.R

Description

Performs a biased majority vote over B1 base classifications to assign the test set.

Usage

1
RPEnsembleClass(RP.out, n , n.val, n.test, p1, samplesplit, alpha, ...)

Arguments

RP.out

The result of a call to RPParallel

n

Training set sample size

n.test

Test set sample size

n.val

Validation set sample size

p1

Prior probability estimate

samplesplit

TRUE if using sample-splitting method

alpha

The voting threshold

...

Optional further arguments if base = "other"

Details

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).

Value

A vector of length n.test containing the class predictions of the test set (either 1 or 2).

Author(s)

Timothy I. Cannings and Richard J. Samworth

References

Cannings, T. I. and Samworth, R. J. (2017) Random-projection ensemble classification, J. Roy. Statist. Soc., Ser. B. (with discussion), 79, 959–1035

See Also

RPParallel, RPalpha, RPChoose

Examples

 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)

RPEnsemble documentation built on Feb. 24, 2021, 5:06 p.m.