comparison trafficintelligence/tests/utils.txt @ 1276:bae8de98406f

corrected bug in categorical value smoothing
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 25 Jun 2024 16:40:40 -0400
parents 77fbd0e2ba7d
children 7493751bfe19
comparison
equal deleted inserted replaced
1275:9f1711a85c56 1276:bae8de98406f
44 1.3 44 1.3
45 >>> values[2] #doctest: +ELLIPSIS 45 >>> values[2] #doctest: +ELLIPSIS
46 71.5... 46 71.5...
47 >>> values[-1] 47 >>> values[-1]
48 6.0 48 6.0
49
50 >>> filterCategoricalMovingWindow([3]*3 + [4]*4, 2)
51 [3, 3, 3, 4, 4, 4, 4]
52 >>> filterCategoricalMovingWindow([3]*6 + [4], 2)
53 [3, 3, 3, 3, 3, 3, 3]
54 >>> filterCategoricalMovingWindow(['a']*3 + ['c'] + ['b']*3, 2)
55 ['a', 'a', 'a', 'b', 'b', 'b', 'b']
56 >>> filterCategoricalMovingWindow([3], 2)
57 [3]
49 58
50 >>> filterMovingWindow(arange(10), 3) 59 >>> filterMovingWindow(arange(10), 3)
51 array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.]) 60 array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
52 >>> filterMovingWindow(list(range(10)), 3) 61 >>> filterMovingWindow(list(range(10)), 3)
53 array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.]) 62 array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])