This function visualizes the risk during training. If validation data are given, then the train risk is plotted against the validation risk.

plotRisk(cboost)

Arguments

cboost

[Compboost class]
A trained Compboost object.

Value

ggplot object containing the graphic.

Examples

cboost_no_valdat = boostSplines(data = iris, target = "Sepal.Length",
  loss = LossQuadratic$new())
#>   1/100   risk = 0.31  time = 0   
#>   2/100   risk = 0.29  time = 122   
#>   4/100   risk = 0.25  time = 322   
#>   6/100   risk = 0.21  time = 971   
#>   8/100   risk = 0.18  time = 1151   
#>  10/100   risk = 0.16  time = 1317   
#>  12/100   risk = 0.14  time = 1481   
#>  14/100   risk = 0.13  time = 1676   
#>  16/100   risk = 0.11  time = 1842   
#>  18/100   risk = 0.1  time = 2006   
#>  20/100   risk = 0.095  time = 2170   
#>  22/100   risk = 0.088  time = 2333   
#>  24/100   risk = 0.083  time = 2494   
#>  26/100   risk = 0.078  time = 2655   
#>  28/100   risk = 0.074  time = 2818   
#>  30/100   risk = 0.071  time = 2999   
#>  32/100   risk = 0.069  time = 3178   
#>  34/100   risk = 0.067  time = 3345   
#>  36/100   risk = 0.065  time = 3510   
#>  38/100   risk = 0.063  time = 3675   
#>  40/100   risk = 0.062  time = 3857   
#>  42/100   risk = 0.061  time = 4017   
#>  44/100   risk = 0.06  time = 4178   
#>  46/100   risk = 0.059  time = 4358   
#>  48/100   risk = 0.058  time = 4524   
#>  50/100   risk = 0.057  time = 4692   
#>  52/100   risk = 0.056  time = 4859   
#>  54/100   risk = 0.056  time = 5027   
#>  56/100   risk = 0.055  time = 5198   
#>  58/100   risk = 0.054  time = 5365   
#>  60/100   risk = 0.054  time = 5533   
#>  62/100   risk = 0.053  time = 5941   
#>  64/100   risk = 0.052  time = 6300   
#>  66/100   risk = 0.052  time = 6479   
#>  68/100   risk = 0.051  time = 6851   
#>  70/100   risk = 0.051  time = 7237   
#>  72/100   risk = 0.051  time = 7623   
#>  74/100   risk = 0.05  time = 7950   
#>  76/100   risk = 0.05  time = 8164   
#>  78/100   risk = 0.049  time = 8532   
#>  80/100   risk = 0.049  time = 8900   
#>  82/100   risk = 0.049  time = 9284   
#>  84/100   risk = 0.048  time = 9643   
#>  86/100   risk = 0.048  time = 9834   
#>  88/100   risk = 0.048  time = 10217   
#>  90/100   risk = 0.048  time = 10654   
#>  92/100   risk = 0.047  time = 11058   
#>  94/100   risk = 0.047  time = 11484   
#>  96/100   risk = 0.047  time = 12128   
#>  98/100   risk = 0.047  time = 12317   
#> 100/100   risk = 0.046  time = 12700   
#> 
#> 
#> Train 100 iterations in 0 Seconds.
#> Final risk based on the train set: 0.046
#> 
plotRisk(cboost_no_valdat)


cboost_valdat = boostSplines(data = iris, target = "Sepal.Length",
  loss = LossQuadratic$new(), oob_fraction = 0.3)
