Next Article in Journal
Multi-Lane Traffic Load Clustering Model for Long-Span Bridge Based on Parameter Correlation
Previous Article in Journal
Hopf Quasigroup Galois Extensions and a Morita Equivalence
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

ML-k’sNN: Label Dependent k Values for Multi-Label k-Nearest Neighbor Rule

by
José M. Cuevas-Muñoz
and
Nicolás E. García-Pedrajas
*,†
Department of Computing and Numerical Analysis, University of Córdoba, 14071 Córdoba, Spain
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Mathematics 2023, 11(2), 275; https://doi.org/10.3390/math11020275
Submission received: 17 October 2022 / Revised: 6 December 2022 / Accepted: 26 December 2022 / Published: 5 January 2023

Abstract

:
Multi-label classification as a data mining task has recently attracted increasing interest from researchers. Many current data mining applications address problems with instances that belong to more than one category. These problems require the development of new, efficient methods. Multi-label k-nearest neighbors rule, ML-kNN, is among the best-performing methods for multi-label problems. Current methods use a unique k value for all labels, as in the single-label method. However, the distributions of the labels are frequently very different. In such scenarios, a unique k value for the labels might be suboptimal. In this paper, we propose a novel approach in which each label is predicted with a different value of k. Obtaining the best k for each label is stated as an optimization problem. Three different algorithms are proposed for this task, depending on which multi-label metric is the target of our optimization process. In a large set of 40 real-world multi-label problems, our approach improves the results of two different tested ML-kNN implementations.

1. Introduction

Many modern applications involve vast amounts of data that need to be classified into increasingly complex categorization schemes in which one data instance may simultaneously belong to several topics. This task is typically termed multi-label learning [1,2]. In contrast with single label classification, where each instance is associated with only one class, multi-label classification is concerned with learning from instances in which each instance can be associated with multiple labels. Many multi-label learning algorithms have been developed and applied to diverse problems: text categorization [3,4], the automatic annotation of multimedia contents [5], web mining [6], rule mining [7], cheminformatics [8], bioinformatics [9], information retrieval [10] and scientific applications [11] among others.
Examples of multi-label problems appear in almost any application field. For instance, in extracting the aspects of restaurant reviews from social network comments. In this context, the author of the text may mention none or all aspects of a preset list, such as, service, food, anecdotes, price, and ambiance. When classifying text by the topics included any text can contain one or several topics. In predicting subcellular localization of proteins [12] each protein can be localized in more than one part of the cell. In sentiment analysis a text can be classified as containing more than one sentiment at the same time [13].
The key challenge of multi-label learning is taking advantage of the correlations among labels to address the exponential growth of the label space as the number of distinct labels increases; when the number of distinct labels is q, the label space is 2 q . One of the best-performing methods in multi-label learning is the adaptation of the k-nearest neighbors for multi-label datasets, the Multi-Label k-Nearest Neighbors (ML-kNN) [14] method. There are other adaptations of k-NN based on a binary relevant approach where the base classifier is a k-NN rule [15]. Any advance in the ML-kNN method is relevant as it is able to achieve very good performance, improving the results of much more complex algorithms [16].
ML-kNN uses the k nearest neighbors of every instance to predict the a posteriori probability of each label. However, the distribution of the labels across a particular dataset are very different for each label [17]. The algorithm is less accurate when the number of labels in the training set is not balanced and when the training instances are unevenly distributed in space [18]. In those cases, using the same value of k for all labels might be a suboptimal approach. The multi-label nature of ML-kNN does not depend on using the same k for all labels, so we propose the use of a different k for each label. We name this method “Multi-Label k’s-Nearest Neighbors” (ML-k’sNN).
In ML-k’sNN, instead of using a single k value for all labels, we use a vector k = ( k 1 , k 2 , , k q ) . A method for obtaining k must be devised to derive a useful approach. We state the problem as an optimization task and propose three different algorithms. The contribution of our paper is two-fold. Firstly, we have devised a new definition of ML-kNN adapted to the use of different values of k depending on each label. Secondly, we have developed a method for obtaining the optimal value of each k for every label. In a large set of 40 problems, we compare our method with two different implementations of standard ML-kNN and achieve a significant improvement. A further experiment is carried out to compare our proposal with ten different variants of ML-kNN. We have also carried out different studies on the behavior of our proposal depending on characteristics of the datasets such as number of features, number of labels and label diversity.
Furthermore, we have combined ML-k’sNN with instance selection and showed how our proposal is able to achieve better results than standard ML-kNN with a reduction ability above 95%. Finally, we have also shown the ability of our method to be adapted to other instance-based multi-label methods, such as LAML-kNN, with very good results.
The remainder of this paper is organized as follows: Section 2 describes the existing related work; Section 3 describes our proposal in depth; Section 4 explains the experimental setup; Section 5 presents and discusses the experimental results and, finally, Section 6 summarizes the conclusions of our work.

2. Related Work

Since ML-kNN was first developed [14], several modifications and improvements have been proposed. Xu [19] proposed and adaptive method based on quadratic programming to weight the votes of the different neighbors. Wang et al. [20] proposed a locally adaptive multi-label k-nearest neighbor (LAML-kNN) method where the instances are first clustered into different groups and then each cluster is separately processed to obtain the a posteriori probabilities. Jiang et al. [18] developed a weighted modification of ML-kNN where different weights are assigned to each label according to the proportion of labels and the mutual information regarding the spatial distribution of unseen instances to training instances. The author states that this method can reduce the probability of misjudging the unseen instance’s label set. This method can easily adapted to our proposal using a different value of k for each label together with the corresponding label weight. Wang et al. [21] proposed a multi-label classification algorithm based on k-nearest neighbors and random walk. This method constructs the set of vertices from a random walk graph for k-nearest neighbor training of samples of certain test data and the edge set of correlations among the labels of the training samples. Although this method can also be adapted to our philosophy its computational cost would be too high as the original method has serious scalability problems.
Other methods have been developed to improve ML-kNN. Younes et al. [22] proposed a dependent multi-label k-nearest neighbors (DMLk-NN) algorithm to take label association into account. While predicting the relevance of a label λ l for x t , along with the label λ l , DML-kNN utilises all the other labels λ q L { λ l } of the datapoints in the neighbor of the new datapoint x t . As for the previous two methods, DML-kNN can be adapted to use label dependent k values with almost no modifications. Pakrashi and Mac Namee [23] proposed Stacked-MLkNN, which follows the stacking methodology [24].
Using a fuzzy approach, Lin and Chen [25] developed Mr.KNN (Soft Relevance for Multi-label Classification) which combines a fuzzy c-means algorithm with a voting mechanism based on the k-nearest neighbors of every sample. The method voting stage can also be adapted to our label dependent approach. Vluymans et al. [26] developed a fuzzy rough multi-label classifier, FRONEC (fuzzy rough neighborhood consensus).
On a different task, the concept of label specificity has been also applied for feature selection for multi-label datasets. Hang and Zhang [27] developed a method called Collaborative Learning of label semantIcs and deep label-specific Features (CLIF) for multi-label classification.
As showed above, one of the advantages of our proposal is that, as it modifies the basic definition of the standard ML-kNN method, it can be applied to any other implementation of the method, such as those cited above. In the experiments, we will compare standard ML-kNN and LAML-kNN. Although it could applied to other Ml-kNN methods we restrict ourselves to two implementations to avoid too repetitive experiments.

3. Multi-Label k ’s-Nearest Neighbors (ML-k’sNN)

