report icon indicating copy to clipboard operation
report copied to clipboard

Reporting on tidymodels

Open mbac opened this issue 5 years ago • 9 comments

Question and context

Hi,

I've been using a tidymodels approach to perform a logistic regression. The glm model is stored in various objects, including the top-level workflow. This has some extractor functions which return a model (e.g.: pull_workflow_spec()), but report says it can't work with it. The workflow-model's class() is [_glm, model_fit].

Is there a way to use report directly on a tidymodels- (or parsnip-) generated model?

Thanks!

mbac avatar Jan 29 '21 16:01 mbac

Not sure how others see this, but for me personally the tidymodels framework is of rather low priority. Currently, there's no explicit support for tidymodels, however, this might change quite quickly.

strengejacke avatar Jan 29 '21 20:01 strengejacke

@mbac supporting tidymodels in report would require adding its support in the other easystats packages, i.e., insight, parameters, performance and effectsize, which is not the case currently.

That said, this is something we will probably want to add (as our goal is to have quite an extensive coverage of the R ecosystem) at some point, though I cannot give you any timeline ☺️ Stay tuned, though! I will open an issue on insight to track the progress as it would be the first step.

DominiqueMakowski avatar Jan 31 '21 01:01 DominiqueMakowski

tidymodels is now supported in insight, parameters and performance.

strengejacke avatar Mar 29 '21 06:03 strengejacke

Thank you very much for taking care of this!

mbac avatar Mar 30 '21 20:03 mbac

@mattansb is it much effort to implement in effectsize?

strengejacke avatar Mar 30 '21 22:03 strengejacke

No idea. Aren't most tidymodels' models non-parametric? (I have never used tidymodels before, only caret).

Anyway, if someone can open an issue over at effectsize with some examples, I can start working on these when I get beck next week (:

mattansb avatar Mar 31 '21 07:03 mattansb

tidymodels returns an object of class model_fit, where object$fit is the actual model object. So you generally could do this:

foo.model_fit <- function(x, ...) {
  foo(x$fit, ...)
}

strengejacke avatar Mar 31 '21 07:03 strengejacke

tidymodels is just a more complicated way of fitting models in R. ;-)

strengejacke avatar Mar 31 '21 07:03 strengejacke

It seems recently that tidymodels is almost mature, and its fitted model or workflow can provide a unified interface. Really looking forward to seeing report fully support tidymodels.

CWen001 avatar Aug 23 '22 15:08 CWen001