The problem is much easier given two lists
; Premise code (c) 2014 Michael S P Miller
function list-similarity {?A ?B}
(put (+ (length (intersection ?A ?B)) 1) ?LenAnB)
(put (+ (length (difference ?A ?B)) 1) ?LenA-B)
(put (+ (length (difference ?B ?A)) 1) ?LenB-A)
(put (+ (length ?A) 1) ?LenA)
(put (+ (length ?B) 1) ?LenB)
(return
(* 0.5 (- (+ (/ ?LenAnB ?LenA) (/ ?LenAnB
?LenB))
(+ (/ ?LenA-B ?LenA) (/ ?LenB-A
?LenB))))end
For numbers, it's a little more difficult.
Your thoughts?
-------------------------------------------
AGI
Archives: https://www.listbox.com/member/archive/303/=now
RSS Feed: https://www.listbox.com/member/archive/rss/303/21088071-f452e424
Modify Your Subscription:
https://www.listbox.com/member/?member_id=21088071&id_secret=21088071-58d57657
Powered by Listbox: http://www.listbox.com