Formally, we define a multi-label problem as follows [2]: Let T be a multi-label evaluation dataset consisting of p multi-label instances x i and their associated label set y i , where T = { ( x i , y i ) } , 1 i p , ( x i X , y i Y = { 0 , 1 } q ) with a label set L, where | L | = q . Let h be a multi-label classifier and h ( x i ) = { 0 , 1 } q be the set of labels predicted by h for the instance x i . Let f ( x i , y i ) , x i X , y i Y be a real-valued function f : X × Y R . A successful learning system would tend to output larger values from function f for the labels in y i versus those not in y i . The real-valued function f can be easily transformed to a ranking function, r a n k f ( x i , y i ) , where r a n k f is the predicted rank of label y i for instance x i . For example, if f represents the probability of every instance of being relevant, which is the case for many multi-label classifiers, r a n k f ( x i , y i ) can be obtained assigning to y i its position within the sorted values of f. h ( x i ) can be obtained from f ( x i ) when an appropriate threshold is set.
As an example if we have a problem with q = 5 , and instance x , y is composed for a sample x of a certain dimension d, x R d and y = { 0 , 1 } 5 . y = ( 01100 ) means that labels 2 and 3 are relevant for instance x and labels 1, 4 and 5 are not relevant.
Our method is based on two different ideas. First, we modify ML-kNN to use a different k l value for the prediction of l-th label. We must mention that the use of multiple values for the number of neighbors k, one per label, does not modify the computational cost of the method at testing stage as both methods, ML-kNN and ML-k’sNN, must obtain the distance of the query instance to all the prototypes. The second idea describes a way to obtain the k l values for each label l Y . The first idea is rather straightforward, the modification affects only the number of neighbors considered when obtaining the different probabilities for each label. Algorithm 1 depicts the proposed approach. Thus, once the vector of k values is obtained, the algorithm is similar to ML-kNN. We termed our method Multi-Label k’s-Nearest Neighbors (ML-k’sNN) as it uses a variety of k values instead of just one. In this way, we will never have a ML-4’sNN in the same sense that a ML-4NN, as the number of different k’s will depend on the number of labels.
As in the standard ML-kNN algorithm, P ( H 1 l ) ( P ( H O l ) ) is the prior probability of label l being relevant (irrelevant) and P ( E j l | H 1 j ) ( P ( E j l | H 0 j ) ) is the posterior probability of label l being relevant (irrelevant), N j ( x i ) is the set of neighbors of x i for label j.
Algorithm 1: ML-k’sNN: Multi-label k’s nearest neighbors algorithm.
Mathematics 11 00275 i001
Once we have defined the new algorithm, we must establish how k is obtained. In the standard ML-kNN, k is either arbitrarily fixed or obtained using cross-validation. It is evident that letting the expert to fix an a priori value of k = ( k 1 , k 2 , , k q ) for every label is unreasonable as there is not way of knowing optimal values for every label. Thus, we must design a method that establishes the best values for k i , i { 1 , , q } . We define this task as an optimization problem.
This optimization problem is defined in the following way: first, we set an interval from which the values of k will be chosen [ k min , k max ] . Then, a certain metric, m (for multi-label performance metrics refer to Zhang and Zhou [2]), is chosen to evaluate each vector of k s. Our algorithm must optimize m over all the possible values of k . As a base algorithm, we first define a single-label approach to the problem. In this algorithm, we obtain k i as the optimum value for a standard single-label k-NN algorithm used to classify only label Y i . This single-label approach is named ML-k’sNN.SL (shown in Algorithm 2). However, we must bear in mind that this algorithm does not optimize the value of metric m, as it is based on a single-label approach.   
Algorithm 2: ML-k’sNN.SL: Multi-label k’s nearest neighbors algorithm single-label approach.
Mathematics 11 00275 i002
Thus, we must devise a multi-label approach. However, when the optimization problem is addressed as a multi-label problem, the method for obtaining the vector of k s depends on the metric. For multi-label classification metrics, the prediction of whether a certain label Y l is relevant to a given instance depends only on the value of k l . Thus, we can optimize the value of every k l independently and that guarantees the optimal value. However, for label ranking, the position of a label y l for an instance x t depends on all the values of r t . In that case, we cannot obtain optimal values of k by independently searching over each label.
When we plan as optimization target a classification metric we must bear in mind is that for every instance x t , we will use the classification given by y t as defined in Algorithm 1. The result of the testing stage of the algorithm is the prediction of relevant and irrelevant labels for a test label x t , y t , and the ranking function for the query instance, h t , as defined above. This algorithm shows that y t ( l ) depends only on k l to predict whether label l is relevant, while y t ( l ) = arg max b { 0 , 1 } P ( H b l ) P ( E C t ( l ) l | H b l ) does not depend on k l . This observation means that any classification metric used for multi-label problems can be optimized by obtaining the optimal value for every k l independently. Thus, a simple way to optimize the given metric is to carry out a search for every k l separately. This method is fast and has the additional advantage of easy parallelization. The method is outlined in Algorithm 3. This method is named ML-k’sNN.ML, where ML stands for multi-label. This additional calculation of the optimal k for every label has a computational cost comparable with obtaining the optimal k for standard ML-kNN using cross-validation.   
Algorithm 3: ML-k’sNN.ML: Multi-label k’s nearest neighbors algorithm multi-label approach.
Mathematics 11 00275 i003
In several cases the performance of different values for k achieves the same value for the metric used. In such cases, we select, from among the equally best k’s, the nearest one to the best value for ML-kNN, obtained by 10-fold cross-validation.
However, if our optimization target is, or contains, a ranking metric, this procedure cannot be used. Although the prediction of every label is independent from the prediction of the rest of the labels in ML-kNN, the ranking of the labels does depend on all the obtained values. In such a case, an independent search for each k l cannot be performed. We must search for the optimal vector of k values k . In this case, we must optimize metric m for all possible vectors of k’s, k , with k i { k min , k max } . Due to the size of the search space, an exhaustive search such as the one used in ML-k’sNN.ML is not feasible.
In such complex optimization processes, evolutionary computation has proven to be a very efficient tool. We propose a simple evolutionary algorithm where each solution is codified as a vector of integer values. The fitness of every individual is obtained using the method shown in Algorithm 1. New individuals were generated using BLX- α [28] crossover and no mutation was applied. We intentionally use a very simple evolutionary method to avoid obscuring the results of our approach with the use of a very complex optimization process. This method is named ML-k’sNN.EC, where EC stands for evolutionary computation.

4. Experimental Setup

