embed icon indicating copy to clipboard operation
embed copied to clipboard

Use of Weights and offset for models

Open naveranoc opened this issue 3 years ago • 2 comments

In insurance, the use of weights is very important, it could be important that these steps also include the use of these steps for when categories are joined.

naveranoc avatar Feb 17 '22 16:02 naveranoc

You can read more about case weights and our plan to implement them.

juliasilge avatar Feb 17 '22 19:02 juliasilge

Hello @juliasilge, thank you very much for your answer, but I have a couple of doubts, for example, if we used a poisson regression model, in which it had an exposure variable (EXPO) (Proportion of the time in which an observation was under observation), I could not use this variable as a weight within the regression model or within a regression tree, it should enter as an offset to the model, despite the fact that I mark it within tidymodels with the role of case_weight. How would the pre-processes work in this case, for example step_discretize_cart?, would he use the poisson loss function, or would he use anova?.

Sorry for the long message, and I appreciate your help

naveranoc avatar Feb 18 '22 15:02 naveranoc

The appropiate steps now support case-weights, as the example step_discretize_cart() lists its support here: https://embed.tidymodels.org/reference/step_discretize_cart.html#case-weights

You can read more about case weights are used in tidymodels here:

  • https://recipes.tidymodels.org/reference/case_weights.html
  • https://www.tidyverse.org/blog/2022/05/case-weights/
  • https://www.tidyverse.org/blog/2022/07/tidymodels-2022-q2/

EmilHvitfeldt avatar Mar 07 '23 21:03 EmilHvitfeldt

This issue 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[bot] avatar Mar 22 '23 01:03 github-actions[bot]