ccf: Canonical correlation forest

Description Usage Arguments Value References Examples

Description

This function computes a classifier based on a canonical correlation forest. It expects its input in matrix form or as formula notation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
canonical_correlation_forest(x, y = NULL, ntree = 200, verbose = FALSE,
  ...)

## Default S3 method:
canonical_correlation_forest(x, y = NULL, ntree = 200,
  verbose = FALSE, projectionBootstrap = FALSE, ...)

## S3 method for class 'formula'
canonical_correlation_forest(x, y = NULL, ntree = 200,
  verbose = FALSE, ...)

Arguments

x

Numeric matrix (n * p) with n observations of p variables

y

Numeric matrix with n observations of q variables

ntree

Number of trees the forest will be composed of

verbose

Optional argument to control if additional information are printed to the output. Default is FALSE.

...

Further arguments passed to or from other methods.

projectionBootstrap

Use projection bootstrapping. (default FALSE)

Value

returns an object of class "canonical_correlation_forest", where an object of this class is a list containing the following components:

References

Rainforth, T., and Wood, F. (2015): Canonical correlation forest, arXiv preprint, arXiv:1507.05444, https://arxiv.org/pdf/1507.05444.pdf.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(spirals)

d_train <- spirals[1:1000, ]
d_test <- spirals[-(1:1000), ]

# compute classifier on training data
## variant 1: matrix input
m1 <- canonical_correlation_forest(d_train[, c("x", "y")], d_train$class, ntree = 20)
## variant 2: formula notation
m2 <- canonical_correlation_forest(class ~ ., d_train)

# compute predictive accuracy
get_missclassification_rate(m1, d_test)
get_missclassification_rate(m2, d_test)

jandob/ccf documentation built on May 18, 2019, 12:23 p.m.