To produce a fair comparison between the standard ML-kNN algorithm and our proposal, we considered 40 datasets whose characteristics are shown in Table 1. These datasets represent a varied number of problems with different numbers of instances, features and labels. Furthermore, the label densities among the datasets are very different. The selection of the datasets was carried out with the aim of using a wide variety of problems in terms of instances, features, number of labels, label density and label cardinality. Datasets from different application fields were selected as well, such as text categorization, image classification and Bioinformatics.
The tables shows a detailed description of the characteristics of the datasets. The tables shows the number of instances of the datasets, the number of inputs, the number of labels, the label cardinality, the label density, the label diversity, the proportion of distinct labels, and MeanIR and CVIR measures [2,17]. The table also show the source of every dataset.
Regarding comparisons, we used the Wilcoxon test [34] as the main statistical test for comparing pairs of algorithms. For groups of methods, we first carry out an Iman–Davenport test to ascertain whether there are significant differences among methods. When the Iman–Davenport test rejects the null hypothesis, we can proceed with a post hoc Nemenyi test [35], which compares groups of methods.
Although there are several versions of ML-kNN [15,18,20], our proposal can be used to modify most of them. In our experiments, we used the original ML-kNN, and LAML-kNN. The source code, which was written in C and licensed under the GNU General Public License, and the datasets are freely available upon request from the authors.
For evaluating the classification performance of the different methods we used 10-fold cross-validation which is one of the most common methods in Machine Learning. k-fold cross-validation involves randomly dividing the set of observations into k groups, or folds, of approximately equal size. The first fold is treated as a validation set, and the method is fit on the remaining k 1 folds [36]. This process is repeated for each one of the k folds and the performance metrics reported are the average values over the k repetitions.
The evaluation of multi-label classification methods is more difficult because the prediction result for an instance is a set of labels, and the result can be fully correct, partially correct (with different levels of correctness) or fully incorrect [37,38,39]. The metrics can be divided into two major groups: example-based (EB) metrics and label-based (LB) metrics. The former group evaluates the learning system for each instance (example) separately and then obtains a unique measure for the average value across the test set.
There are many metrics defined in the literature [2]. Among them, we have chosen accuracy and F1 metrics to compare the results of the studied methods. The precision and recall metrics are not usually reported individually because each can always be maximized by selecting no relevant label or all labels as relevant. These two metrics are devoted to classification. We also consider three metrics used for measuring the ability of a classifier from the point of view of ranking the labels: coverage, ranking loss and average precision [2]. Finally, for label-based metric we report F1 micro averaged and F1 and macro averaged.
In the experiments, we show the results of using all of these metrics as well as the results of using a subset of them in certain cases. The use of different metrics is justified because they represent the performance of the models from different points of view.

5. Experimental Results

The first set of experiments was devoted to the comparison of ML-k’sNN and LAML-k’sNN against ML-kNN and LAML-kNN. As we stated in a previous section, we carry out a different procedure depending on whether the target metric is a classification metric or a ranking metric. The first set of experiments was carried out using classification metrics. As described above, we used accuracy, F1, the macro-averaged F1 and micro-averaged F1. Table 2, Table 3, Table 4 and Table 5 show the comparison among the different methods in terms of the Wilcoxon test. The tables show, for every experiment, the average value of the performance metric (row Mean in the table), the average Friedman’s rank (row Rank), the win/loss record of the method in the column against the method in the row (row w/l), the p-value of the Wilcoxon test (row p) and the R + / R values of the Wilcoxon test (row R + / R ). The average rank defined above is R j = 1 N i r i j the average rank for N datasets being r i j the rank of j-th algorithm on i-th dataset, where in case of ties, average ranks are assigned.
Individual results for each dataset are shown in Figure 1. This figure represents the results for every datasets of ML-kNN and ML-k’sNN. Points above the main diagonal correspond to problems where our method outperformed ML-kNN. It can be seen in the figure that almost all points indicate a better performance of ML-k’sNN. Figure 2 shows the Nemenyi test for those same metrics using a graph representation [34]. In this plot, we show the critical difference, CD. Then we show for every algorithm its average rank, R j . Two algorithms i and j can be considered significantly different if | R i R j | > C D . In order to show that information, a horizontal line connects all groups of algorithms that do not fulfill that condition and should be considered as performing equally. Iman–Davenport tests for all four metrics obtained a p-value of 0.0000.
The first metric studied was accuracy. Table 2 shows the comparison using the Wilcoxon test for the five studied methods and Figure a illustrates the Nemenyi test. The first piece of information we obtain from the Figure is that the methods are sorted from best (left hand side of the figure) to worst (right hand side) according to average ranks. This average rank is by itself a good indicator of the performance of any model. The second piece of information is given by the critical difference (CD = 0.964). If two methods’ ranks differ more than 0.964 then Nemenyi test result tells us that there are significant differences in their performance. That is the reason why the methods whose ranks are below that difference are linked with a horizontal line. Thus, according to the Nemenyi test, the single-label ML-k’sNN approach was able to significantly improve standard ML-kNN. Although it achieved a better average rank, the Nemenyi test did not find significant differences. However, the Wilcoxon test found significant differences between ML-kNN and ML-k’sNN.SL. A further study of the results showed that this approach tended to exhibit over-learning. It was the best method in terms of training performance, but its performance was worse in terms of testing accuracy. This behavior of ML-k’sNN.SL was reproduced for all the remaining metrics. ML-k’sNN.ML demonstrated better performance than ML-kNN, according to both tests. This method had a clear advantage over the standard approach, improving the results of ML-kNN for 35 of the 40 datasets. ML-k’sNN.ML and LAML-k’sNN.ML improved the two studied versions of ML-kNN.
Table 3 shows the comparison for F1 metric. For this metric, our proposed method obtained very good results. The two studied versions of ML-k’sNN based on the multi-label approach outperformed both versions of ML-kNN. The differences are significant in all cases and for both tests, Wilcoxon and Nemenyi. ML-k’sNN.SL improved the results of ML-kNN according to the Wilcoxon test, although the Nemenyi test failed to find significant differences. The improvement of LAML-k’sNN.ML with respect to LAML-kNN is remarkable.
We also carried out experiments for macro- and micro-averaged versions of the F1 metric. The results of the comparisons are shown in Table 4 and Table 5, respectively. Iman–Davenport tests for all three metrics obtained a p-value of 0.000. For these two metrics, ML-k’sNN.ML and LAML-k’sNN.ML improved the results for the standard versions ML-kNN and LAML-kNN. ML-k’sNN.SL achieved a better average rank than ML-kNN, but without significant differences, according all the tests.
Our second set of experiments was devoted to ranking metrics. The results for the tests are shown in Table 6, Table 7 and Table 8 for average precision, ranking loss and coverage, respectively. Figure 3 illustrates the results for ML-kNN and ML-k’sNN for the same three metrics. To obtain a homogeneous plot, ranking loss is represented as 1-“ranking loss” and coverage is represented as the relative coverage with respect to the optimal value. In that way, all the points above the main diagonal demonstrate the superior performance of our proposal. Nemenyi test results are shown in Figure 4.
As explained above, an evolutionary computation method was used to obtain the optimal k values when the ranking metrics needed to be optimized. The single-label version of our method, ML-k’sNN.SL, demonstrated poor performance for the three ranking metrics. This was not an unexpected result, as this method does not consider any kind of multi-label information. On the other hand, ML-k’sNN.EC achieved remarkably good performance. For all three metrics, it improved the results of the standard version, according to both the Wilcoxon and Nemenyi tests. LAML-k’sNN.EC improved the results of LAML-kNN for average precision and coverage. However, ranking loss obtained a worse average ranking, although the differences were not significant.
In order to gain a deeper understanding of our proposal, we studied the average value of the obtained k’s for all the labels. Figure 5a shows this average value when the datasets are sorted according to the number of features. The average values exhibited a tendency toward larger values for datasets with less features. It is also interesting to point out that, although the values for the different labels in ML-k’sNN.ML show a large variation, the averaged values were very similar to the best value obtained for ML-kNN through cross-validation, as it shown in the figure. ML-k’sNN.SL obtained systematically smaller values of k, due to the fact that, for its single-label approach, k = 1 was often the best value.
Both LAML-kNN and LAML-k’sNN obtained smaller values than ML-kNN and ML-k’sNN. As the former two methods work with smaller clusters, it is expected that the optimal k within each cluster would be smaller.
Figure 5b shows the same average value of k when the datasets are sorted according to the number of labels. Interestingly, ML-kNN and ML-k’sNN.ML obtained larger values when the number of labels was small or large, and lower values for the datasets with a medium number of labels.
Another interesting issue is the relative behavior of ML-k’sNN with respect to ML-kNN, depending on the characteristic of the datasets. This is always a very difficult task, as most algorithms do not show a clear trend of behavior in regard to particular characteristics of the datasets. We studied the performance of the standard method and our approach regarding the diversity of the datasets. Figure 6 shows the difference in performance using the F1 metric between ML-k’sNN and ML-kNN when the datasets are sorted in terms of increasing diversity.
The figure displays a tendency of ML-k’sNN to improve its relative performance when the diversity of the datasets increases. To obtain a clearer idea of the general trend of the differences, the figure shows a linear regression of the difference in terms of the F1 metric. Thus, linear regression has a clear upward slope. This an interesting property of our proposal, as datasets with higher diversity are usually more difficult to address. A similar study that considered the number of labels was carried out (see Figure 7). Again, our proposed method demonstrated better behavior as the number of labels increased. These two figures shows that ML-k’sNN is more effective when the multi-label problem is more difficult, i.e., when there are many labels and many diverse sets of relevant labels.

