Show Cluster Colour on xgb.plot.importance

Hi.. I am trying to plot the relative importance from my XGBoost result. However, my result plot does not show the cluster/cluster colour of each variable. How can I make the culster colour show up in the plot?

#view variable importance plot

mat <- xgb.importance(feature_names = colnames(training_set), model = xgb1)
xgb.plot.importance(importance_matrix = mat[1:20], xlab = "Relative importance") 

What happens if you try this?

xgb.ggplot.importance(importance_matrix = mat[1:20], xlab = "Relative importance")

It will just populate a regular bar chart, where all bar have the same colour. I am hoping that different cluster will have different colour.

Amazing! xgb.ggplot.importance(importance_matrix = mat[1:20], xlab = "Relative importance") works!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.