| msr_torch | R Documentation |
Short form for constructing a MeasureTorch.
See the Custom Learning Problems article for how to create and use such measures.
msr_torch(
id,
fun,
minimize = NA,
range = c(-Inf, Inf),
predict_type = "response",
properties = character(),
label = NA_character_,
obs_loss = NULL
)
id |
( |
fun |
( |
minimize |
( |
range |
( |
predict_type |
( |
properties |
( |
label |
( |
obs_loss |
( |
MeasureTorch
m = msr_torch("hamming", function(truth, response) mean(as.matrix(truth) != response))
m$properties
# with a per-observation loss
m = msr_torch("mse", function(truth, response) mean((truth - response)^2),
obs_loss = function(truth, response) (truth - response)^2)
m$properties
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.