-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify specification of aesthetics in vip()
#80
Comments
What if - rather than do a hard backward compatibility break with branch issue-79-80 we do deprecation warning? This would require us to retain more code since we'd have to still allow aesthetics as they were stated in current versions plus allow the new aesthetics option but it wouldn't force a hard version break. Just an option if we're worried about ticking off early adopters of the package with a hard version break. |
Seems reasonable. It’ll take a bit of code but I’ll work on it! |
@bradleyboehmke got it. The old approach should still work, but with a warning that these features will be removed in the next planned version. Example: # Load required packages
library(ggplot2) # for `aes_string()` function
# Load the sample data
data(mtcars)
# Fit a linear regression model
model <- lm(mpg ~ ., data = mtcars)
# Construct variable importance plots
p1 <- vip(model)
p2 <- vip(model, mapping = aes_string(color = "Sign"))
p3 <- vip(model, geom = "point")
p4 <- vip(model, geom = "point", mapping = aes_string(color = "Variable"),
aesthetics = list(size = 3))
grid.arrange(p1, p2, p3, p4, nrow = 2)
# Make sure old approach still works, albeit with a warning
vip(model, bar = FALSE)
vip(model, bar = FALSE, color = "red")
vip(model, bar = TRUE, color = "red", fill = "green")
vip(model, bar = TRUE, color = "red", fill = "green", width = 1/3) |
Try to break it if you can and I'll merge when we're happy with it. |
The updates look good. Not sure if you realize or not but the i.e.: vip(model, type = "dotplot") # old
vip(rf_model, type = "impurity", geom = "point") # new |
Oops, forgot to mention. I renamed the new |
For example,
instead of
The text was updated successfully, but these errors were encountered: