as.mlresult: Convert a matrix prediction in a multi label prediction

Description Usage Arguments Value Methods (by class) Examples

View source: R/mlresult.R

Description

Convert a matrix prediction in a multi label prediction

Usage

1
2
3
4
5
6
7
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 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)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

Example output

Loading required package: mldr
Loading required package: parallel
Loading required package: ROCR
Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

utiml documentation built on May 31, 2021, 9:09 a.m.