5.1. Comparison with Other Instance-Based Learning Methods

In the previous section we have shown that our algorithm was able to beat the standard ML-kNN algorithm and another version of that algorithm, LAML-kNN. However, other modifications of ML-kNN have been proposed in the literature. In this section we present a comparison with several versions of ML-kNN and other instance-based methods. We compared the best version of our proposal, ML-k’sNN.ML for classification metrics and ML-k’sNN.EC for ranking metrics, with ML-kNN, LAML-kNN, two binary relevance implementations of k-NN in scikit learn Python package [40], BRkNNa and BRkNNb, stacked ML-kNN [41] (SMLkNN), dependent ML-kNN (DMLkNN) [22], soft relevance for multi-label classification [25] (Mr.KNN), the combination of instance-based learning and logistic regression for multilabel classification, IBLR-ML and IBLR-ML+ [42], and a recent method for obtaining local k values for ML-kNN, ML-localkNN [43]. Figure 8 and Figure 9 show the Nemenyi test for classification and ranking metrics, respectively. BRkNNa and BRkNNb are not implemented for ranking metrics so they are not shown in Figure 9. The Iman–Davenport test found significant differences for all seven metrics.
The first interesting result was that, in general, none of the modifications of ML-kNN showed a consistently better performance than the original proposal with the exception of ML-localkNN and IBLRML+. The second interesting result was that our proposal always achieved the best performance in terms of the average ranking regardless of the metric considered. Nemenyi test found significant differences most of the times. These differences are specially marked for ranking metrics.
After applying the Iman–Davenport test, we carry out a Holm’s procedure [34] for controlling the family wise error in multiple hypothesis testing. In Holm’s procedure, the best-performing algorithm in terms of Friedman’s ranks is compared in a stepwise manner against the other methods. We carried out this procedure for the seven metrics. Figure 10 and Figure 11 show a graphical representation of Holm test for classification and ranking metrics, respectively. The methods are shown in increasing values of average ranks and a bar plot shows the p-value of the statistical test. A horizontal line shows the critical value of the test. Bars below this horizontal lines mean a significant difference.
In Figure 10 we can see the good performance of ML-k’sNN. For the four classification metrics it was able to significantly improve the remaining methods. For accuracy it showed a significantly better performance than 7 of the 10 methods used for the comparison. For F1, only ML-localkNN and IBLRML+ were not worse than ML-k’sNN. For F1 macro and F1 micro , ML-k’sNN beat 6 of the 10 methods. As we cannot expect any algorithm to be always the best performing one for every dataset and metric, the fact that MLk’sNN was able to obtain the overall best results for the four metrics is remarkable. Furthermore, we must take into account that most of these methods can also use our proposal to be improved.
For ranking metrics—see Figure 11—the performance of ML-k’sNN was even better. For averaged precision it was better than all the methods with the exception of IBLRML+ and ML-localkNN. For ranking loss it improved the results of all the methods. For coverage it also achieved the best results but the differences were not significant against the four best performing methods.

5.2. Instance Selection

Instance selection is a widely used method in single-label classification that improves the performance of instance-based methods and reduces the size of the training set [44]. For single-label problems, evolutionary algorithms have demonstrated better performance and also a good scalability [45,46]. For multi-label datasets, only a few methods have been developed [47,48,49,50,51].
An interesting aspect of this work is the study of whether our approach is able to maintain its superior performance when instance selection is applied [52,53]. As we are not proposing a new instance selection algorithm, we used for both the standard ML-kNN method and ML-k’sNN a very simple CHC evolutionary computational approach [54,55] which has proven its efficiency for instance selection in single-label problems [56].
We used populations of 100 individuals evolved for 1000 generations. This experiment was carried out using the F1 metric. Table 9 shows the comparison among the different methods in terms of the F1 metric and reduction. Comparisons in terms of the Nemenyi test are shown in Figure 12.
Regarding the comparison between ML-kNN and ML-k’sNN, the tables demonstrate the superior performance of our proposed method. ML-k’sNN achieved better results in both reduction and the F1 metric. These differences were significant, according to the Wilcoxon test. This behavior is illustrated in Figure 13, where the results of the geometric mean of F1 and reduction are plotted for both ML-kNN and ML-k’sNN. With the exception of dataset #24, Stackex_coffee, the combined performance of reduction and F1 is always better for ML-k’sNN.
The comparison with LAML-kNN showed different results. LAML-k’sNN improved the F1 metric performance of LAML-kNN but with a lower level of reduction. However, the combined reduction and F1 metric performance—see Figure 14—was very favorable to our proposed method. In most cases, the differences in performance are rather large, and the performance of LAML-k’sNN is clearly superior.

6. Conclusions

In this paper, we have proposed a new multi-label classification algorithm, ML-k’sNN, based on the ML-kNN algorithm in which different values of k are used for each label. Three different methods for obtaining the set of k’s for every label are proposed and tested. Depending on the metric to be optimized, a label independent or evolutionary approach are used. The complexity of the three approached varies, so choosing the best one for a specific task would depend on the available resources and performance constraints.
The proposed method is studied using two different implementations of ML-kNN, the standard ML-kNN method and the locally adaptive ML-kNN method, LAML-kNN. However, the proposed method can be applied to almost any other version of ML-kNN. Using a large set of 40 problems with different characteristics, our proposed method demonstrated better performance when compared to both ML-kNN implementations. A further study has shown that our proposed method was able to improve, as a general rule, its performance when there are more labels in the dataset or when the diversity of the labels increases, although for some datasets it might not be the case. Furthermore, the improvement demonstrated by ML-k’sNN was maintained when the method was coupled with instance selection. In fact, the good performance of our approach was kept while obtaining a large reduction in training set size.
A final experiment compared our algorithm with ten different ML-kNN variants. This comparison showed the overall best performance of ML-k’sNN for all the four classification metrics and the three ranking metrics.
A promising research line is extending our approach to other methods based on ML-kNN. Almost any variant of ML-kNN, such as the used in the experiments, can be adapted to work with a k more appropriate for every label. In this way, our proposal may benefit other variants of instance-based multi-label learning methods.

Author Contributions

