Skip to content
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

Add ability to change x and y labels plot_predict_interaction #6

Closed
OliverFishCode opened this issue Feb 4, 2019 · 2 comments
Closed

Comments

@OliverFishCode
Copy link

It would be nice to be able to change x and y labels like you can with the title

@OliverFishCode OliverFishCode changed the title ability to change x and y labels Add ability to change x and y labels plot_predict_interaction Feb 4, 2019
@Yue-Jiang
Copy link
Collaborator

I'm not sure adding it as an option to the function is a general use case. However since plot_predict_interaction returns a ggplot object, you can update the labels on top of it:

library(randomForestExplainer)
library(randomForest)
library(ggplot2)
data(Boston, package = "MASS")
Boston$chas <- as.logical(Boston$chas)
set.seed(2017)
forest <- randomForest(medv ~ ., data = Boston, localImp = TRUE)
p <- plot_predict_interaction(forest, Boston, "rm", "lstat")
p + labs("my custom x lab", "my custom y lab")

image

@Yue-Jiang
Copy link
Collaborator

Closing because an example has been provided above to modify labels post figure generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants