RPEnsemble

R 패키지 메타데이터와 수집 신호를 모아 봅니다.

Packages / CRAN / RPEnsemble

RPEnsemble

v0.5
Repository CRANLicense GPL-3Lifecycle activeNeeds compilation no
DOI
10.32614/CRAN.package.RPEnsemble

Core Signals

첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.

0
표시할 핵심 신호가 없습니다.

Supported Backends

DESCRIPTION에서 감지한 backend 관련 package입니다.

0
backend package 신호가 없습니다.

Quick Facts

기본 메타데이터를 작은 카드와 토큰으로 압축합니다.

profile
Repository
CRAN
Version
0.5
License
GPL-3
Lifecycle
active
Needs compilation
no
Last observed
2026-05-30
CRAN
cran.r-project.org/package=RPEnsemble

수집 소스별 패키지 정보

1개 소스
CRAN
0.5
2026-05-30
License
GPL-3
Depends
R (>= 3.4.0), MASS, parallel
Imports
class, stats
Needs compilation
no
Lifecycle
active
Last observed
2026-05-30 10:45:11

이 패키지가 의존하는 패키지

4개 표시전체 4개
PackageTypeSpec
MASS
CRAN · 0.5 · 2026-05-30
DependsMASS
parallel
CRAN · 0.5 · 2026-05-30
Dependsparallel
class
CRAN · 0.5 · 2026-05-30
Importsclass
stats
CRAN · 0.5 · 2026-05-30
Importsstats
1 / 1

이 패키지를 쓰는 패키지

0개 표시전체 0개
PackageTypeSpec
표시할 dependency edge가 없습니다.
1 / 1

패키지 페이지