All authors have contributed in the conceptualization, methodology, software, validation, formal analysis and writing of this paper. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by grant PID2019-109481GB-I00/AEI/q10.13039/50110001 1033 from the Spanish Ministry of Science and Innovation and grant UCO-1264182 from the Junta de Andalucía Excellence in Research Program and FEDER Funds.

Data Availability Statement

The source code and the datasets used in this paper are freely available upon request from the authors.

Conflicts of Interest

The authors declare no conflict of interest, The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

References

  1. Zhang, M.L.; Zhou, Z.H. Multilabel neural networks with applications to functional genomics and text categorization. IEEE Trans. Knowl. Data Eng. 2006, 18, 1338–1351. [Google Scholar] [CrossRef] [Green Version]
  2. Zhang, M.L.; Zhou, Z.H. A review on Multi-Label Learning Algorithms. IEEE Trans. Knowl. Data Eng. 2014, 26, 1819–1837. [Google Scholar] [CrossRef]
  3. Wang, B.; Hu, X.; Li, P.; Yu, P.S. Cognitive structure learning model for hierarchical multi-label text classification. Knowl.-Based Syst. 2021, 218, 106876. [Google Scholar] [CrossRef]
  4. Ozmen, M.; Zhang, H.; Wang, P.; Coates, M. Multi-Relation Message Passing for Multi-Label Text Classification. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Singapore, 22–27 May 2022; pp. 3583–3587. [Google Scholar] [CrossRef]
  5. Zhang, H.; Qian, S.; Fang, Q.; Xu, C. Multi-modal Meta Multi-Task Learning for Social Media Rumor Detection. IEEE Trans. Multimed. 2021, in press. [Google Scholar] [CrossRef]
  6. Zheng, X.; Li, P.; Chu, Z.; Hu, X. A Survey on Multi-Label Data Stream Classification. IEEE Access 2020, 8, 1249–1275. [Google Scholar] [CrossRef]
  7. Zhu, Y.; Luo, W.; Chen, G.; Ou, J. A multi-label classification method based on associative rules. J. Comput. Inf. Syst. 2012, 8, 791–799. [Google Scholar]
  8. Toledano, J.P.P.; García-Pedrajas, N.; Cerruela-García, G. Multilabel and Missing Label Methods for Binary Quantitative Structure–Activity Relationship Models: An Application for the Prediction of Adverse Drug Reactions. J. Chem. Inf. Model. 2019, 59, 4120–4130. [Google Scholar] [CrossRef]
  9. Wang, H.; Yan, L.; Huang, H.; Ding, C. From protein sequence to protein function via multi-label linear discriminant analysis. IEEE/ACM Trans. Comput. Biol. Bioinform. 2017, 14, 503–513. [Google Scholar] [CrossRef]
  10. Sarinnapakorn, K.; Kubat, M. Induction from multi-label examples in information retrieval systems: A case study. Appl. Artif. Intell. 2008, 22, 407–432. [Google Scholar] [CrossRef]
  11. Xiao, J.; Xu, J.; Tian, C.; Han, P.; You, J.; Zhang, S. A Serial Attention Frame for Multi-Label Waste Bottle Classification. Appl. Sci. 2022, 12, 1742. [Google Scholar] [CrossRef]
  12. Javed, F.; Hayat, M. Predicting subcellular localization of multi-label proteins by incorporating the sequence features into Chou’s PseAAC. Genomics 2019, 111, 1325–1332. [Google Scholar] [CrossRef] [PubMed]
  13. Tao, J.; Fang, X. Toward multi-label sentiment analysis: A transfer learning based approach. J. Big Data 2020, 7, 1. [Google Scholar] [CrossRef] [Green Version]
  14. Zhang, M.L.; Zhou, Z.H. ML-KNN: A lazy learning approach to multi-label learning. Pattern Recognit. 2007, 40, 2038–2048. [Google Scholar] [CrossRef] [Green Version]
  15. Rastin, N.; Jahromi, M.Z.; Taheri, M. A Generalized Weighted Distance k-Nearest Neighbor for Multi-label Problems. Pattern Recognit. 2021, 114, 107526. [Google Scholar] [CrossRef]
  16. Zufferey, D.; Hofer, T.; Hennebert, J.; Schumacher, M.; Ingold, R.; Bromuri, S. Performance comparison of multi-label learning algorithms on clinical data for chronic diseases. Comput. Biol. Med. 2015, 65, 34–43. [Google Scholar] [CrossRef] [Green Version]
  17. Charte, F.; Charte, D. Working with Multilabel Datasets in R: The mldr Package. R J. 2015, 7, 149–162. [Google Scholar] [CrossRef] [Green Version]
  18. Jiang, M.; Du, L.; Wu, J.; Zhang, M.; Gong, Z. A classification algorithm based on weighted ML-kNN for multi-label data. Int. J. Internet Manuf. Serv. 2019, 6, 326–342. [Google Scholar] [CrossRef]
  19. Xu, J. Multi-Label Weighted k-Nearest Neighbor Classifier with Adaptive Weight Estimation. In Proceedings of the Neural Information Processing, ICONIP 2011, Shanghai, China, 13–17 November 2011; Lu, B., Zhang, L., Kwok, J., Eds.; Lecture Notes in Computer Science. Springer: Berlin/Heidelberg, Germany, 2011; Volume 7063, pp. 79–88. [Google Scholar]
  20. Wang, D.; Wang, J.; Hui, F.; Guoqing, L.; Zhang, X. A Locally Adaptive Multi-Label k-Nearest Neighbor Algorithm. In Proceedings of the Pacific-Asia Conference on Knowledge Discovery and Data Mining, Melbourne, Australia, 3–6 June 2018; Lecture Notes in Computer Science. Springer: Cham, Switzerland, 2018; Volume 10937, pp. 81–93. [Google Scholar]
  21. Wang, Z.W.; Wang, S.; Wan, B.T.; Song, W.W. A novel multi-label classification algorithm based on K-nearest neighbor and random walk. Int. J. Distrib. Sens. Netw. 2020, 16, 1550147720911892. [Google Scholar]
  22. Younes, Z.; Abdallah, F.; Denoeux, T. Multi-label classification algorithm derived from k-nearest neighbor rule with label dependencies. In Proceedings of the 16th European Signal Processing Conference, Lausanne, Switzerland, 25–29 August 2008; pp. 1–5. [Google Scholar]
  23. Pakhira, M.K. A Fast k -means Algorithm using Cluster Shifting to Produce Compact and Separate Clusters. Int. J. Eng. Basics Appl. Asp. 2015, 28, 35–43. [Google Scholar]
  24. Dzeroski, S.; Zenko, B. Is combining classifiers with stacking better than selecting the best one? Mach. Learn. 2004, 54, 255–273. [Google Scholar] [CrossRef] [Green Version]
  25. Lin, X.; Chen, X.W. Mr.KNN: Soft Relevance for Multi-Label Classification. In Proceedings of the 19th ACM International Conference on Information and Knowledge Management, Toronto, ON, Canada, 26–30 October 2010; Association for Computing Machinery: New York, NY, USA, 2010; pp. 349–358. [Google Scholar]
  26. Vluymans, S.; Cornelis, C.; Herrera, F.; Saeys, Y. Multi-label classification using a fuzzy rough neighborhood consensus. Inf. Sci. 2018, 433–434, 96–114. [Google Scholar] [CrossRef]
  27. Hang, J.Y.; Zhang, M.L. Collaborative Learning of Label Semantics and Deep Label-Specific Features for Multi-Label Classification. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 44, 9860–9871. [Google Scholar] [CrossRef] [PubMed]
  28. Eshelman, L.J.; Schaffer, J.D. Real-coded genetic algorithms and interval-schemata. In Foundations of Genetic Algorithms 2; Whitley, L.D., Ed.; Morgan Kaufmann: San Mateo, CA, USA, 1993; pp. 187–202. [Google Scholar]
  29. Tsoumakas, G.; Spyromitros-Xioufis, E.; Vilcek, J.; Vlahavas, I. Mulan: A Java Library for Multi-Label Learning. J. Mach. Learn. Res. 2011, 12, 2411–2414. [Google Scholar]
  30. Xu, J.; Liu, J.; Yin, J.; Sun, C. A multi-label feature extraction algorithm via maximizing feature variance and feature-label dependence simultaneously. Knowl.-Based Syst. 2016, 98, 172–184. [Google Scholar] [CrossRef]
  31. Read, J.; Reutemann, P.; Pfahringer, B.; Holmes, G. MEKA: A Multi-label/Multi-target Extension to Weka. J. Mach. Learn. Res. 2016, 17, 1–5. [Google Scholar]
  32. Charte, F.; Rivera, A.J.; del Jesus, M.J.; Herrera, F. Addressing imbalance in multilabel classification: Measures and random resampling algorithms. Neurocomputing 2015, 163, 3–16. [Google Scholar] [CrossRef]
  33. Blockeel, H.; Džeroski, S.; Grbovic, J. Simultaneous prediction of multiple chemical parameters of river water quality with tilde. In Proceedings of the Lecture Notes in Computer Science, Tokyo, Japan, 26–28 July 1999; Volume 1704, pp. 32–40. [Google Scholar]
  34. Demšar, J. Statistical Comparisons of Classifiers over Multiple Data Sets. J. Mach. Learn. Res. 2006, 7, 1–30. [Google Scholar]
  35. Nemenyi, P.B. Distribution-Free Multiple Comparisons. Ph.D. Thesis, Princeton University, Princeton, NJ, USA, 1963. [Google Scholar]
  36. James, G.; Witten, D. An Introduction to Statistical Learning: With Applications in R; Springer Texts in Statistics; Springer: Berlin/Heidelberg, Germany, 2017. [Google Scholar]
  37. Boutell, M.R.; Luo, J.; Shen, X.; Brown, C.M. Learning multi-label scene classification. Pattern Recognit. 2004, 37, 1757–1771. [Google Scholar] [CrossRef] [Green Version]
  38. Sorower, M.S. A Literature Survey on Algorithms for Multi-Label Learning. Ph.D. Thesis, Computer Science, Oregon State University, Corvallis, OR, USA, 2010. [Google Scholar]
  39. García-Pedrajas, N.; Cerruela-García, G. Cooperative coevolutionary instance selection for multilabel problems. Knowl.-Based Syst. 2021, 234, 10756. [Google Scholar] [CrossRef]
  40. Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
  41. Pakrashi, A.; Namee, B.M. Stacked-MLkNN: A stacking based improvement to Multi-Label k-Nearest Neighbours. Proc. Mach. Learn. Res. 2017, 74, 51–63. [Google Scholar]
  42. Cheng, W.; Hüllermeier, E. Combining instance-based learning and logistic regression for multilabel classification. Mach. Learn. 2009, 76, 211–225. [Google Scholar] [CrossRef] [Green Version]
  43. del Castillo, J.R.; Mendoza-Hurtado, M.; Ortiz-Boyer, D.; García-Pedrajas, N. Local-based k values for multi-label k-nearest neighbors rule. Eng. Appl. Artif. Intell. 2022, 116, 105487. [Google Scholar] [CrossRef]
  44. Brighton, H.; Mellish, C. Advances in Instance Selection for Instance-Based Learning Algorithms. Data Min. Knowl. Discov. 2002, 6, 153–172. [Google Scholar] [CrossRef]
  45. García-Pedrajas, N.; de Haro-García, A.; Pérez-Rodríguez, J. A scalable memetic algorithm for simultaneous instance and feature selection. Evol. Comput. 2014, 22, 1–45. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  46. García-Pedrajas, N.; del Castillo, J.A.R.; Cerruela-García, G. SI(FS)2: Fast simultaneous instance and feature selection for datasets with many features. Pattern Recognit. 2021, 111, 107723. [Google Scholar] [CrossRef]
  47. Calvo-Zaragoza, J.; Valero-Mas, J.J.; Rico-Juan, J.R. Improving kNN multi-label classification in Prototype Selection scenarios using class proposals. Pattern Recognit. 2015, 48, 1608–1622. [Google Scholar] [CrossRef]
  48. Kanj, S.; Abdallah, F.; Denoeux, T.; Tout, K. Editing training data for multi-label classification with the k-nearest neighbor rule. Pattern Anal. Appl. 2016, 19, 145–161. [Google Scholar] [CrossRef] [Green Version]
  49. Arnaiz-González, A.; Díez-Pastor, J.F.; Rodríguez, J.J.; García-Osorio, C. Local sets for multi-label instance selection. Appl. Soft Comput. J. 2018, 68, 651–666. [Google Scholar] [CrossRef]
  50. Arnaiz-González, A.; Díez-Pastor, J.F.; Rodríguez, J.J.; García-Osorio, C. Study of data transformation techniques for adapting single-label prototype selection algorithms to multi-label learning. Expert Syst. Appl. 2018, 109, 114–130. [Google Scholar] [CrossRef]
  51. Devi, V.S.; Kuruvilla, S.A.; Aparna, R. Prototype selection and dimensionality reduction on multi-label data. In Proceedings of the ACM India Joint 7th ACM IKDD Conference on Data Science and 25th International Conference on Management of Data, CoDS-COMAD 2020, Hyderabad, India, 5–7 January 2020; pp. 195–199. [Google Scholar]
  52. de Haro-García, A.; Pérez-Rodríguez, J.; García-Pedrajas, N. Combining three strategies for evolutionary instance selection for instance-based learning. Swarm Evol. Comput. 2018, 42, 160–172. [Google Scholar] [CrossRef]
  53. del Castillo, J.R.; Ortiz-Boyer, D.; García-Pedrajas, N. Instance selection for multi-label learning based on a scalable evolutionary algorithm. In Proceedings of the 2021 International Conference on Data Mining Workshops (ICDMW), Auckland, New Zealand, 7–10 December 2021; IEEE Computer Society: Los Alamitos, CA, USA, 2021; pp. 843–851. [Google Scholar] [CrossRef]
  54. Eshelman, L.J. The CHC Adaptive Search Algorithm: How to Have Safe Search When Engaging in Nontraditional Genetic Recombination; Morgan Kauffman: San Mateo, CA, USA, 1990. [Google Scholar]
  55. Pérez-Rodríguez, J.; Arroyo-Peña, A.; García-Pedrajas, N. Simultaneous instance and feature selection and weighting using evolutionary computation: Proposal and study. Appl. Soft Comput. 2015, 37, 416–443. [Google Scholar] [CrossRef]
  56. Cano, J.R.; Herrera, F.; Lozano, M. Using Evolutionary Algorithms as Instance Selection for Data Reduction in KDD: An Experimental Study. IEEE Trans. Evol. Comput. 2003, 7, 561–575. [Google Scholar] [CrossRef]
