Skip to content

Conversation

simonpcouch
Copy link
Contributor

@simonpcouch simonpcouch commented Mar 20, 2023

We're now good to go on the worst-case overhead of fit(), though this step in predict() introduces the last big slowdown causing the overhead in evaluation time in the causal estimate bootstrapping example. as_tibble() takes a bit of time, but the deprecation warning in map_dfr() especially slows us down.

With main dev:

library(tidymodels)

lr <- fit(logistic_reg(), Class ~ ., two_class_dat)

bench::mark(
  old = predict(lr, two_class_dat, type = "prob")
)
#> # A tibble: 1 × 6
#>   expression      min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 old          3.01ms   3.12ms      305.    3.62MB     6.27

With this PR:

#> # A tibble: 1 × 6
#>   expression      min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 new          1.32ms   1.35ms      729.   92.92KB     8.26

Created on 2023-03-20 with reprex v2.0.2

Copy link
Member

@hfrick hfrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏇

@simonpcouch simonpcouch merged commit dfa7d9a into main Mar 21, 2023
@simonpcouch simonpcouch deleted the format_classprobs branch March 21, 2023 18:33
@github-actions
Copy link

github-actions bot commented Apr 5, 2023

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants