Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RandomForest-class

Class "RandomForest"


Description

A class for representing random forest ensembles.

Objects from the Class

Objects can be created by calls of the form new("RandomForest", ...).

Slots

ensemble:

Object of class "list", each element being an object of class "BinaryTree".

data:

an object of class "ModelEnv".

initweights:

a vector of initial weights.

weights:

a list of weights defining the sub-samples.

where:

a matrix of integers vectors of length n (number of observations in the learning sample) giving the number of the terminal node the corresponding observations is element of (in each tree).

data:

an object of class "ModelEnv".

responses:

an object of class "VariableFrame" storing the values of the response variable(s).

cond_distr_response:

a function computing the conditional distribution of the response.

predict_response:

a function for computing predictions.

prediction_weights:

a function for extracting weights from terminal nodes.

get_where:

a function for determining the number of terminal nodes observations fall into.

update:

a function for updating weights.

Methods

treeresponse

signature(object = "RandomForest"): ...

weights

signature(object = "RandomForest"): ...

where

signature(object = "RandomForest"): ...

Examples

set.seed(290875)

    ### honest (i.e., out-of-bag) cross-classification of 
    ### true vs. predicted classes
    data("mammoexp", package = "TH.data")
    table(mammoexp$ME, predict(cforest(ME ~ ., data = mammoexp, 
                               control = cforest_unbiased(ntree = 50)), 
                               OOB = TRUE))

party

A Laboratory for Recursive Partytioning

v1.3-10
GPL-2
Authors
Torsten Hothorn [aut, cre] (<https://orcid.org/0000-0001-8301-0471>), Kurt Hornik [aut], Carolin Strobl [aut], Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>)
Initial release
2022-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.