Workflow-class: Class "Workflow"

Description Objects from the Class Slots Methods Author(s) References See Also Examples

Description

Objects of the class Workflow represent a solution to a predictive task that typically involve learning a prediction model using the given training data and then applying it to the provided test set. Still, a workflow function may carry out many more steps (e.g. special data pre-processing steps, or some form of post-processing of the predictions, etc.)

Objects from the Class

Objects can be created by calls of the form Workflow( ...). This constructor function can generate 3 types of workflows: i) standard workflows; ii) time series standard workflows; and iii) user-defined workflows. The wf parameter of the constructor controls which type of workflow is created. If the value of this parameter is "standardWF" or absent and no parameter type is included, then a workflow of type i) is created. If the value of wf is "timeseriesWF" or absent but the parameter type is set to either "slide" or "grow" then a workflow of type ii) is created. In all other cases a user-defined workflow is created which means that the function supplied in the parameter wf must exist and follow the input/output protocol of user-defined workflows. This protocol implies accepting a formula in the first argument, a training data frame in the second and a testing data frame in the third, with any other arguments being workflow-specific parameters. Moreover, the user-defined workflow must return a list object as result of its execution. See the Examples section for illustrations. The constructor can also be given a workflow ID in parameter wfID. Finally, the constructor also accepts a parameter deps with a valid value for the deps class slot.

Slots

name:

An optional string containing an internal name of the workflow (a kind of ID)

func:

A character string containing the name of the R function that implements the workflow.

pars:

A named list containing the parameters and respective values to be used when calling the workflow (defaulting to the empty list).

deps:

An optional named list with components "packages" and "scripts" each containing a vector of names of the required packages and scripts, respectively, for the workflow to be executable.

Methods

show

signature(object = "Workflow"): method used to show the contents of a Workflow object.

summary

signature(object = "Workflow"): method used to obtain a summary of a Workflow object.

Author(s)

Luis Torgo ltorgo@dcc.fc.up.pt

References

Torgo, L. (2014) An Infra-Structure for Performance Estimation and Experimental Comparison of Predictive Models in R. arXiv:1412.0436 [cs.MS] http://arxiv.org/abs/1412.0436

See Also

PredTask, EstimationTask, runWorkflow

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
showClass("Workflow")

## A simple standard workflow using a default svm
Workflow(learner="svm")

## Creating a standardWF 
Workflow(learner="randomForest",learner.pars=list(ntree=420),wfID="rf420")

## Another one
Workflow(learner="svm",
         pre=c("centralImp","scale"),
         post="onlyPos",
         deps=list(packages=c("e1071"),scripts=c()))

## Another one
Workflow(learner="rpart",.fullOutput=TRUE)

## A user-defined workflow
myWF <- function(form,train,test,wL=0.5,...) {
    ml <- lm(form,train)
    mr <- rpart(form,train)
    pl <- predict(ml,test)
    pr <- predict(mr,test)
    ps <- wL*pl+(1-wL)*pr
    list(trues=responseValues(form,test),preds=ps)
}

wu <- Workflow(wf="myWF",wL=0.6)

performanceEstimation documentation built on May 2, 2019, 6:01 a.m.