Description Usage Arguments Value Examples
Predict allows for O(N) prediction based on an object of class rotationForest where N is the length of the dataframe dependent array.
1 2 3 |
rotationForestObject |
an object of class rotationForest (returned from the constructor rotationForest(...)) |
dependent |
a data frame of the X predictor values |
prob |
A logical indicating whether probabilities of existing in each class are returned (as opposed to the default predictions) |
A vector of predictions (or a table of probabilities) of the different classes
1 2 3 4 5 6 7 8 9 10 11 | fpath <- system.file("extdata", "balance-scale.data", package="rotationForest")
data <- read.table(fpath, sep = ",", header = FALSE)
data.dependent <- data[,-1]
data.response <- data[,1]
data.response <- as.factor(data.response)
total <- data.frame(data.response, data.dependent)
groups <- sample(rep(1:10, times = ceiling(nrow(total) / 19)), size = nrow(total), replace = TRUE)
data.train <- total[!groups %in% 1,]
data.test <- total[groups %in% 1,]
fit <- rotationForest(data.train[,-1], data.train[,1], 2, 10)
predict <- predict(fit, data.dependent, prob = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.