Learn R Programming

utiml (version 0.1.4)

as.mlresult: 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, ...)

# S3 method for default as.mlresult(predictions, probability = TRUE, ..., threshold = 0.5)

# S3 method for 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 TRUE the predicted values are the score between 0 and 1, otherwise the values are bipartition 0 or 1. (Default: TRUE)

...

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab