Skip to contents

This function visualizes the feature importance as horizontal bar plot.

Usage

plotFeatureImportance(cboost, num_feats = NULL, aggregate = TRUE)

Arguments

cboost

(Compboost)
A trained Compboost object.

num_feats

(integer(1L))
Number of features that are visualized. All features are added if set to NULL.

aggregate

(logical(1L))
Flag whether the feature importance is aggregated by feature. Otherwise it is visualized per base learner.

Value

ggplot object containing the graphic.

Examples

cboost = boostSplines(data = iris, target = "Sepal.Length", loss = LossQuadratic$new())
#>   1/100   risk = 0.31  time = 0   
#>   2/100   risk = 0.29  time = 134   
#>   4/100   risk = 0.25  time = 363   
#>   6/100   risk = 0.21  time = 534   
#>   8/100   risk = 0.18  time = 696   
#>  10/100   risk = 0.16  time = 854   
#>  12/100   risk = 0.14  time = 1002   
#>  14/100   risk = 0.13  time = 1148   
#>  16/100   risk = 0.11  time = 1292   
#>  18/100   risk = 0.1  time = 1453   
#>  20/100   risk = 0.095  time = 1603   
#>  22/100   risk = 0.088  time = 1749   
#>  24/100   risk = 0.083  time = 1893   
#>  26/100   risk = 0.078  time = 2096   
#>  28/100   risk = 0.074  time = 2250   
#>  30/100   risk = 0.071  time = 2398   
#>  32/100   risk = 0.069  time = 2544   
#>  34/100   risk = 0.067  time = 2707   
#>  36/100   risk = 0.065  time = 2852   
#>  38/100   risk = 0.063  time = 2995   
#>  40/100   risk = 0.062  time = 3142   
#>  42/100   risk = 0.061  time = 3293   
#>  44/100   risk = 0.06  time = 3448   
#>  46/100   risk = 0.059  time = 3599   
#>  48/100   risk = 0.058  time = 3744   
#>  50/100   risk = 0.057  time = 3891   
#>  52/100   risk = 0.056  time = 4038   
#>  54/100   risk = 0.056  time = 4184   
#>  56/100   risk = 0.055  time = 4329   
#>  58/100   risk = 0.054  time = 4476   
#>  60/100   risk = 0.054  time = 4620   
#>  62/100   risk = 0.053  time = 4853   
#>  64/100   risk = 0.052  time = 5044   
#>  66/100   risk = 0.052  time = 5235   
#>  68/100   risk = 0.051  time = 5410   
#>  70/100   risk = 0.051  time = 5581   
#>  72/100   risk = 0.051  time = 5760   
#>  74/100   risk = 0.05  time = 5958   
#>  76/100   risk = 0.05  time = 6129   
#>  78/100   risk = 0.049  time = 6277   
#>  80/100   risk = 0.049  time = 6429   
#>  82/100   risk = 0.049  time = 6591   
#>  84/100   risk = 0.048  time = 6741   
#>  86/100   risk = 0.048  time = 6994   
#>  88/100   risk = 0.048  time = 7181   
#>  90/100   risk = 0.048  time = 7360   
#>  92/100   risk = 0.047  time = 7534   
#>  94/100   risk = 0.047  time = 7709   
#>  96/100   risk = 0.047  time = 7882   
#>  98/100   risk = 0.047  time = 8057   
#> 100/100   risk = 0.046  time = 8240   
#> 
#> 
#> Train 100 iterations in 0 Seconds.
#> Final risk based on the train set: 0.046
#> 
plotFeatureImportance(cboost)

plotFeatureImportance(cboost, num_feats = 2)

plotFeatureImportance(cboost, num_feats = 2, aggregate = FALSE)