# HG changeset patch # User Mohamed Gomaa # Date 1356419770 18000 # Node ID 8e66ced156dd0d1193fa0e3b172207745b0d4652 # Parent f2cf16ad798f8364eadffc0407c9552db43854c5 add delta to sample the time window in LCSS function diff -r f2cf16ad798f -r 8e66ced156dd python/utils.py --- a/python/utils.py Fri Dec 21 18:33:36 2012 -0500 +++ b/python/utils.py Tue Dec 25 02:16:10 2012 -0500 @@ -165,19 +165,22 @@ # maths section ######################### -def LCSS(l1, l2, threshold, distance): +def LCSS(l1, l2, threshold, delta, distance): '''returns the longest common subsequence similarity - based on the threshold on distance between two elements of lists l1, l2''' + based on the threshold on distance between two elements of lists l1, l2. + looks for points that are sampled within a delta time window, can put 'inf' value to cancl this condition''' from numpy import zeros, int as npint m = len(l1) n = len(l2) similarity = zeros((m+1,n+1), dtype = npint) for i in xrange(1,m+1): for j in xrange(1,n+1): - if distance(l1[i-1], l2[j-1])