Extract Row-wise Subset of a Result Object
sub_result.Rd
This function extracts a row-wise subset of a classification or regression result object.
Arguments
- x
The input result object, which should be an instance of a classification or regression result class.
- indices
A vector of row indices to extract from the result object.
See also
Other sub_result:
sub_result.binary_classification_result()
,
sub_result.multiway_classification_result()
Examples
# Create a simple classification result object
observed <- c(1, 0, 1, 1, 0)
predicted <- c(1, 0, 0, 1, 1)
result <- list(observed = observed, predicted = predicted)
class(result) <- c("classification_result", "list")
# Extract a subset of the result object
sub_result(result, c(2, 3, 4))
#> Error in UseMethod("sub_result"): no applicable method for 'sub_result' applied to an object of class "c('classification_result', 'list')"