Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multilabel classification ML-kNN vs KNN

This might be a stupid question but I was just wondering what the difference between ML-KNN implemented in scikit.ml and scikit-learn's KNeighborsClassifier is. According to sklearn's docs KNeighborsClassifier has support for multilabel classification. ML-KNN however is KNN adapted for multilabel classification built on top of sklearn's architecture based on it's docs.

When searching for sample multilabel problems, MLkNN mostly appears but I do not understand if there's any advantage of using it over the base implementation of sklearn if it already supports it. Is it only a late adaptation in sklearn's side or are there more differences in the implementation?

Any input is appreciated. Thanks!

like image 508
iamnobody Avatar asked Oct 16 '22 11:10

iamnobody


1 Answers

scikit-multilearn's ML-KNN implementations is an improved version of scikit-learn's KNeighborsClassifier. It is actually built on top of it. After the k nearest neighbors in the training data are found, it uses maximum a posteriori principle to label a new instance to achieve a better performance. Also, since it operates on sparse matrices internally using SciPy sparse matrix library, it is highly memory-efficient. More info here and here.

like image 184
Reveille Avatar answered Nov 15 '22 09:11

Reveille