Description Usage Arguments Value Examples
Predict with a drf forest
1 2 3 4 5 6 7 8 9 10 |
object |
The trained drf forest. |
newdata |
Points at which predictions should be made. If NULL, makes out-of-bag predictions on the training set instead (i.e., provides predictions at Xi using only trees that did not use the i-th training example). Note that this matrix (or vector) should have the number of columns as the training matrix, and that the columns must appear in the same order. |
transformation |
a function giving a transformation of the responses, by default if NULL, the identity |
functional |
which type of statistical functional. One option between:
|
num.threads |
Number of threads used in training. If set to NULL, the software automatically selects an appropriate amount. |
custom.functional |
a function giving the custom functional when |
... |
additional parameters. |
a list containing an entry with the same name as the functional selected.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # Train a distributional random forest with CART splitting rule.
n <- 100
p <- 2
X <- matrix(rnorm(n * p), n, p)
Y <- X + matrix(rnorm(n * p), ncol=p)
drf.forest <- drf(X = X, Y = Y)
# Predict conditional correlation.
X.test <- matrix(0, 101, p)
X.test[, 1] <- seq(-2, 2, length.out = 101)
cor.pred <- predict(drf.forest, X.test, functional = "cor")
# Predict on out-of-bag training samples.
cor.oob.pred <- predict(drf.forest, functional = "cor")
# Train a distributional random forest with "FourierMMD" splitting rule.
n <- 100
p <- 2
X <- matrix(rnorm(n * p), n, p)
Y <- X + matrix(rnorm(n * p), ncol=p)
drf.forest <- drf(X = X, Y = Y, splitting.rule = "FourierMMD", num.features = 10)
# Predict conditional correlation.
X.test <- matrix(0, 101, p)
X.test[, 1] <- seq(-2, 2, length.out = 101)
cor.pred <- predict(drf.forest, X.test, functional = "cor")
# Predict on out-of-bag training samples.
cor.oob.pred <- predict(drf.forest, functional = "cor")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.