pipeline: Machine learning pipeline

Description Usage Arguments Value Class Methods Examples

Description

Machine learning pipeline

Usage

1
pipline(..., invert_prediction = FALSE)

Arguments

...

Arbitrary number of pipeline components

invert_prediction

if TRUE, then predict function inverts predicted values

Value

Pipeline class object

Class Methods

fit(x = NULL, y = NULL)

fit and transform each component

transform(x = NULL, y = NULL)

transform from beginning to end

predict(x = NULL, ...)

return predicted values

incr_fit(x = NULL, y = NULL)

fit incrementally each component

inv_transform(x = NULL, y = NULL)

invert transformation from end to beginning

evaluate(funcname, x = NULL, y = NULL, ...)

evaluate arbitrary function at the last component

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(123)
data(Sonar, package='mlbench')
X <- Sonar[, -ncol(Sonar)]
y <- Sonar[, ncol(Sonar)]
tr <- c(sample(1:111,75), sample(112:200,75))

p <- pipeline(pc=pca_extractor(30),
              ml=mlp_classifier(hidden_sizes=c(5, 5), num_epoch=1000))
p$fit(X[tr,], y[tr])
table(y[-tr], p$predict(X[-tr,]))
p$evaluate('accuracy', X[-tr,], y[-tr])

kota7/MLPipe documentation built on May 5, 2019, 5:53 p.m.