如何识别 python 中时间序列中的频繁区域

How to identify frequent regions in timeseries in python

我想识别 >2 个时间序列数据共享的频繁区域。例如,下图包含三个时间序列。图中突出显示了超过 2 个时间序列共享的频繁区域。

我不能使用直接字符串匹配,因为期望频繁区域具有完全相同的模式是不现实的。从这个意义上说,我假设使用 density based method.

的正确方法

我一直在搜索 python 可用于此任务的库。但是,我找不到在这方面可以使用的任何有用的 resource/method 。请建议我一个合适的方法来做到这一点。我在下面提到了一个示例数据集,它包含 9 个时间序列。

my_trajectories = [[0.3052181314648489, 0.30766803671106446, 0.29601888803724985, 0.29890704763215403, 0.3055833782378746, 0.2961512455811338, 0.30551879726798775, 0.2877287585539432, 0.2862261762400396, 0.27975406443649825], [0.27721407425411776, 0.26353507345946553, 0.2654882420542686, 0.26434046856886523, 0.29276053449148465, 0.2811775157932016, 0.2628070247182692, 0.26792539388555686, 0.25339224264760607, 0.2618138556904263], [0.26099953694822686, 0.261102541922727, 0.26557333180667536, 0.2819354241351113, 0.2957872369689673, 0.29080867377006003, 0.2832656933593939, 0.26600024650012716, 0.2846119520405219, 0.2736782651173511], [0.23987439985305858, 0.2327797711988322, 0.2552256800981605, 0.2667789954960524, 0.28847779023551634, 0.2547449833968282, 0.26777522392799374, 0.2828532620994906, 0.24669040792541377, 0.2652813351006664], [0.21295138061838803, 0.2157357073752202, 0.22082625636081016, 0.20495157230158634, 0.22811842227746865, 0.21918165851508642, 0.21511088624667948, 0.2179189961080439, 0.2116705241008199, 0.2089681945605301], [0.23440600639287584, 0.23669742316619335, 0.2491371139766175, 0.24643199402246801, 0.2688850352131275, 0.2599131215774288, 0.2715347562596504, 0.26625967992814115, 0.2477969521562306, 0.26945384982348486], [0.2384855324968707, 0.22215346028552016, 0.2536969645640844, 0.22652630128592377, 0.23498213798020273, 0.24837596835630332, 0.23156891079796454, 0.23566042347998292, 0.2437089617041927, 0.24771814302670092], [0.37932313040694393, 0.37932313040694393, 0.26384391236291155, 0.32481015508966876, 0.32481015508966876, 0.32481015508966876, 0.32481015508966876, 0.3609331063125676, 0.25831415976330585, 0.23075247425971726], [0.2083674033029731, 0.22567500325183854, 0.2087268790797973, 0.21335721026863355, 0.22211196073382994, 0.21189599549063626, 0.22713124614379393, 0.21554381086710045, 0.19498705204487204, 0.20674911290583015]]

如果需要,我很乐意提供更多详细信息。

您可能需要查看 Matrix 配置文件。 matrix profile foundation has plenty of code, and there is also stumpy.