LoggerInbagRisk | R Documentation |
This class logs the train risk for a specific loss function.
logger_id |
( |
use_as_stopper |
( |
loss |
(LossQuadratic | LossBinomial | LossHuber | LossAbsolute | LossQuantile) |
eps_for_break |
( |
patience |
( |
S4 object.
LoggerInbagRisk$new(logger_id, use_as_stopper, loss, eps_for_break, patience)
This logger computes the risk for the training data
\mathcal{D} = \{(x^{(i)},\ y^{(i)})\ |\ i \in \{1, \dots, n\}\}
and stores it into a vector. The empirical risk \mathcal{R}_\mathrm{emp}
for
iteration m
is calculated by:
\mathcal{R}_\mathrm{emp}^{[m]} = \frac{1}{n}\sum\limits_{i = 1}^n L(y^{(i)}, \hat{f}^{[m]}(x^{(i)}))
Note:
If m=0
than \hat{f}
is just the offset.
The implementation to calculate \mathcal{R}_\mathrm{emp}^{[m]}
is done in two steps:
Calculate vector risk_temp
of losses for every observation for
given response y^{(i)}
and prediction \hat{f}^{[m]}(x^{(i)})
.
Average over risk_temp
.
This procedure ensures, that it is possible to e.g. use the AUC or any
arbitrary performance measure for risk logging. This gives just one
value for risk_temp
and therefore the average equals the loss
function. If this is just a value (like for the AUC) then the value is
returned.
This class doesn't contain public fields.
$summarizeLogger()
: () -> ()
# Used loss:
log_bin = LossBinomial$new()
# Define logger:
log_inbag_risk = LoggerInbagRisk$new("inbag", FALSE, log_bin, 0.05, 5)
# Summarize logger:
log_inbag_risk$summarizeLogger()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.