Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encapsulate train and predict of PipeOps #541

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

encapsulate train and predict of PipeOps #541

wants to merge 5 commits into from

Conversation

sumny
Copy link
Sponsor Member

@sumny sumny commented Nov 6, 2020

encapsulate train and predict of PipeOps.
Adding active bindings:

  • timings
  • log
  • warnings
  • errors
  • encapsulate

and private .encapsulate like Learners have (by default, a Learner's encapsulate is propagated to the PipeOp (if relevant) e.g. in case of PipeOpLearnerCV, PipeOpLearner and as_pipeop.Learner, ...).

A Graph is not encapsulated but naturally it's PipeOps are.

GraphLearners are (already) naturally encapsulated because they are Learners. Additionally they gain the timings_pipeops active binding (closes #536).

Illustration of a GraphLearner timing_pipeops:

task = tsk("iris")
gl = GraphLearner$new(po("scale") %>>% lrn("classif.rpart"))
gl$train(task)
gl$timings
  train predict 
   0.21      NA

gl$timings_pipeops
$train
        scale classif.rpart 
        0.036         0.030 

$predict
        scale classif.rpart 
           NA            NA

Could also add an entry for the time of the glue code e.g., here 0.21 - 0.036 - 0.030 = 0.144

#FIXME: need the following from mlr3 exported:
mlr3:::assert_ro_binding
mlr3:::get_private
mlr3:::append_log
mlr3:::get_log_condition

…ors, warnings, add timings_pipeops to GraphLearner, update docs, fix tests, add tests, fix dictionary
@sumny sumny added Status: Needs Discussion We still need to think about what the solution should look like and removed Status: Completed Status: Review Needed labels Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Status: Needs Discussion We still need to think about what the solution should look like
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store timings for each pipeline step
1 participant