All links
21
Repository
CRAN
Version
0.5
Collected
2026-05-17 06:31:37
Package page
https://cran.r-project.org/web/packages/RPEnsemble/index.html
DOI
10.32614/CRAN.package.RPEnsemble
CRAN checks
https://cran.r-project.org/web/checks/check_results_RPEnsemble.html
Reference HTML
https://cran.r-project.org/web/packages/RPEnsemble/refman/RPEnsemble.html
Reference PDF
https://cran.r-project.org/web/packages/RPEnsemble/RPEnsemble.pdf
Source package
https://cran.r-project.org/src/contrib/RPEnsemble_0.5.tar.gz
Archive
https://CRAN.R-project.org/src/contrib/Archive/RPEnsemble
Page fields
Author
Timothy I. Cannings and Richard J. Samworth
CRAN Checks
RPEnsemble results
DOI
10.32614/CRAN.package.RPEnsemble
License
GPL-3
Maintainer
Timothy I. Cannings <timothy.cannings at ed.ac.uk>
NeedsCompilation
no
Old Sources
RPEnsemble archive
Package Source
RPEnsemble_0.5.tar.gz
Published
2021-02-24
Reference Manual
RPEnsemble.html , RPEnsemble.pdf
URL
https://arxiv.org/abs/1504.04595 , https://www.maths.ed.ac.uk/~tcannings/
Version
0.5
Windows Binaries
r-devel: RPEnsemble_0.5.zip , r-release: RPEnsemble_0.5.zip , r-oldrel: RPEnsemble_0.5.zip
MacOS Binaries
r-release (arm64): RPEnsemble_0.5.tgz , r-oldrel (arm64): RPEnsemble_0.5.tgz , r-release (x86_64): RPEnsemble_0.5.tgz , r-oldrel (x86_64): RPEnsemble_0.5.tgz
Version
0.5
Published
2021-02-24
DOI
10.32614/CRAN.package.RPEnsemble
Author
Timothy I. Cannings and Richard J. Samworth
Maintainer
Timothy I. Cannings <timothy.cannings at ed.ac.uk>
License
GPL-3
URL
https://arxiv.org/abs/1504.04595 , https://www.maths.ed.ac.uk/~tcannings/
NeedsCompilation
no
CRAN Checks
RPEnsemble results
Reference Manual
RPEnsemble.html , RPEnsemble.pdf
Package Source
RPEnsemble_0.5.tar.gz
Windows Binaries
r-devel: RPEnsemble_0.5.zip , r-release: RPEnsemble_0.5.zip , r-oldrel: RPEnsemble_0.5.zip
MacOS Binaries
r-release (arm64): RPEnsemble_0.5.tgz , r-oldrel (arm64): RPEnsemble_0.5.tgz , r-release (x86_64): RPEnsemble_0.5.tgz , r-oldrel (x86_64): RPEnsemble_0.5.tgz
Old Sources
RPEnsemble archive
Page sections 3
Documentation
Heading
Documentation
Links
[{"label":"RPEnsemble.html","section":"","type":"","url":"https://cran.r-project.org/web/packages/RPEnsemble/refman/RPEnsemble.html"},{"label":"RPEnsemble.pdf","section":"","type":"","url":"https://cran.r-project.org/web/packages/RPEnsemble/RPEnsemble.pdf"}]
Text
Reference manual: RPEnsemble.html , RPEnsemble.pdf
Downloads
Heading
Downloads
Links
[{"label":"RPEnsemble_0.5.tar.gz","section":"","type":"","url":"https://cran.r-project.org/src/contrib/RPEnsemble_0.5.tar.gz"},{"label":"RPEnsemble_0.5.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.7/RPEnsemble_0.5.zip"},{"label":"RPEnsemble_0.5.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.6/RPEnsemble_0.5.zip"},{"label":"RPEnsemble_0.5.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.5/RPEnsemble_0.5.zip"},{"label":"RPEnsemble_0.5.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/sonoma-arm64/contrib/4.6/RPEnsemble_0.5.tgz"},{"label":"RPEnsemble_0.5.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/RPEnsemble_0.5.tgz"},{"label":"RPEnsemble_0.5.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.6/RPEnsemble_0.5.tgz"},{"label":"RPEnsemble_0.5.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.5/RPEnsemble_0.5.tgz"},{"label":"RPEnsemble archive","section":"","type":"","url":"https://CRAN.R-project.org/src/contrib/Archive/RPEnsemble"}]
Text
Package source: RPEnsemble_0.5.tar.gz Windows binaries: r-devel: RPEnsemble_0.5.zip , r-release: RPEnsemble_0.5.zip , r-oldrel: RPEnsemble_0.5.zip macOS binaries: r-release (arm64): RPEnsemble_0.5.tgz , r-oldrel (arm64): RPEnsemble_0.5.tgz , r-release (x86_64): RPEnsemble_0.5.tgz , r-oldrel (x86_64): RPEnsemble_0.5.tgz Old sources: RPEnsemble archive
Linking
Heading
Linking
Links
[{"label":"https://CRAN.R-project.org/package=RPEnsemble","section":"","type":"","url":"https://CRAN.R-project.org/package=RPEnsemble"}]
Text
Please use the canonical form https://CRAN.R-project.org/package=RPEnsemble to link to this page.
Documentation 2
Downloads 9
All page links 21

패키지 문서 원문

