mlr3 icon indicating copy to clipboard operation
mlr3 copied to clipboard

Save only selected edges in graph learner

Open MislavSag opened this issue 2 years ago • 4 comments

When we banchmark graph learnes, we can choose to save models or backends or not to save:

  store_models = FALSE,
  store_backends = TRUE,

Is it possible to save only some step in the graph but discard others? For example, if I want to save only features selected in the filter phase, I don't want to save all other steps.

It comes to my mind, I can add saveRRD function somewhere in the pipeline, but maybe you can request some other way?

MislavSag avatar Sep 26 '23 09:09 MislavSag

I don't think that this is currently possible. One way to achieve this would be to allow running callbacks in the workhorse function (that runs train and predict). There you could then arbitrarily discard parts of the model. What do you think @mllg?

sebffischer avatar Oct 11 '23 13:10 sebffischer

I have add readRDS in my custom pipeline, but I was pretty sure this was not the right way. Also in that way, it was hard to add some metadata (cv, fold, taks etc).

Can you send a link where I can read more on callbacks?

MislavSag avatar Oct 11 '23 13:10 MislavSag

So currently it is not yet possible to solve your issue with callbacks and I am waiting for feedback whether we want to enable this here.

We already have the mechanism in place in other areas though, you can read about it here: https://mlr3misc.mlr-org.com/reference/Callback.html

sebffischer avatar Oct 11 '23 14:10 sebffischer

Sorry for transferring twice. I thought this might be an mlr3pipelines issue, but upon thinking about this, what you really want is something like a store_models = function() option that selects the things you want to keep.

mb706 avatar Nov 09 '23 09:11 mb706