tree_imp: a data.table returned by lgb.importance.
top_n: maximal number of top features to include into the plot.
measure: the name of importance measure to plot, can be "Gain", "Cover" or "Frequency".
left_margin: (base R barplot) allows to adjust the left margin size to fit feature names.
cex: (base R barplot) passed as cex.names parameter to barplot. Set a number smaller than 1.0 to make the bar labels smaller than R's default and values greater than 1.0 to make them larger.
Returns
The lgb.plot.importance function creates a barplot
and silently returns a processed data.table with top_n features sorted by defined importance.
Details
The graph represents each feature as a horizontal bar of length proportional to the defined importance of a feature. Features are shown ranked in a decreasing importance order.