2 artifacts
reference_manual_html
Reference manual HTML
CRAN · 0.5 · Documentation · text/html · 31,391 · 2026-05-07
Title
Help for package RPEnsemble
Label
Reference manual HTML
Text content
Text content
Help for package RPEnsemble const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {RPEnsemble} Contents RPEnsemble-package Other.classifier R RPChoose RPChooseSS RPEnsembleClass RPGenerate RPModel RPParallel RPalpha Version: 0.5 Date: 2021-02-23 Title: Random Projection Ensemble Classification Author: Timothy I. Cannings and Richard J. Samworth Maintainer: Timothy I. Cannings <timothy.cannings@ed.ac.uk> Description: Implements the methodology of "Cannings, T. I. and Samworth, R. J. (2017) Random-projection ensemble classification, J. Roy. Statist. Soc., Ser. B. (with discussion), 79, 959–1035". The random projection ensemble classifier is a general method for classification of high-dimensional data, based on careful combination of the results of applying an arbitrary base classifier to random projections of the feature vectors into a lower-dimensional space. The random projections are divided into non-overlapping blocks, and within each block the projection yielding the smallest estimate of the test error is selected. The random projection ensemble classifier then aggregates the results of applying the base classifier on the selected projections, with a data-driven voting threshold to determine the final assignment. Depends: R (≥ 3.4.0), MASS, parallel Imports: class, stats License: GPL-3 URL: https://arxiv.org/abs/1504.04595 , https://www.maths.ed.ac.uk/~tcannings/ NeedsCompilation: no Packaged: 2021-02-24 12:36:23 UTC; tc Repository: CRAN Date/Publication: 2021-02-24 13:40:08 UTC Random Projection Ensemble Classification Description Implements the methodology of Cannings and Samworth (2017). The random projection ensemble classifier is a very general method for classification of high-dimensional data, based on careful combination of the results of applying an arbitrary base classifier to random projections of the feature vectors into a lower-dimensional space. The random projections are divided into non-overlapping blocks, and within each block the projection yielding the smallest estimate of the test error is selected. The random projection ensemble classifier then aggregates the results of applying the base classifier on the selected projections, with a data-driven voting threshold to determine the final assignment. Details RPChoose chooses the projection from a block of size B2 that minimises an estimate of the test error (see Cannings and Samworth, 2017, Section 3), and classifies the training and test sets using the base classifier on the projected data. RPParallel makes many calls to RPChoose in parallel. RPalpha chooses the best empirical value of alpha (see Cannings and Samworth, 2017, Section 5.1). RPEnsembleClass combines the results of many base classifications to classify the test set. The method can be used with any base classifier, any test error estimate and any distribution of the random projections. This package provides code for the following options: Classifiers – linear discriminant analysis, quadratic discriminant analysis and the k-nearest neighbour classifier. Error estimates – resubstitution and leave-one-out, we also provide code for the sample-splitting method described in Cannings and Samworth (2017, Section 7) (this can be done by setting estmethod = samplesplit ). Projection distribution – Haar, Gaussian or axis-aligned projections. The package provides the option to add your own base classifier and estimation method, this can be done by editing the code in the function Other.classifier . Moreover, one could edit the RPGenerate function to generate projections from different distributions. Author(s) Timothy I. Cannings and Richard J. Samworth Maintainer: Timothy I. Cannings <timothy.cannings@ed.ac.uk> References Cannings, T. I. and Samworth, R. J. (2017) Random-projection ensemble classification, J. Roy. Statist. Soc., Ser. B. (with discussion), 79, 959–1035 Examples #generate data from Model 1 set.seed(101) Train <- RPModel(2, 50, 100, 0.5) Test <- RPModel(2, 100, 100, 0.5) #Classify the training and test set for B1 = 10 independent projections, each #one carefully chosen from a block of size B2 = 10, using the "knn" base #classifier and the leave-one-out test error estimate Out <- RPParallel(XTrain = Train$x, YTrain = Train$y, XTest = Test$x, d = 2, B1 = 10, B2 = 10, base = "knn", projmethod = "Haar", estmethod = "loo", splitsample = FALSE, k = seq(1, 25, by = 3), clustertype = "Default") #estimate the class 1 prior probability phat <- sum(Train$y == 1)/50 #choose the best empirical value of the voting threshold alpha alphahat <- RPalpha(RP.out = Out, Y = Train$y, p1 = phat) #combine the base classifications Class <- RPEnsembleClass(RP.out = Out, n = 50, n.test = 100, p1 = phat, alpha = alphahat) #calculate the error mean(Class != Test$y) #Code for sample splitting version of the above #n.val <- 25 #s <- sample(1:50,25) #OutSS <- RPParallel(XTrain = Train$x[-s,], YTrain = Train$y[-s], #XVal = Train$x[s,], YVal = Train$y[s], XTest = Test$x, d = 2, #B1 = 50, B2 = 10, base = "knn", projmethod = "Haar", estmethod = "samplesplit", #k = seq(1,13, by = 2), clustertype = "Fork", cores = 1) #alphahatSS <- RPalpha(RP.out = OutSS, Y = Train$y[s], p1 = phat) #ClassSS <- RPEnsembleClass(RP.out = OutSS, n.val = 25, n.test = 100, #p1 = phat, samplesplit = TRUE, alpha = alphahatSS) #mean(ClassSS != Test$y) The users favourite classifier Description User defined code to convert existing R code for classification to the correct format Usage Other.classifier(x, grouping, xTest, CV, ...) Arguments x An n by p matrix containing the training dataset grouping A vector of length n containing the training data classes xTest An n.test by p test dataset CV If TRUE perform cross-validation (or otherwise) to classify training set. If FALSE , classify test set. ... Optional arguments e.g. tuning parameters Details User editable code for your choice of base classifier. Value class a vector of classes of the training or test set 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 A rotation matrix Description The 100 by 100 rotation matrix used in Model 2 in Cannings and Samworth (2017). Usage data(R) Format A 100 by 100 rotation matrix References Cannings, T. I. and Samworth, R. J. (2017) Random-projection ensemble classification, J. Roy. Statist. Soc., Ser. B. (with discussion), 79, 959–1035 Examples data(R) head(R%*%t(R)) Chooses projection Description Chooses a the best projection from a set of size B2 based on a test error estimate, then classifies the training and test sets using the chosen projection. Usage RPChoose(XTrain, YTrain, XTest, d, B2 = 10, base = "LDA", k = c(3,5), projmethod = "Haar", estmethod = "training", ...) Arguments XTrain An n by p matrix containing the training data feature vectors YTrain A vector of length n of the classes (either 1 or 2) of the training data XTest An n.test by p matrix of the test data d The lower dimension of the image space of the projections B2 The block size base The base classifier one of "knn","LDA","QDA" or "other" k The options for k if base is "knn" projmethod Either "Haar" , "Gaussian" or "axis" estmethod Method for estimating the test errors to choose the projection: either training error "training" or leave-one-out "loo" ... Optional further arguments if base = "other" Details Randomly projects the the data B2 times. Chooses the projection yielding the smallest estimate of the test error. Classifies the training set (via the same method as estmethod ) and test set using the chosen projection. Value Returns a vector of length n + n.test : the first n entries are the estimated classes of the training set, the l
section
RPEnsemble.pdf
CRAN · 0.5 · Documentation · application/pdf · 116,280 · 2026-05-07
Title
RPEnsemble.pdf
Label
RPEnsemble.pdf

