predict.lumberYard: Predict function for lumberYard objects

Description Usage Arguments

Description

A generic predict method has been implemented for lumberYard objects. Several types of prediction are available. See params for details.

Usage

1
2
## S3 method for class 'lumberYard'
predict(x, newdata, i = NULL, type = "Terminal")

Arguments

x

a lumberYard object

newdata

a dataset for which predictions are to be returned. Should have the same columns and order as the dataset used to train the model.

i

an optional numeric vector indicating a subset of nodeIDs to predict

type

several forms of prediction are provided:

  1. 'Terminal' - Used to predict the terminal node values.

  2. 'All' - Returns a matrix of 0s and 1s consisting of node membership. Note that all of the nodes are returned including internal ones.

  3. 'IDs' - Rather than the terminal node prediction, return the terminal node ID. Can be used to create different prediction values than those stored by the decistion tree model object used to create the lumberYard.

  4. 'Nodes' - When passed i, returns binary membership for only those requested nodes.


Zelazny7/timbr documentation built on May 10, 2019, 1:57 a.m.