# lcard_threshold: Threshold based on cardinality In utiml: Utilities for Multi-Label Learning

## Description

Find and apply the best threshold based on cardinality of training set. The threshold is choice based on how much the average observed label cardinality is close to the average predicted label cardinality.

## Usage

 ```1 2 3 4 5 6 7``` ```lcard_threshold(prediction, cardinality, probability = FALSE) ## Default S3 method: lcard_threshold(prediction, cardinality, probability = FALSE) ## S3 method for class 'mlresult' lcard_threshold(prediction, cardinality, probability = FALSE) ```

## Arguments

 `prediction` A matrix or mlresult. `cardinality` A real value of training dataset label cardinality, used to define the threshold value. `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: `FALSE`)

## Value

A mlresult object.

## Methods (by class)

• `default`: Cardinality Threshold for matrix or data.frame

• `mlresult`: Cardinality Threshold for mlresult

## References

Read, J., Pfahringer, B., Holmes, G., & Frank, E. (2011). Classifier chains for multi-label classification. Machine Learning, 85(3), 333-359.

Other threshold: `fixed_threshold()`, `mcut_threshold()`, `pcut_threshold()`, `rcut_threshold()`, `scut_threshold()`, `subset_correction()`

## Examples

 ```1 2``` ```prediction <- matrix(runif(16), ncol = 4) lcard_threshold(prediction, 2.1) ```

### Example output

```Loading required package: mldr
[,1] [,2] [,3] [,4]
[1,]    0    0    1    1
[2,]    1    0    1    1
[3,]    1    0    0    0
[4,]    0    1    0    1
```

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