Reference for RPEnsemble (0.5)

10개 topic
Other.classifier
The users favourite classifier
CRAN · 0.5 · RPEnsemble/man/Other.classifier.Rd · 2026-05-07

User defined code to convert existing R code for classification to the correct format

Aliases
Other.classifier
Usage
Other.classifier(x, grouping, xTest, CV, ...)
Arguments
x
An n by p matrix containing the training dataset
grouping
A vector of length n containing the training data classes
xTest
An n.test by p test dataset
CV
If TRUE perform cross-validation (or otherwise) to classify training set. If FALSE, classify test set.
Optional arguments e.g. tuning parameters
Details
User editable code for your choice of base classifier.
Value
classa vector of classes of the training or test set
Author
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
R
A rotation matrix
CRAN · 0.5 · data · RPEnsemble/man/R.Rd · 2026-05-07

The 100 by 100 rotation matrix used in Model 2 in Cannings and Samworth (2017).

Aliases
R
Usage
data(R)
Format
A 100 by 100 rotation matrix
Examples
data(R) head(R%*%t(R))
References
Cannings, T. I. and Samworth, R. J. (2017) Random-projection ensemble classification, J. Roy. Statist. Soc., Ser. B. (with discussion), 79, 959--1035
RPChoose
Chooses projection
CRAN · 0.5 · RPEnsemble/man/RPChoose.Rd · 2026-05-07

Chooses a the best projection from a set of size B2 based on a test error estimate, then classifies the training and test sets using the chosen projection.

