Learn R Programming

RPEnsemble (version 0.2)

RPalpha: Choose alpha

Description

Chooses the best empirical value of the cutoff alpha, based on the leave-one-out, resubstitution or sample-split estimates of the class labels.

Usage

RPalpha(RP.out, Y, p1)

Arguments

RP.out
The result of a call to RPParallel
Y
Vector of length n or n.val containing the training or validation dataset classes
p1
(Empirical) prior probability

Value

alpha
The value of alpha that minimises the empirical error

Details

See precise details in Cannings and Samworth (2015, Section 5.1).

References

Cannings, T. I. and Samworth, R. J. (2015) Random projection ensemble classification. http://arxiv.org/abs/1504.04595

See Also

RPParallel

Examples

Run this code
Train <- RPModel(1, 50, 20, 0.5)
Test <- RPModel(1, 100, 20, 0.5)
Out <- RPParallel(XTrain = Train$x, YTrain = Train$y, XTest = Test$x, 
d = 2, B1 = 100, B2 = 10, base = "LDA", projmethod = "Haar", 
estmethod = "resub", cores = 1)
alpha <- RPalpha(RP.out = Out, Y = Train$y, p1 = sum(Train$y == 1)/length(Train$y))
alpha

Run the code above in your browser using DataLab