import unittest
from pyeeg import information_based_similarity
class InformationBasedSimilarityTests(unittest.TestCase):
def test_information_based_similarity(self):
x_axis_data = [
0.16098749, 0.17692958, -1.81950537, 0.33561288, 0.40291009,
-0.13148819, -1.21536256, -1.08481235, -0.21487062, -0.81384572,
0.49025693, -0.95941054, -0.5643706, -1.19146385, 1.04563275,
-0.31872928, 0.56111021, 1.87073953, -1.28776991, -0.7751325,
0.30841261, -1.15163104, 0.79371283, 2.24722208, -0.93464575,
-0.66843521, 0.5917969, 0.77809267, 0.55931622, -1.39641768,
1.58531242, 0.58656892, -0.31532364, 0.13598254, -0.53946447,
-1.49558044, -0.63693475, 1.29578787, -0.13373468, -1.03400281,
-0.67983219, 0.16221873, 1.53821019, -0.11938391, 1.21657004,
-0.1920458, 1.40564056, 1.15128355, -0.33193437, 1.29209686,
1.04658007, 0.04220999, 1.27969761, 0.22240636, -1.02273562,
-1.28145474, -1.73571824, -0.3166042, 0.46752785, -0.62505572,
0.7890322, 1.5252607, -0.13748426, -1.95247665, -0.05956672,
-0.28094525, -1.9678474, 0.19124261, -0.39106891, -0.56257509,
-0.32465297, -1.62583327, -0.3542932, -0.64414968, -0.65452741,
0.37574931, -0.49688922, -0.07037562, -2.05893691, 0.06086633,
-0.54422023, -0.54132022, -0.70246688, 0.12909285, 0.56746142,
0.45833448, -0.7760291, -1.98159666, 0.69102227, -0.37879553,
-1.77152359, -1.09826121, 0.60743068, -0.80848143, 1.36366829,
-1.22787525, -0.21834009, -0.62767535, -0.97495622, 1.84789436
]
y_axis_data = [
-0.25445107, -0.60882641, -0.77998597, -0.57995904, 1.64100167,
-1.60364241, 1.70536049, 0.31079375, 0.99108882, -2.9507694,
-1.26561011, -0.20977681, -2.41021991, -0.5247534, -0.09417403,
1.88258898, -2.18559031, 1.62417099, 0.76095466, 0.30148008,
1.34264681, -0.60959223, 0.11269381, 0.75072293, -0.01133381,
1.29521933, -0.49596373, 0.08015857, -0.63720742, -0.63689909,
-0.40723797, 0.05403306, 1.54368196, 0.64176921, -1.20655783,
-1.09622567, 1.83186385, 0.61029403, -0.80470078, 0.29027348,
-0.67167157, 0.96395387, -0.5710966, 0.23083643, -0.02464553,
0.51964705, 0.22153853, -0.43861145, 0.57767866, -2.50709032,
0.56876212, -0.05799226, -0.85173653, -0.61042222, 1.31170402,
-0.31291646, -0.44432741, -0.7150911, 0.80983862, -0.89431059,
0.70870062, 1.36517003, 0.15736342, -0.03805528, 0.51892929,
1.24219431, -0.94921759, 2.10609206, -0.58696224, -1.33394959,
0.00510772, 0.2709552, -0.08236258, -2.4057175, -1.26220379,
0.72681967, 0.41556896, -0.3481339, -0.74691867, 0.8221449,
0.62641517, -1.04556923, -0.83185258, 0.77643477, 0.06690493,
-0.22541358, -0.57588397, 0.29827298, 1.27063634, -1.26317499,
1.73526005, -1.05339668, -0.94503578, 0.28044202, 0.83457606,
0.3705322, -0.96882525, 0.30503691, -0.71220423, 0.49516661
]
self.assertEqual(
information_based_similarity(x_axis_data, y_axis_data, 8),
0.50445013843666031
)
if __name__ == '__main__':
unittest.main()