subset_correction: Subset Correction of a predicted result

Description Usage Arguments Details Value Note References See Also Examples

View source: R/threshold.R

Description

This method restrict a multi-label learner to predict only label combinations whose existence is present in the (training) data. To this all labelsets that are predicted but are not found on training data is replaced by the most similar labelset.

Usage

1
subset_correction(mlresult, train_y, probability = FALSE)

Arguments

mlresult

An object of mlresult that contain the scores and bipartition values.

train_y

A matrix/data.frame with all labels values of the training dataset or a mldr train dataset.

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)

Details

If the most similar is not unique, those label combinations with higher frequency in the training data are preferred. The Hamming loss distance is used to determine the difference between the labelsets.

Value

A new mlresult where all results are present in the training labelsets.

Note

The original paper describes a method to create only bipartitions result, but we adapted the method to change the scores. Based on the base.threshold value the scores higher than the threshold value, but must be lower are changed to respect this restriction. If NULL this correction will be ignored.

References

Senge, R., Coz, J. J. del, & Hullermeier, E. (2013). Rectifying classifier chains for multi-label classification. In Workshop of Lernen, Wissen & Adaptivitat (LWA 2013) (pp. 162-169). Bamberg, Germany.

See Also

Other threshold: fixed_threshold(), lcard_threshold(), mcut_threshold(), pcut_threshold(), rcut_threshold(), scut_threshold()

Examples

1
2
prediction <- predict(br(toyml, "RANDOM"), toyml)
subset_correction(prediction, toyml)

Example output

Loading required package: mldr
    y1 y2 y3 y4 y5
1    0  0  0  1  1
2    1  0  0  0  1
3    0  1  0  1  1
4    1  1  0  0  1
5    0  1  0  0  0
6    0  0  0  0  1
7    0  0  0  1  1
8    0  1  0  0  1
9    0  0  1  1  0
10   0  0  1  1  1
11   1  1  0  0  0
12   0  1  0  0  0
13   0  1  0  1  1
14   1  1  0  1  0
15   0  0  1  1  0
16   0  1  0  0  0
17   0  1  0  1  0
18   0  0  0  1  0
19   0  1  0  0  1
20   0  0  0  0  1
21   1  0  0  0  1
22   0  0  1  1  1
23   1  1  0  0  1
24   1  1  1  1  1
25   1  1  1  1  0
26   0  0  0  1  1
27   0  0  0  0  1
28   0  1  1  1  1
29   0  1  0  0  0
30   1  1  1  0  0
31   1  1  0  1  0
32   0  0  1  1  1
33   0  1  1  0  0
34   1  1  0  1  0
35   1  0  1  1  1
36   1  0  0  0  1
37   0  1  0  0  0
38   0  0  1  0  0
39   0  1  0  1  0
40   0  0  1  1  1
41   0  1  1  1  0
42   0  0  0  1  1
43   1  0  1  0  0
44   1  1  0  1  0
45   0  0  0  0  1
46   0  0  0  1  1
47   0  0  0  1  1
48   1  0  0  1  1
49   1  1  1  0  0
50   0  0  0  1  0
51   1  0  0  0  1
52   1  1  0  0  0
53   0  0  1  1  1
54   0  1  0  0  0
55   0  1  1  1  0
56   0  0  1  1  0
57   0  1  1  1  0
58   0  0  1  0  0
59   0  0  0  1  1
60   0  0  1  0  1
61   1  1  1  0  0
62   1  1  0  1  0
63   0  1  1  1  1
64   1  1  0  1  0
65   0  1  1  1  1
66   0  0  0  0  1
67   0  1  0  1  1
68   0  1  1  0  0
69   1  0  1  1  1
70   0  0  1  1  0
71   1  1  0  0  0
72   1  1  0  1  1
73   0  0  0  0  1
74   0  1  1  1  0
75   0  0  0  1  1
76   1  1  1  0  0
77   0  1  1  0  0
78   0  0  0  1  1
79   0  1  1  1  0
80   1  0  1  1  1
81   1  1  0  0  1
82   1  1  0  0  1
83   0  0  0  0  1
84   0  0  0  1  1
85   0  0  0  1  1
86   0  0  0  0  1
87   1  1  0  0  0
88   1  0  0  1  0
89   1  1  0  1  0
90   0  1  0  1  1
91   1  1  0  0  1
92   1  1  0  1  0
93   0  1  0  0  0
94   1  1  0  0  0
95   1  1  0  0  1
96   1  0  0  1  0
97   0  1  0  0  1
98   1  1  0  0  1
99   0  0  1  1  1
100  0  1  0  0  1

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