Skip to contents

The object consists of 3 slots

Constructor for the S4 Forecaster object.

Usage

Forecaster(id, forecaster, selector)

Arguments

id

object identifier, must be equivalent to the id of the associated Trainer. If learning method is one of the supported by renoir, the constructor will automatically select forecaster and selector if they are missing.

forecaster

(optional) function used to compute predictions. Used if id is not one of the supported by renoir. If forecaster is provided it must conform to the renoir common interface, and must have the following formal arguments:

object

a model for which prediction is desired. It is a Trained object as returned by the training process, where the fit is stored in the fit slot

newx

the new values at which prediction are to be made

type

the type of prediction required

newoffset

if an offset was used in the fit then one must be provided

...

additional arguments affecting the predictions produced

selector

(optional) helper function to select the appropriate prediction type given the response type and an accuracy measure If provided it must return a prediction type supported by forecaster and must have the following formal arguments:

resp.type

the response type

type.measure

the accuracy type measure, used to internally select the correct prediction type

Value

An object of class Forecaster.

Slots

id

the object identifier, it must be equivalent to the learning method name (i.e. the trainer id)

forecaster

function to use to compute predictions. It must have the following formal arguments:

object

a model for which prediction is desired. It is a Trained object as returned by the training process, where the fit is stored in the fit slot

newx

the new values at which prediction are to be made

type

the type of prediction required

newoffset

if an offset was used in the fit then one must be provided

...

additional arguments affecting the predictions produced

selector

helper function to select the appropriate prediction type given the response type and an accuracy measure It must have the following formal arguments:

learning.method

the learning method, used to internally select the correct prediction type

type.measure

the accuracy type measure, used to internally select the correct prediction type

Author

Alessandro Barberis