Description Usage Arguments Value References Examples
This function computes a classifier based on a canonical correlation forest. It expects its input in matrix form or as formula notation.
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, ...)
|
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 |
... |
Further arguments passed to or from other methods. |
projectionBootstrap |
Use projection bootstrapping. (default |
returns an object of class "canonical_correlation_forest", where an object of this class is a list containing the following components:
x,yThe original input data
y_encodedThe encoded y
variable in case of classification tasks.
foresta vector of length ntree with objects of class
canonical_correlation_tree
.
Rainforth, T., and Wood, F. (2015): Canonical correlation forest, arXiv preprint, arXiv:1507.05444, https://arxiv.org/pdf/1507.05444.pdf.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.