BINARY CLASSIFICATION
Demonstration of an classifier inspired by electrostatics.
Two classes, Two dimensional weighted data, used to predict the class of the new datapoint.
Press 'd' to display the decision boundary,
press 'c' clear it. Else, simply click/tap here.
The classifier is demonstrated using a simple binary classification problem.

There are two classes of data points, blue and red. We use the classifier to predict which class the new data point belongs to. The classification works in the following manner.
Assume that blue class data points are a bunch of negative charges, and red class data points are positive charges. The new data point is like the test charge. We calculate the forces on the test charge. We first calculate the force only due to the positive charges, and then calculate the force due to the negative charges. Based on the magnitude of the two forces, we determine whether it should belong to the blue class or the red class.

Except that there is a small difference, adding the forces due to each charge isn't a great idea, it doesn't give good classification in some regions where forces due to the same class cancel out. To avoid this cancellation, absolute value of the forces is taken into consideration while adding the force contributions.

Since this approach has charges associated with it, we can use this to our advantage to assign weightage to the data points. If a particular data point is more important than others, it is assigned a higher charge value.

There are other parameters to play around, the force varies as a inverse square of the distance. This force function can be varied as a parameter. Hence, this approach simply boils down to classifying a point based on it's distance to various classes along with some associations with weights and distance functions.
BACK