Aliases
RPChoose
Usage
RPChoose(XTrain, YTrain, XTest, d, B2 = 10, base = "LDA", k = c(3,5), projmethod = "Haar", estmethod = "training", ...)
Arguments
XTrain
An n by p matrix containing the training data feature vectors
YTrain
A vector of length n of the classes (either 1 or 2) of the training data
XTest
An n.test by p matrix of the test data
d
The lower dimension of the image space of the projections
B2
The block size
base
The base classifier one of "knn","LDA","QDA" or "other"
k
The options for k if base is "knn"
projmethod
Either "Haar", "Gaussian" or "axis"
estmethod
Method for estimating the test errors to choose the projection: either training error "training" or leave-one-out "loo"
Optional further arguments if base = "other"
Details
Randomly projects the the data B2 times. Chooses the projection yielding the smallest estimate of the test error. Classifies the training set (via the same method as estmethod) and test set using the chosen projection.
Value
Returns a vector of length n + n.test: the first n entries are the estimated classes of the training set, the last n.test are the estimated classes of the test set.
Examples
set.seed(100) Train <- RPModel(1, 50, 100, 0.5) Test <- RPModel(1, 100, 100, 0.5) Choose.out5 <- RPChoose(XTrain = Train$x, YTrain = Train$y, XTest = Test$x, d = 2, B2 = 5, base = "QDA", projmethod = "Haar", estmethod = "loo") Choose.out10 <- RPChoose(XTrain = Train$x, YTrain = Train$y, XTest = Test$x, d = 2, B2 = 10, base = "QDA", projmethod = "Haar", estmethod = "loo") sum(Choose.out5[1:50] != Train$y) sum(Choose.out10[1:50] != Train$y) sum(Choose.out5[51:150] != Test$y) sum(Choose.out10[51:150] != Test$y)
See also
RPParallel, RPChooseSS, lda, qda, knn
Note
Resubstitution method unsuitable for the k-nearest neighbour classifier.
Author
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
RPChooseSS
A sample splitting version of RPChoose
CRAN · 0.5 · RPEnsemble/man/RPChooseSS.Rd · 2026-05-07

Chooses the best projection based on an estimate of the test error of the classifier with training data (XTrain, YTrain), the estimation method counts the number of errors made on the validation set (XVal, YVal).

Aliases
RPChooseSS
Usage
RPChooseSS(XTrain, YTrain, XVal, YVal, XTest, d, B2 = 100, base = "LDA", k = c(3, 5), projmethod = "Haar", ...)
Arguments
XTrain
An n by p matrix containing the training data feature vectors
YTrain
A vector of length n of the classes (either 1 or 2) of the training data
XVal
An n.val by p matrix containing the validation data feature vectors
YVal
A vector of length n.val of the classes (either 1 or 2) of the validation data
XTest
An n.test by p matrix of the test data feature vectors
d
The lower dimension of the image space of the projections
B2
The block size
base
The base classifier one of "knn","LDA","QDA" or "other"
k
The options for k if base = "knn"
projmethod
Either "Haar", "Gaussian" or "axis"
Optional further arguments if base = "other"
Details
Maps the the data using B2 random projections. For each projection the validation set is classified using the the training set and the projection yielding the smallest number of errors over the validation set is retained. The validation set and test set are then classified using the chosen projection.
Value
Returns a vector of length n.val + n.test: the first n.val entries are the estimated classes of the validation set, the last n.test are the estimated classes of the test set.
Examples
set.seed(100) Train <- RPModel(1, 50, 100, 0.5) Validate <- RPModel(1, 50, 100, 0.5) Test <- RPModel(1, 100, 100, 0.5) Choose.out5 <- RPChooseSS(XTrain = Train$x, YTrain = Train$y, XVal = Validate$x, YVal = Validate$y, XTest = Test$x, d = 2, B2 = 5, base = "QDA", projmethod = "Haar") Choose.out10 <- RPChooseSS(XTrain = Train$x, YTrain = Train$y, XVal = Validate$x, YVal = Validate$y, XTest = Test$x, d = 2, B2 = 10, base = "QDA", projmethod = "Haar") sum(Choose.out5[1:50] != Validate$y) sum(Choose.out10[1:50] != Validate$y) sum(Choose.out5[51:150] != Test$y) sum(Choose.out10[51:150] != Test$y)
See also
RPParallel, RPChoose, lda, qda, knn
Author
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
RPEnsemble-package
Random Projection Ensemble Classification
CRAN · 0.5 · package · RPEnsemble/man/RPEnsemble-package.Rd · 2026-05-07

Implements the methodology of Cannings and Samworth (2017). The random projection ensemble classifier is a very general method for classification of high-dimensional data, based on careful combination of the results of applying an arbitrary base classifier to random projections of the feature vectors into a lower-dimensional space. The random projections are divided into non-overlapping blocks, and within each block the projection yielding the smallest estimate of the test error is selected. The random projection ensemble classifier then aggregates the results of applying the base classifier on the selected projections, with a data-driven voting threshold to determine the final assignment.

