butcher icon indicating copy to clipboard operation
butcher copied to clipboard

butcher method for models fitted with brglm2

Open tkx68 opened this issue 8 months ago • 1 comments

The brglm2 fitting functions adds some more stuff and it would be nice to have a butcher method like the following:

butcher.brglmFit <- function(object, ...) {
  object <- NextMethod()   # ruft butcher.glm() aus {butcher}

  # -------------------------------------------------------
  # brglm2-spezifische Anhängsel löschen
  if (keep == "predict") {
    object$call <- NULL
    object$family$d1afun <- NULL
    object$family$d2afun <- NULL
    object$family$d3afun <- NULL
    object$family$d1variance <- NULL
    object$family$d2mu.deta <- NULL
  }
  object
}

tkx68 avatar Apr 30 '25 07:04 tkx68

Would you be interested in contributing a PR with the butcher methods for this model? You can check out the documentation we have on how to add a model to butcher here: https://butcher.tidymodels.org/articles/adding-models-to-butcher.html

juliasilge avatar May 01 '25 17:05 juliasilge