Nearest Mean

Simple Explanation

nearest mean classifier

Fig. 1. Scatter plot of hypothetical data showing the distribution of x class (blue cross) and square class (green square). Nearest mean classifier calculates the mean of x (cyan circle) and mean of square (black circle) to determine the class of the unknown (red circle).

Nearest Mean is a machine learning classification algorithm. During training, it summarizes the training examples into one representative data point for each class. The calculation towards this data point can be customized but by default, utilizes the arithmetic average of each feature in the training data to generate this representative data point.

In the example (Figure 1), nearest mean classifier would classify the unknown as x class because it is closer to the mean of x than the mean of square.

Additional Information

It is possible to define a custom distance function to calculate the distance between the unknown and the mean of each class. By default, MLGenius uses Euclidean Distance. Please contact us if you wish to customize the distance function.

Pros and Cons

  • fast execution
  • easy to handle live training updates
  • sensitive to outliers in small datasets