predict.forest: Predict method for random decision forest classifier fits

Description Usage Arguments Examples

View source: R/predict.forest.r

Description

Predict method for random decision forest classifier fits

Usage

1
2
## S4 method for signature 'forest'
predict(object, newdata, type, decision_threshold, ...)

Arguments

object

Object of class inheriting from "forest-class".

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.

Examples

 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)

bert9bert/ParallelForest documentation built on Feb. 29, 2020, 2:34 p.m.