Finding the closest match

本秂侑毒 提交于 2019-11-30 05:49:06

You must define the term closest match before trying to find it!!



1- One way many people use is Mean Squared Error (or Euclidean Distance) :

Calculate mean square error for all objects:

Sqr(obj.Param1-obj1.Param1) + Sqr(obj.Param2-obj1.Param2) + ..... // for obj1
Sqr(obj.Param1-obj2.Param1) + Sqr(obj.Param2-obj2.Param2) + ..... // for obj2

and choose the one with the minimum value...



2- You may also use Minimum absolute error :

Abs(obj.Param1-obj1.Param1) + Abs(obj.Param2-obj1.Param2) + ..... // for obj1
Abs(obj.Param1-obj2.Param1) + Abs(obj.Param2-obj2.Param2) + ..... // for obj2

and choose the one with the minimum value...



3- Also you can apply k-nearest neighbour with any criteria you have chosen above



It all depends on the properties of these parameters...

For more reading you may look at List of Classification algorithms

Depends, i guess. Several possibilities come to my mind:

  • SAD: calculate the absolute difference of each pair of parameters (the one you test and each of your candidates) and sum them up. Lowest number is closest
  • L2-Norm: Calculate the difference of each pair of parameters, square them, sum them up, take square root
  • Cosine: Multiply each parameter with the other parameter, sum up. Divide result by product of length (L2-Norm) of both objects

of course, there are thousand more possibilities, therefore you have to specify, what you want exactly!

You could also use the Euclidean Distance.

Essentially you pretend each object is a point in 5 dimensions and look for the point that's closest (i.e.: has the shortest distance).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!