(correction)
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)) ?LenAnB)
(put (length (difference ?A ?B)) ?LenA-B)
(put (length (difference ?B ?A)) ?LenB-A)
(put (length ?A) ?LenA)
(put (length ?B) ?LenB)
(return (if (or (= ?LenA 0)(= ?LenB 0)) 0 else
(* 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
| Modify
Your Subscription
-------------------------------------------
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