parsnip icon indicating copy to clipboard operation
parsnip copied to clipboard

`autoplot` methods for model fits

Open simonpcouch opened this issue 2 years ago • 1 comments

See https://github.com/mine-cetinkaya-rundel/stat2-whole-game/issues/2 for more discussion.

General idea: plot.lm ish methods, using ggplot2 fundamentals, for some of parsnip's bread and butter model specs would be nice.

simonpcouch avatar May 12 '22 16:05 simonpcouch

I have been thinking about this lately, more specifically in the context of plotting tree based methods. As a example {rpart.plot} can handle plotting for rpart engine trees, and you might be able to convert other trees, but it would be nice to have a general interface for parsnip objects. I started horus for this purpose a while back but never gave it too much polish/care. Plus it got derailed VERY quickly to create charts for teaching slides

library(parsnip)

tree_spec <- decision_tree(mode = "regression")

tree_fit <- fit(tree_spec, mpg ~ ., data = mtcars)

autoplot(tree_fit)
viz_tree(tree_fit)

EmilHvitfeldt avatar May 12 '22 18:05 EmilHvitfeldt