Description Usage Arguments Value Class Methods Examples
Machine learning pipeline
1 |
Arbitrary number of pipeline components
if TRUE, then predict
function inverts predicted values
Pipeline
class object
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
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])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.