compute_error {sglOptim} | R Documentation

## Helper function for computing error rates

### Description

This function can be used to compute mean error rates. It is consist with the use cases of the `Err` genetic function. The loss function should be of the form `function(x, y)` and must return a single numeric number, with x a list of true responses and y a list of responses (one list element for each sample).

### Usage

    compute_error(x, response_name, true_response, loss,
      transposed_response = FALSE)

### Arguments

`x` | sgl object containing responses
`response_name` | the name of the response.
`true_response` | the true response
`loss` | the loss function.
`transposed_response` | have the response list been transposed with `transpose_response_elements`

### Value

a vector or matrrix with the computed error rates

### Author(s)

Martin Vincent

[Package sglOptim version 1.3.8 Index]