class_prob_rf: Get Class Prediction Probabilities

Description Usage Arguments Value

View source: R/class_prob_rf.R

Description

This function takes a regression randomForest and returns class probabilities for a provided classifcation. These probabilities are based on a full, new dataset. If using the dataset used to build the random forest these are not out of bag estimates. The predicted classes that are output are directly from the random forest object, thus they are predictions resulting from the out of bag esimates.

Usage

1
2
3
4
5
6
7
8
class_prob_rf(
  rf_obj,
  newdata,
  breaks,
  labels,
  ordered = FALSE,
  type = c("probs", "votes")
)

Arguments

rf_obj

a randomForest object of type regression

newdata

data frame used to make predictions. Can be same as original data.

breaks

a numeric vector of values used to turn predictions into classes

labels

a character vector of labels for the classes

ordered

logical indicating if categories are ordered (in order specified in labels)

type

a character vector indicating whether total votes or probabilites should be returned

Value

returns a dataframe of probabilites or number of votes for each class


USEPA/LakeTrophicModelling documentation built on Oct. 15, 2020, 4:13 p.m.