diff 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
line wrap: on
line diff
--- a/trafficintelligence/tests/utils.txt	Wed Jun 19 16:11:35 2024 -0400
+++ b/trafficintelligence/tests/utils.txt	Tue Jun 25 16:40:40 2024 -0400
@@ -47,6 +47,15 @@
 >>> values[-1]
 6.0
 
+>>> filterCategoricalMovingWindow([3]*3 + [4]*4, 2)
+[3, 3, 3, 4, 4, 4, 4]
+>>> filterCategoricalMovingWindow([3]*6 + [4], 2)
+[3, 3, 3, 3, 3, 3, 3]
+>>> filterCategoricalMovingWindow(['a']*3 + ['c'] + ['b']*3, 2)
+['a', 'a', 'a', 'b', 'b', 'b', 'b']
+>>> filterCategoricalMovingWindow([3], 2)
+[3]
+
 >>> filterMovingWindow(arange(10), 3)
 array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
 >>> filterMovingWindow(list(range(10)), 3)