Aliases
RPEnsemble-packageRPEnsemble
Details
RPChoose chooses the projection from a block of size B2 that minimises an estimate of the test error (see Cannings and Samworth, 2017, Section 3), and classifies the training and test sets using the base classifier on the projected data. RPParallel makes many calls to RPChoose in parallel. RPalpha chooses the best empirical value of alpha (see Cannings and Samworth, 2017, Section 5.1). RPEnsembleClass combines the results of many base classifications to classify the test set. The method can be used with any base classifier, any test error estimate and any distribution of the random projections. This package provides code for the following options: Classifiers -- linear discriminant analysis, quadratic discriminant analysis and the k-nearest neighbour classifier. Error estimates -- resubstitution and leave-one-out, we also provide code for the sample-splitting method described in Cannings and Samworth (2017, Section 7) (this can be done by setting estmethod = samplesplit). Projection distribution -- Haar, Gaussian or axis-aligned projections. The package provides the option to add your own base classifier and estimation method, this can be done by editing the code in the function Other.classifier. Moreover, one could edit the RPGenerate function to generate projections from different distributions.
Examples
#generate data from Model 1 set.seed(101) Train <- RPModel(2, 50, 100, 0.5) Test <- RPModel(2, 100, 100, 0.5) #Classify the training and test set for B1 = 10 independent projections, each #one carefully chosen from a block of size B2 = 10, using the "knn" base #classifier and the leave-one-out test error estimate Out <- RPParallel(XTrain = Train$x, YTrain = Train$y, XTest = Test$x, d = 2, B1 = 10, B2 = 10, base = "knn", projmethod = "Haar", estmethod = "loo", splitsample = FALSE, k = seq(1, 25, by = 3), clustertype = "Default") #estimate the class 1 prior probability phat <- sum(Train$y == 1)/50 #choose the best empirical value of the voting threshold alpha alphahat <- RPalpha(RP.out = Out, Y = Train$y, p1 = phat) #combine the base classifications Class <- RPEnsembleClass(RP.out = Out, n = 50, n.test = 100, p1 = phat, alpha = alphahat) #calculate the error mean(Class != Test$y) #Code for sample splitting version of the above #n.val <- 25 #s <- sample(1:50,25) #OutSS <- RPParallel(XTrain = Train$x[-s,], YTrain = Train$y[-s], #XVal = Train$x[s,], YVal = Train$y[s], XTest = Test$x, d = 2, #B1 = 50, B2 = 10, base = "knn", projmethod = "Haar", estmethod = "samplesplit", #k = seq(1,13, by = 2), clustertype = "Fork", cores = 1) #alphahatSS <- RPalpha(RP.out = OutSS, Y = Train$y[s], p1 = phat) #ClassSS <- RPEnsembleClass(RP.out = OutSS, n.val = 25, n.test = 100, #p1 = phat, samplesplit = TRUE, alpha = alphahatSS) #mean(ClassSS != Test$y)
Author
Timothy I. Cannings and Richard J. Samworth Maintainer: Timothy I. Cannings <timothy.cannings@ed.ac.uk>
References
Cannings, T. I. and Samworth, R. J. (2017) Random-projection ensemble classification, J. Roy. Statist. Soc., Ser. B. (with discussion), 79, 959--1035
RPEnsembleClass
Classifies the test set using the random projection ensemble classifier
CRAN · 0.5 · RPEnsemble/man/RPEnsembleClass.Rd · 2026-05-07

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

Aliases
RPEnsembleClass
Usage
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).
Examples
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)
See also
RPParallel, RPalpha, RPChoose
Author
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
RPGenerate
Generates random matrices
CRAN · 0.5 · RPEnsemble/man/RPGenerate.Rd · 2026-05-07

Generates B2 random p by d matrices according to Haar measure, Gaussian or axis-aligned projections

Aliases
RPGenerate
Usage
RPGenerate(p = 100, d = 10, method = "Haar", B2 = 10)
Arguments
p
The original data dimension
d
The lower dimension
method
Projection distribution, either "Haar" for Haar distributed projections, "Gaussian" for Gaussian distributed projections with i.i.d. N(0,1/p) entries, "axis" for uniformly distributed axis aligned projections, or "other" for user defined method
B2
the number of projections
Value
returns B2 p by d random matrices as a single p by d*B2 matrix
Examples
R1 <- RPGenerate(p = 20, d = 2, "Haar", B2 = 3) t(R1)%*%R1 R2 <- RPGenerate(p = 20, d = 2, "Gaussian", B2 = 3) t(R2)%*%R2 R3 <- RPGenerate(p = 20, d = 2, "axis", B2 = 3) colSums(R3) rowSums(R3)
Author
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
RPModel
Generate pairs (x,y) from joint distribution
CRAN · 0.5 · RPEnsemble/man/RPModel.Rd · 2026-05-07