Figure 1. Results of ML-kNN and ML-k’sNN for the four metrics: accuracy, F1, F1-macro and F1-micro.
Figure 1. Results of ML-kNN and ML-k’sNN for the four metrics: accuracy, F1, F1-macro and F1-micro.
Mathematics 11 00275 g001
Figure 2. Nemenyi test for the different methods and the different classification metrics.
Figure 2. Nemenyi test for the different methods and the different classification metrics.
Mathematics 11 00275 g002aMathematics 11 00275 g002b
Figure 3. Results for ML-kNN and ML-k’sNN for the three metrics: average precision, coverage, and ranking-loss.
Figure 3. Results for ML-kNN and ML-k’sNN for the three metrics: average precision, coverage, and ranking-loss.
Mathematics 11 00275 g003
Figure 4. Nemenyi test for the different methods and the different ranking metrics.
Figure 4. Nemenyi test for the different methods and the different ranking metrics.
Mathematics 11 00275 g004
Figure 5. Averaged k values for the different datasets.
Figure 5. Averaged k values for the different datasets.
Mathematics 11 00275 g005
Figure 6. Difference in F1 metric between ML-k’sNN.ML and ML-kNN sorted by increasing dataset diversity. A linear regression of the difference in terms of the F1 metric is plotted in red color.
Figure 6. Difference in F1 metric between ML-k’sNN.ML and ML-kNN sorted by increasing dataset diversity. A linear regression of the difference in terms of the F1 metric is plotted in red color.
Mathematics 11 00275 g006
Figure 7. Difference in F1 metric between ML-k’sNN.ML and ML-kNN, sorted by increasing number of dataset labels. A linear regression of the difference in terms of the F1 metric is plotted in red color.
Figure 7. Difference in F1 metric between ML-k’sNN.ML and ML-kNN, sorted by increasing number of dataset labels. A linear regression of the difference in terms of the F1 metric is plotted in red color.
Mathematics 11 00275 g007
Figure 8. Nemenyi test for the different variants of ML-kNN and the different classification metrics.
Figure 8. Nemenyi test for the different variants of ML-kNN and the different classification metrics.
Mathematics 11 00275 g008aMathematics 11 00275 g008b
Figure 9. Nemenyi test for the different variants of ML-kNN and the different ranking metrics.
Figure 9. Nemenyi test for the different variants of ML-kNN and the different ranking metrics.
Mathematics 11 00275 g009
Figure 10. Holm test for the different variants of ML-kNN and the different classification metrics.
Figure 10. Holm test for the different variants of ML-kNN and the different classification metrics.
Mathematics 11 00275 g010
Figure 11. Holm test for the different variants of ML-kNN and the different ranking metrics.
Figure 11. Holm test for the different variants of ML-kNN and the different ranking metrics.
Mathematics 11 00275 g011
Figure 12. Nemenyi test results from the different methods, measuring reduction and F1 metric.
Figure 12. Nemenyi test results from the different methods, measuring reduction and F1 metric.
Mathematics 11 00275 g012
Figure 13. Results from ML-kNN and ML-k’sNN for the geometric mean of F1 and reduction.
Figure 13. Results from ML-kNN and ML-k’sNN for the geometric mean of F1 and reduction.
Mathematics 11 00275 g013
Figure 14. Results from LAML-kNN and LAML-k’sNN for the geometric mean of F1 and reduction.
Figure 14. Results from LAML-kNN and LAML-k’sNN for the geometric mean of F1 and reduction.
Mathematics 11 00275 g014
Table 1. Description of the datasets.
Table 1. Description of the datasets.
DatasetInstancesFeaturesLabelsCardinalityDensityDiversityProportion of Distinct LabelsMeanIRCVIRSource
1bibtex739518361592.400.015116540.223712.500.4051[29]
2birds645271191.860.09811320.37615.410.8169[29]
3CAL5005026817426.040.14974950.986120.581.0871[29]
4corel16k00513,8475001602.860.017917840.128834.940.7282[29]
5Corel5k50004993733.520.009414530.2906189.571.5266[29]
6enron17021001533.380.06377530.442473.951.9596[29]
7EukaryoteGO776612,689221.150.05211120.014445.011.4070[30]
8EukaryotePseAAC7766440221.150.05211120.014445.011.4070[30]
9genbase6621185271.250.0464320.048337.311.4494[29]
10HumanGO31069844141.190.0847850.027415.291.0850[30]
11HumanPseAAC3106440141.190.0847850.027415.291.0850[30]
12LLOG-F14601003751.380.01832780.221939.271.3106[31]
13medical9781449451.250.0277940.096189.501.1476[31]
14OHSUMED-F13,9291002231.660.072311470.08237.870.8920[31]
15rcv1subset1600047,2361012.880.02858370.139554.492.0806[29]
16rcv1subset2600047,2361012.630.02618000.133345.511.7148[29]
17rcv1subset3600047,2361012.610.02597830.130568.332.9901[29]
18rcv1subset4600047,2361012.480.02466980.116389.372.3336[29]
19rcv1subset5600047,2361012.640.02627820.130369.682.6979[29]
20REUTERS-K500-EX260005001031.460.01426180.103051.981.9707[31]
21SLASHDOT-F37821079221.180.05371560.041217.692.4155[31]
22Stackex_chemistry68615401752.110.012114520.208856.880.8964[32]
23Stackex_chess16755852272.420.01065080.303885.790.8167[32]
24Stackex_coffee22517631231.990.01621490.662227.240.5715[32]
25Stackex_cooking10,4915774002.250.005617120.165337.860.6513[32]
26Stackex_cs92706352742.570.009414890.161385.000.7596[32]
27Stackex_philosophy39718422332.280.009810720.270868.750.7989[32]
28Water-quality106016145.100.36448240.78181.770.3016[33]
29Yahoo_Arts748423,146261.650.06365990.080094.743.8059[29]
30Yahoo_Business11,21421,924301.600.05332330.0208880.182.8112[29]
31Yahoo_Computers12,44434,096331.510.04574280.0344176.701.9062[29]
32Yahoo_Education12,03027,534331.460.04435110.0425168.111.7756[29]
33Yahoo_Entertainment12,73032,001211.410.06733370.026564.421.5398[29]
34Yahoo_Health920530,605321.640.05143350.0364653.531.9399[29]
35Yahoo_Recreation12,82830,324221.430.06505300.041312.201.3899[29]
36Yahoo_Reference802739,679331.170.03562750.0343461.862.0073[29]
37Yahoo_Science642837,187401.450.03624570.071152.631.6349[29]
38Yahoo_Social12,11152,350391.280.03283610.0298257.702.3431[29]
39Yahoo_Society14,51231,802271.670.061910540.0726302.074.5633[29]
40yeast2417103144.240.30261980.08197.201.8838[29]
Table 2. Comparison of the different methods using accuracy metric.
Table 2. Comparison of the different methods using accuracy metric.
ML-kNNML-k’sNN.SLML-k’sNN.MLLAML-kNNLAML-k’sNN.ML
Mean 0.34400.35440.36060.33140.3617
Ranks 3.75002.83752.05004.10002.2625
w/l 26/1435/312/1831/9
ML-kNNp 0.01550.00000.12310.0000
R + / R 590.0/230.0772.5/47.5295.5/524.5720.0/100.0
w/l 25/1410/3024/16
ML-k’sNN.SLp 0.10530.00060.1039
R + / R 530.5/289.5153.0/667.0531.0/289.0
w/l 6/3417/22
ML-k’sNN.MLp 0.00000.4476
R + / R 103.0/717.0353.5/466.5
w/l 37/3
LAML-kNNp 0.0000
R + / R 756.0/64.0
Table 3. Comparison of the different methods using F1 metric.
Table 3. Comparison of the different methods using F1 metric.
ML-kNNML-k’sNN.SLML-k’sNN.MLLAML-kNNLAML-k’sNN.ML
Mean 0.42050.43390.44170.40680.4426
Ranks 3.71252.95002.07504.07502.1875
w/l 23/1735/312/1933/7
ML-kNNp 0.04380.00000.03880.0000
R + / R 560.0/260.0786.5/33.5256.5/563.5751.0/69.0
w/l 26/1411/2924/16
ML-k’sNN.SLp 0.07830.00030.0760
R + / R 541.0/279.0138.0/682.0542.0/278.0
w/l 4/3519/18
ML-k’sNN.MLp 0.00000.9250
R + / R 67.5/752.5403.0/417.0
w/l 35/5
LAML-kNNp 0.0000
R + / R 788.0/32.0
Table 4. Comparison of the different methods using F1. macro metric.
Table 4. Comparison of the different methods using F1. macro metric.
ML-kNNML-k’sNN.SLML-k’sNN.MLLAML-kNNLAML-k’sNN.ML
Mean 0.23130.23050.24130.22370.2387
Ranks 3.65003.07502.11253.57502.5875
w/l 25/1534/417/1525/15
ML-kNNp 0.60950.00000.68650.0174
R + / R 448.0/372.0762.5/57.5380.0/440.0587.0/233.0
w/l 28/1217/2323/17
ML-k’sNN.SLp 0.00130.19230.0397
R + / R 649.0/171.0313.0/507.0563.0/257.0
w/l 10/3016/21
ML-k’sNN.MLp 0.00030.2422
R + / R 140.0/680.0323.0/497.0
w/l 31/9
LAML-kNNp 0.0001
R + / R 697.0/123.0
Table 5. Comparison of the different methods using F1. micro metric.
Table 5. Comparison of the different methods using F1. micro metric.
ML-kNNML-k’sNN.SLML-k’sNN.MLLAML-kNNLAML-k’sNN.ML
Mean 0.41260.41730.43000.40380.4258
Ranks 3.58753.07502.07503.95002.3125
w/l 23/1735/38/1930/10
ML-kNNp 0.33320.00000.02300.0003
R + / R 482.0/338.0779.5/40.5241.5/578.5681.0/139.0
w/l 24/1616/2426/14
ML-k’sNN.SLp 0.00780.01390.0397
R + / R 608.0/212.0227.0/593.0563.0/257.0
w/l 5/3417/22
ML-k’sNN.MLp 0.00000.2290
R + / R 48.5/771.5320.5/499.5
w/l 34/6
LAML-kNNp 0.0000
R + / R 756.0/64.0
Table 6. Comparison of the different methods using average precision metric.
Table 6. Comparison of the different methods using average precision metric.
ML-kNNML-k’sNN.ECLAML-kNNLAML-k’sNN.ECML-k’sNN.SL
Mean 0.50700.53410.49700.53380.5014
Ranks 3.23751.87503.86252.35003.6750
w/l 32/812/1925/1516/24
ML-kNNp 0.00000.08370.00070.3134
R + / R 750.0/70.0281.5/538.5662.0/158.0335.0/485.0
w/l 5/3515/257/33
ML-k’sNN.ECp 0.00000.30070.0000
R + / R 65.0/755.0333.0/487.059.0/761.0
w/l 32/824/16
LAML-kNNp 0.00000.2763
R + / R 769.0/51.0491.0/329.0
w/l 6/34
LAML-k’sNN.ECp 0.0000
R + / R 61.0/759.0
Table 7. Comparison of the different methods using coverage metric.
Table 7. Comparison of the different methods using coverage metric.
ML-kNNML-k’sNN.ECLAML-kNNLAML-k’sNN.ECML-k’sNN.SL
Mean 29.887025.304927.320527.448036.7408
Ranks 3.10002.01253.55002.3875B
w/l 28/128/2226/1417/23
ML-kNNp 0.00080.02860.03720.0294
R + / R 659.0/161.0247.5/572.5565.0/255.0248.0/572.0
w/l 9/3014/265/35
ML-k’sNN.ECp 0.00160.20160.0000
R + / R 175.5/644.5315.0/505.087.0/733.0
w/l 30/914/26
LAML-kNNp 0.02040.0061
R + / R 582.5/237.5206.0/614.0
w/l 6/34
LAML-k’sNN.ECp 0.0000
R + / R 82.0/738.0
Table 8. Comparison of the different methods using ranking loss metric.
Table 8. Comparison of the different methods using ranking loss metric.
ML-kNNML-k’sNN.ECLAML-kNNLAML-k’sNN.ECML-k’sNN.SL
Mean 0.10990.08270.10950.12560.1101
Ranks 2.93751.83753.32503.58753.3125
w/l 33/710/1614/2613/26
ML-kNNp 0.00030.34080.09830.3232
R + / R 676.0/144.0339.5/480.5287.0/533.0336.5/483.5
w/l 7/338/3111/29
ML-k’sNN.ECp 0.00020.00010.0050
R + / R 130.0/690.0111.5/708.5201.0/619.0
w/l 17/2319/19
LAML-kNNp 0.23690.8350
R + / R 322.0/498.0394.5/425.5
w/l 23/17
LAML-k’sNN.ECp 0.2264
R + / R 500.0/320.0
Table 9. Comparison of the different methods’ instance selection results.
Table 9. Comparison of the different methods’ instance selection results.
F1 Metric
ML-kNNML-k’sNNLAML-kNNLAML-k’sNN
Mean 0.34720.38030.30000.3729
Ranks 2.46251.88753.70001.9500
w/l 25/104/3627/13
ML-kNNp 0.00060.00000.1789
R + / R 664.5/155.591.0/729.0510.0/310.0
w/l 2/3821/19
ML-k’sNNp 0.00000.9250
R + / R 5.0/815.0403.0/417.0
w/l 34/6
LAML-kNNp 0.0000
R + / R 724.0/96.0
Reduction
ML-kNNML-k’sNNLAML-kNNLAML-k’sNN
Mean 0.94000.95580.95730.9424
Ranks 3.08752.05002.10002.7625
w/l 30/928/1225/15
ML-kNNp 0.00040.00020.2589
R + / R 675.5/144.5686.0/134.0494.0/326.0
w/l 18/2114/26
ML-k’sNNp 0.83500.0360
R + / R 425.5/394.5254.0/566.0
w/l 10/29
LAML-kNNp 0.0001
R + / R 108.5/711.5
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Cuevas-Muñoz, J.M.; García-Pedrajas, N.E. ML-k’sNN: Label Dependent k Values for Multi-Label k-Nearest Neighbor Rule. Mathematics 2023, 11, 275. https://doi.org/10.3390/math11020275

AMA Style

Cuevas-Muñoz JM, García-Pedrajas NE. ML-k’sNN: Label Dependent k Values for Multi-Label k-Nearest Neighbor Rule. Mathematics. 2023; 11(2):275. https://doi.org/10.3390/math11020275

Chicago/Turabian Style

Cuevas-Muñoz, José M., and Nicolás E. García-Pedrajas. 2023. "ML-k’sNN: Label Dependent k Values for Multi-Label k-Nearest Neighbor Rule" Mathematics 11, no. 2: 275. https://doi.org/10.3390/math11020275

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop