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

After I draw the image using the following methods, I want to change the name of the x-axis and y-axis separately.What should I do? #87

Open
Weidong725 opened this issue Jul 13, 2023 · 1 comment

Comments

@Weidong725
Copy link

Weidong725 commented Jul 13, 2023

plot = pdp.PDPIsolate(model=model,df=tree_temp,model_features=X.columns
                    ,feature='UrbanCPI',feature_name='UrbanCPI',n_classes=0,num_grid_points=10)
fig, axes= plot.plot(
    ncols=2,
    engine='plotly',
    template='plotly_white',
    center=False,# True为纵坐标显示原目标值-均值后的结果
    frac_to_plot=100,
    plot_params={
        "pdp_hl": True
        ,"title": {"title": {"text": ''},"subtitle": {"text": ''},}
        ,"xlabel":45
                },
    plot_pts_dist=True,
    to_bins=True,
)
@SauceCat
Copy link
Owner

SauceCat commented Aug 1, 2023

Check this example: https://github.com/SauceCat/PDPbox/blob/master/tutorials/pdpbox_binary_classification.ipynb
You can achieve this through fig.update_layout if you use plotly as the plot engine, otherwise you can do sth like this: _ = axes['bar_axes'][0].set_xticklabels(['Female', 'Male']) for matplotlib axes

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