#>   1/100   risk = 0.31  oob_risk = 0.31   time = 0   
#>   2/100   risk = 0.29  oob_risk = 0.29   time = 125   
#>   4/100   risk = 0.24  oob_risk = 0.25   time = 270   
#>   6/100   risk = 0.21  oob_risk = 0.22   time = 417   
#>   8/100   risk = 0.18  oob_risk = 0.2   time = 552   
#>  10/100   risk = 0.16  oob_risk = 0.18   time = 687   
#>  12/100   risk = 0.14  oob_risk = 0.17   time = 823   
#>  14/100   risk = 0.12  oob_risk = 0.15   time = 956   
#>  16/100   risk = 0.11  oob_risk = 0.14   time = 1095   
#>  18/100   risk = 0.098  oob_risk = 0.14   time = 1233   
#>  20/100   risk = 0.089  oob_risk = 0.13   time = 1367   
#>  22/100   risk = 0.082  oob_risk = 0.12   time = 1500   
#>  24/100   risk = 0.077  oob_risk = 0.12   time = 1658   
#>  26/100   risk = 0.072  oob_risk = 0.12   time = 1796   
#>  28/100   risk = 0.069  oob_risk = 0.11   time = 1932   
#>  30/100   risk = 0.066  oob_risk = 0.11   time = 2069   
#>  32/100   risk = 0.063  oob_risk = 0.11   time = 2237   
#>  34/100   risk = 0.061  oob_risk = 0.11   time = 2384   
#>  36/100   risk = 0.059  oob_risk = 0.11   time = 2550   
#>  38/100   risk = 0.058  oob_risk = 0.11   time = 2696   
#>  40/100   risk = 0.056  oob_risk = 0.11   time = 2844   
#>  42/100   risk = 0.055  oob_risk = 0.1   time = 2987   
#>  44/100   risk = 0.054  oob_risk = 0.1   time = 3129   
#>  46/100   risk = 0.053  oob_risk = 0.1   time = 3269   
#>  48/100   risk = 0.052  oob_risk = 0.1   time = 3410   
#>  50/100   risk = 0.051  oob_risk = 0.1   time = 3549   
#>  52/100   risk = 0.05  oob_risk = 0.1   time = 3688   
#>  54/100   risk = 0.049  oob_risk = 0.1   time = 3826   
#>  56/100   risk = 0.048  oob_risk = 0.1   time = 3966   
#>  58/100   risk = 0.047  oob_risk = 0.1   time = 4107   
#>  60/100   risk = 0.047  oob_risk = 0.1   time = 4248   
#>  62/100   risk = 0.046  oob_risk = 0.1   time = 4390   
#>  64/100   risk = 0.046  oob_risk = 0.1   time = 4532   
#>  66/100   risk = 0.045  oob_risk = 0.1   time = 4688   
#>  68/100   risk = 0.045  oob_risk = 0.1   time = 4839   
#>  70/100   risk = 0.044  oob_risk = 0.1   time = 4983   
#>  72/100   risk = 0.044  oob_risk = 0.1   time = 5128   
#>  74/100   risk = 0.043  oob_risk = 0.099   time = 5274   
#>  76/100   risk = 0.043  oob_risk = 0.099   time = 5420   
#>  78/100   risk = 0.043  oob_risk = 0.099   time = 5562   
#>  80/100   risk = 0.042  oob_risk = 0.099   time = 5725   
#>  82/100   risk = 0.042  oob_risk = 0.099   time = 5869   
#>  84/100   risk = 0.042  oob_risk = 0.099   time = 6011   
#>  86/100   risk = 0.042  oob_risk = 0.099   time = 6153   
#>  88/100   risk = 0.041  oob_risk = 0.099   time = 6293   
#>  90/100   risk = 0.041  oob_risk = 0.099   time = 6435   
#>  92/100   risk = 0.041  oob_risk = 0.099   time = 6575   
#>  94/100   risk = 0.041  oob_risk = 0.099   time = 6716   
#>  96/100   risk = 0.04  oob_risk = 0.099   time = 6855   
#>  98/100   risk = 0.04  oob_risk = 0.099   time = 6996   
#> 100/100   risk = 0.04  oob_risk = 0.098   time = 7138   
#> 
#> 
#> Train 100 iterations in 0 Seconds.
#> Final risk based on the train set: 0.04
#> 
plotRisk(cboost_valdat)
#> Warning: Removed 1 row(s) containing missing values (geom_path).