as.mlresult {utiml} | R Documentation |
Convert a matrix prediction in a multi label prediction
Description
Convert a matrix prediction in a multi label prediction
Usage
as.mlresult(predictions, probability = TRUE, ...)
## Default S3 method:
as.mlresult(predictions, probability = TRUE, ..., threshold = 0.5)
## S3 method for class 'mlresult'
as.mlresult(predictions, probability = TRUE, ...)
Arguments
predictions |
a Matrix or data.frame contained the scores/probabilities values. The columns are the labels and the rows are the examples. |
probability |
A logical value. If |
... |
ignored |
threshold |
A single value between 0 and 1 or a list with threshold values contained one value per label (Default: 0.5). Only used when the predictions are not a mlresult. |
Value
An object of type mlresult
Methods (by class)
-
default
: Default mlresult transform method -
mlresult
: change the mlresult type
Examples
predictions <- matrix(runif(100), ncol = 10)
colnames(predictions) <- paste('label', 1:10, sep='')
# Create a mlresult from a matrix
mlresult <- as.mlresult(predictions)
mlresult <- as.mlresult(predictions, probability = FALSE)
mlresult <- as.mlresult(predictions, probability = FALSE, threshold = 0.6)
# Change the current type of a mlresult
mlresult <- as.mlresult(mlresult, probability = TRUE)
[Package utiml version 0.1.7 Index]