View source: R/objective_function.R
loss_calculate | R Documentation |
Compute the loss between predictive and actual values using a selected objective function. Supported objecive functions used in this functions are: "SMAPE', "MAPE", "RMSE", and "MAE".
loss_calculate(preds, actuals, objective)
preds |
A numeric vector of predicted values. |
actuals |
A numeric vector of actual (true) values. |
objective |
A string character that indicates the loss function type: "SMAPE", "MAPE", "RMSE", or "MAE". |
A numeric value that represent the computed loss.
preds <- c(80, 120, 180)
actuals <- c(95, 115, 177)
loss_calculate(preds, actuals, "RMSE")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.