predict-methods: Predicting new observations using an ensemble

Description Usage Arguments Examples

Description

Initially, the predictions of the base models are collected. Then, the predictions of the loss to be incurred by the base models E_hat (estimated by their associate meta models) are computed. The weights of the base models are then estimated according to E_hat and the committee of top models. The committee is built according to the lambda and omega parameters. Finally, the predictions are combined according to the weights and the committee setup.

Usage

1
2
3
4
5
6
7
8
## S4 method for signature 'ADE'
predict(object, newdata)

## S4 method for signature 'DETS'
predict(object, newdata)

## S4 method for signature 'base_ensemble'
predict(object, newdata)

Arguments

object

an object of class ADE-class;

newdata

new data to predict

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
###### Predicting with an ADE ensemble

specs <- model_specs(
 learner = c("bm_glm", "bm_mars"),
 learner_pars = NULL
)

data("water_consumption")
dataset <- embed_timeseries(water_consumption, 5)
train <- dataset[1:1000, ]
test <- dataset[1001:1500, ]

model <- ADE(target ~., train, specs)

preds <- predict(model, test)


## Not run: 

###### Predicting with a DETS ensemble

specs <- model_specs(
 learner = c("bm_svr", "bm_glm", "bm_mars"),
 learner_pars = NULL
)

data("water_consumption")
dataset <- embed_timeseries(water_consumption, 5)
train <- dataset[1:700, ]
test <- dataset[701:1000, ]

model <- DETS(target ~., train, specs, lambda = 50, omega = .2)

preds <- predict(model, test)

## End(Not run)


## Not run: 
###### Predicting with a base ensemble

model <- ADE(target ~., train, specs)

basepreds <- predict(model@base_ensemble, test)

## End(Not run)

tsensembler documentation built on Oct. 27, 2020, 5:07 p.m.