我有一組類似參數的對象:尋找最接近的匹配
var obj = new {Param1 = 100; Param2 = 212; Param3 = 311; param4 = 11; Param5 = 290;}
在另一邊,我有對象的列表:
var obj1 = new {Param1 = 1221 ; Param2 = 212 ; Param3 = 311 ; param4 = 11 ; Param5 = 290 ; }
var obj3 = new {Param1 = 35 ; Param2 = 11 ; Param3 = 319 ; param4 = 211 ; Param5 = 790 ; }
var obj4 = new {Param1 = 126 ; Param2 = 218 ; Param3 = 2 ; param4 = 6 ; Param5 = 190 ; }
var obj5 = new {Param1 = 213 ; Param2 = 121 ; Param3 = 61 ; param4 = 11 ; Param5 = 29 ; }
var obj7 = new {Param1 = 161 ; Param2 = 21 ; Param3 = 71 ; param4 = 51 ; Param5 = 232 ; }
var obj9 = new {Param1 = 891 ; Param2 = 58 ; Param3 = 311 ; param4 = 21 ; Param5 = 590 ; }
var obj11 = new {Param1 = 61 ; Param2 = 212 ; Param3 = 843 ; param4 = 89 ; Param5 = 210 ; }
什麼是最好的(最簡單)算法找到列出的對象中第一個obj的最接近的匹配項?
你如何定義最接近的匹配?最小平方誤差?最小錯誤?精確參數匹配的最大數量(帶有可選的打破平局規則)? – Brian 2010-06-09 16:49:35
相關:http://stackoverflow.com/questions/2981743/ways-to-calculate-similarity/2981772#2981772 – Betamoo 2010-06-09 17:02:46
相關:http://stackoverflow.com/questions/2887541/similarity-in-data-mining – Betamoo 2010-06-09 17:11:34