Description Usage Arguments Examples
View source: R/predict.forest.r
Predict method for random decision forest classifier fits
1 2 |
object |
Object of class inheriting from |
newdata |
A data frame in which to look for variables with which to predict. |
type |
Set to "response" to return predictions as probabilities. Set to "binary_0_1" to apply the decision rule threshold to return predictions as 0s and 1s (default). |
decision_threshold |
If type="binary_0_1", then predicted probabilities above this threshold will be returned as 1, otherwise returned as 0. Default is 0.5 (majority rules). |
... |
further arguments passed to or from other methods. |
1 2 3 4 5 6 7 8 9 10 11 12 | data(easy_2var_data)
fforest = grow.forest(Y~X1+X2, data=easy_2var_data,
min_node_obs=5, max_depth=10,
numsamps=90, numvars=1, numboots=5)
xnew = data.frame(
X1 = c(0.06, 0.05, 0.05, 0.01, 0.09, 0.05, 0.05,-1000, 1000),
X2 = c(0.03, 0.02, 0.05, 0.03, 0.04,-1000, 1000, 0.04, 0.03)
)
fforest_ynewhat = predict(fforest, xnew)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.