Generates data from the models described in Cannings and Samworth (2017)

Aliases
RPModel
Usage
RPModel(Model.No, n, p, Pi = 1/2)
Arguments
Model.No
Model Number
n
Sample size
p
Data dimension
Pi
Class one prior probability
Value
xAn n by p data matrix -- n observations of the p-dimensional features yA vector of length n containing the classes (either 1 or 2)
Examples
Data <- RPModel(Model.No = 1, 100, 100, Pi = 1/2) table(Data$y) colMeans(Data$x[Data$y==1,]) colMeans(Data$x[Data$y==2,])
Note
Models 1 and 2 require p = 100 or 1000.
Author
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
RPParallel
Chooses a projection from each block in parallel
CRAN · 0.5 · RPEnsemble/man/RPParallel.Rd · 2026-05-07

Makes B1 calls to RPChoose or RPChooseSS in parallel and returns the results as a matrix.

Aliases
RPParallel
Usage
RPParallel(XTrain, YTrain, XVal, YVal, XTest, d, B1 = 500, B2 = 50, base = "LDA",projmethod = "Gaussian", estmethod = "training", k = c(3,5,9), clustertype = "Default", cores = 1, machines = NULL, seed = 1, ... )
Arguments
XTrain
An n by p matrix containing the training data feature vectors
YTrain
A vector of length n containing the classes (either 1 or 2) of the training data
XVal
An n.val by p matrix containing the validation data feature vectors
YVal
A vector of length n.val of the classes (either 1 or 2) of the validation data
XTest
An n.test by p matrix containing the test data feature vectors
d
The lower dimension of the image space of the projections
B1
The number of blocks
B2
The size of each block
base
The base classifier one of "knn","LDA","QDA" or "other"
k
The options for k if base is "knn"
projmethod
"Haar", "Gaussian" or "axis"
estmethod
Method for estimating the test errors to choose the projection: either training error "training", leave-one-out "loo", or sample split "samplesplit"
clustertype
The type of cluster: "Default" uses just one core, "Fork" uses a single machine, "Socket" uses many machines. Note "Fork" and "Socket" are not supported on windows.
cores
Required only if clustertype==Fork: the number of computer cores to use (note: cores > 1 not supported on Windows)
machines
Required only if clustertype==Socket: the names of the machines to use e.g. c("Computer1", "Computer2") (not supported on Windows)
seed
If not NULL, sets random seed for reproducible results
Optional further arguments if base = "other"
Details
Makes B1 calls to RPChoose or RPChooseSS in parallel.
Value
If estmethod == "training" or "loo" , then returns an n+n.test by B1 matrix, each row containing the result of a call to RPChoose. If estmethod == "samplesplit", then returns an n.val+n.test by B1 matrix, each row containing the result of a call to RPChooseSS.
Examples
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 = 10, B2 = 10, base = "LDA", projmethod = "Haar", estmethod = "training") colMeans(Out)
See also
RPChoose, RPChooseSS
Author
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
RPalpha
Choose alpha
CRAN · 0.5 · RPEnsemble/man/RPalpha.Rd · 2026-05-07

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

Aliases
RPalpha
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
Details
See precise details in Cannings and Samworth (2015, Section 5.1).
Value
alphaThe value of alpha that minimises the empirical error
Examples
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 = 10, B2 = 10, base = "LDA", projmethod = "Haar", estmethod = "training", cores = 1) alpha <- RPalpha(RP.out = Out, Y = Train$y, p1 = sum(Train$y == 1)/length(Train$y)) alpha
See also
RPParallel
Author
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

버전 이력

RepositoryVersionPublishedFirst seenLast seenDocs
CRAN0.52026-05-292026-05-30

보안

표시할 OSV 데이터가 없습니다.

문헌 신호

표시할 OpenAlex 데이터가 없습니다.