R XGBOOST:无法翻转轴';重要特征图
我试图翻转轴,使R XGBOOST:无法翻转轴';重要特征图,r,ggplot2,xgboost,R,Ggplot2,Xgboost,我试图翻转轴,使功能位于X轴上。下面的代码告诉我一个错误,系统覆盖了轴' >gplt = xgb.ggplot.importance (importance_matrix = xgb.importance(model =model_xgb) , top_n = 10 , n_clusters = 1 ) +theme(legend.position = "none" , text
功能位于X轴上。下面的代码告诉我一个错误,系统覆盖了轴'
>gplt = xgb.ggplot.importance (importance_matrix = xgb.importance(model =model_xgb) , top_n = 10 , n_clusters = 1 )
+theme(legend.position = "none" , text = element_text(size = 20))
>gplt +coord_flip()
#[OUTPUT]:
Coordinate system already present. Adding new coordinate system, which will replace the existing one.
如果查看xgb.ggplot.importance
的代码,您会发现它包含对coord\u flip
的调用,调用两次不会改变任何东西。为了得到你想要的,你可以这样做
gplt + coord_cartesian()
您仍将看到该消息,但您的轴应翻转