Solved – How to plot visualization for multi-label k-Nearest Neighbor

k nearest neighbourmachine learningmultilabel

I am studying multi-label learning methods, where for a given observation, you can assign more than one (a set of) target labels. One example is multi-label k-Nearest Neighbor.

I am seeking a way to describe to a panel of people unfamiliar with multi-label learning methods, a way to visualize how they work. For multi-label kNN, I need a visualization, much like the single-label multi-label approach found here: How to plot decision boundary of a k-nearest neighbor classifier from Elements of Statistical Learning?.

Note: This is not a duplicate of the above question (that I linked to above), because this is a multi-label version of kNN. The single-label solution is an intuitive visualization process, but the multi-label version is giving me trouble.

Can anyone help me understand how to visualize the predictions from a multi-label k-Nearest Neighbor classifier?

Best Answer

This is the best visualization I can attempt to use to describe multi-label KNN. Let me know if you disagree.

In the plot below, individuals are one or more of the labels: {blue, orange, green}. As you can see, some individuals are both blue and orange, some green and orange. For the test subject I point to with the red arrow, the 7 nearest neighbors are probed.

Plot in principle component input space, of a three class classification problem, using 7-Nearest Neighbors.

From examination of those 7 nearest neighbors, you get the histogram below, yielding a final ranking class order of: Blue=Orange > Green, meaning this test subject is blue or orange before it is green. I don't know how precisely this translates to class probabilities. Would love to learn more?

Histogram of test subject's class membership based on 7 nearest neighbor's class membership.

Related Question