model_seq: model_seq class

Description Usage Arguments Value Examples

View source: R/model_list_class.R

Description

A class for (ordered) lists of models

Usage

 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
model_seq(...)

## S4 method for signature 'model_seq,DatasetExperiment'
model_train(M, D)

## S4 method for signature 'model_seq,DatasetExperiment'
model_predict(M, D)

## S4 method for signature 'model_seq,ANY,ANY,ANY'
x[i]

## S4 replacement method for signature 'model_seq,ANY,ANY,ANY'
x[i] <- value

## S4 method for signature 'model_seq'
models(ML)

## S4 replacement method for signature 'model_seq,list'
models(ML) <- value

## S4 method for signature 'model_seq'
length(x)

## S4 method for signature 'model,model_seq'
e1 + e2

## S4 method for signature 'model_seq,model'
e1 + e2

## S4 method for signature 'model,model'
e1 + e2

## S4 method for signature 'model_seq'
predicted(M)

## S4 method for signature 'model_seq,DatasetExperiment'
model_apply(M, D)

Arguments

...

named slots and their values.

M

a model object

D

a dataset object

x

a model_seq object

i

index

value

value

ML

a model_seq object

e1

a model or model_seq object

e2

a model or model_seq object

Value

model sequence

model sequence

model at the given index in the sequence

model sequence with the model at index i replaced

a list of models in the sequence

a model sequence containing the input models

the number of models in the sequence

a model sequence with the additional model appended to the front of the sequence

a model sequence with the additional model appended to the end of the sequence

a model sequence

the predicted output of the last model in the sequence

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
MS = model_seq()
MS = model() + model()
MS = example_model() + example_model()
MS = model_train(MS,DatasetExperiment())
D = DatasetExperiment()
MS = example_model() + example_model()
MS = model_train(MS,D)
MS = model_predict(MS,D)
MS = model() + model()
MS[2]

MS = model() + model()
MS[3] = model()

MS = model() + model()
L = models(MS)

MS = model_seq()
L = list(model(),model())
models(MS) = L

MS = model() + model()
length(MS) # 2

MS = model() + model()
M = model()
MS = M + MS

MS = model() + model()
M = model()
MS = MS + M

MS = model() + model()

D = DatasetExperiment()
M = example_model()
M = model_train(M,D)
M = model_predict(M,D)
p = predicted(M)
D = DatasetExperiment()
MS = example_model() + example_model()
MS = model_apply(MS,D)

struct documentation built on Nov. 8, 2020, 8:14 p.m.