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

support mlr3 #13

Open
simonpcouch opened this issue Jul 12, 2022 · 3 comments
Open

support mlr3 #13

simonpcouch opened this issue Jul 12, 2022 · 3 comments
Labels
feature a feature request or enhancement

Comments

@simonpcouch
Copy link
Collaborator

Some work on the mlr3 branch already.

@simonpcouch
Copy link
Collaborator Author

After spending more time with this, I think our best approach here will to wait for more machinery from mlr3 folks before implementing anything more principled. Prediction in a new session works fine, so this shouldn't be a pain point!

library(mlr3)

task <- tsk("mtcars")
fit <- lrn("regr.rpart")
  
# train a model of this learner for a subset of the task
fit$train(task, row_ids = 1:26)

callr::r(
  function(fit) {
    library(mlr3)
    
    predict(fit, mtcars[27:32,])
  },
  args = list(fit = fit)
)
#> [1] 27.71429 16.87368 16.87368 16.87368 16.87368 16.87368

Created on 2022-07-18 by the reprex package (v2.0.1)

@simonpcouch
Copy link
Collaborator Author

Look for the fitted model object slot, these should wrap like caret or parsnip.

@sebffischer
Copy link

I have started a discussion in mlr3 about serialization here: mlr-org/mlr3#891
If we implement something like this, adding a bundle method for mlr3 Learners should be straightforward! :)

@juliasilge juliasilge added the feature a feature request or enhancement label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants