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

Measure "time_train" does currently not take the time for the fallback learner into account #1161

Open
sebffischer opened this issue Sep 3, 2024 · 0 comments

Comments

@sebffischer
Copy link
Sponsor Member

Below, we conduct a resample experiment where a fallback learner is triggered.

If we afterwards evaluate the train time via a measure, we only get the time of the primary learner (which failed), but not the time needed to train the fallback learner.

library(mlr3verse)
#> Loading required package: mlr3

l = lrn("classif.debug", error_train = 1, fallback = lrn("classif.rpart"), encapsulate = c(train = "callr"))

rr = resample(tsk("iris"), l, rsmp("holdout"))
#> INFO  [13:51:45.307] [mlr3] Applying learner 'classif.debug' on task 'iris' (iter 1/1)
#> ERROR [13:51:45.997] [mlr3] train: Error from classif.debug->train()

rr$aggregate(msr("time_train"))
#> time_train 
#>      0.652
rr$learners[[1L]]$state$train_time
#> elapsed 
#>   0.652
rr$learners[[1L]]$state$fallback_state$train_time
#> [1] 0.005

Created on 2024-09-03 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant