时间序列聚类:改变动态时间扭曲的扭曲窗口

发布于 2025-02-12 00:26:04 字数 402 浏览 3 评论 0原文

我正在研究相同类型的数据,我想对《时代》系列进行分类以查找清晰的使用模式。 我的数据是从一家电信公司的客户那里收集的,我们希望检测使用其WiFi框消费的数据量的模式。因此,每个客户都有一个时间序列,每6分钟都消耗了多少数据(我将其重新采样到数小时)。 我还使用tslearn使用kmeanstimeseries将DTW应用于:

km = TimeSeriesKMeans(n_clusters = cluster_count, metric="dtw", verbose=1)
labels = km.fit_predict(mySeries)

我的问题是我想更改python中DTW的翘曲窗口,我很确定这很容易,但是我只是找不到coud coud一种做到这一点的方法。我还想找到最佳的窗口参数。

I'm working on the same type of data and i want to classify the times series to find clear pattern of use.
My data is collected from clients of a telecom company, and we want to detect pattern of the amount of data consumed by clients with their wifi box. So each client have a time series of how much data he consumed each 6minutes (I resampled it to hours).
I also applied DTW with KmeansTimeSeries using tslearn:

km = TimeSeriesKMeans(n_clusters = cluster_count, metric="dtw", verbose=1)
labels = km.fit_predict(mySeries)

My question is i want to change the warping window for DTW in python, and i'm pretty sure it's easy think to do, but i just coudn't find a way to do it. I also want to find the best window parameter for my case.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟燃烟灭 2025-02-19 00:26:04

假设您在谈论Tslearn软件包,我们可以查看 limeserieskmeans

这些参数详细描述为:

公制:{“ euclidean”,“ dtw”,“ softdtw”}(默认值:“ euclidean”)metric
用于集群分配和Barycenter计算。如果
“ DTW”,DBA用于barycenter计算。

metric_params :dict或none(默认:无)参数值
选定的度量标准。对于接受并行化的指标
跨距离矩阵计算,n_jobs密钥在metric_params中传递

被N_JOBS参数覆盖。

因此我们可以将参数传递给度量标准。然后,然后研究 dtw公制提供,我们找到的地方

global_constraint: {“ itakura”,“ sakoe_chiba”}或无(默认:无)
全球限制限制DTW的可允许途径。

sakoe_chiba_radius: int或无(默认:无)用于用于
Sakoe-Chiba乐队全球约束。如果没有,global_constraint是
设置为“ sakoe_chiba”,使用1个半径为1。如果这两个
设置了Sakoe_chiba_radius和itakura_max_slope,global_constraint是
用于推断两者之间使用哪个约束。在这种情况下,如果
global_constraint对应于没有全局约束,一个
升级运行时沃宁,没有使用全局约束。

itakura_max_slope: float或none(默认:无)最大斜率
itakura平行四边形约束。如果没有,global_constraint是
设置为“ itakura”,最大斜率为2。如果这两个
设置了Sakoe_chiba_radius和itakura_max_slope,global_constraint是
用于推断两者之间使用哪个约束。在这种情况下,如果
global_constraint对应于没有全局约束,一个
升级运行时沃宁,没有使用全局约束。

因此,我建议您打电话

km = TimeSeriesKMeans(n_clusters = cluster_count, metric="dtw", metric_params = {global_constraint:“itakura”} verbose=1)

Assuming that you are talking about the tslearn package, we can have a look into the documentation of TimeSeriesKMeans.

The parameters are described in detail as:

metric : {“euclidean”, “dtw”, “softdtw”} (default: “euclidean”) Metric
to be used for both cluster assignment and barycenter computation. If
“dtw”, DBA is used for barycenter computation.

metric_params : dict or None (default: None) Parameter values for the
chosen metric. For metrics that accept parallelization of the
cross-distance matrix computations, n_jobs key passed in metric_params
is overridden by the n_jobs argument.

So we can pass parameters to the metric. Lets then investigate the parameters that the dtw metric offers, where we find

global_constraint : {“itakura”, “sakoe_chiba”} or None (default: None)
Global constraint to restrict admissible paths for DTW.

sakoe_chiba_radius : int or None (default: None) Radius to be used for
Sakoe-Chiba band global constraint. If None and global_constraint is
set to “sakoe_chiba”, a radius of 1 is used. If both
sakoe_chiba_radius and itakura_max_slope are set, global_constraint is
used to infer which constraint to use among the two. In this case, if
global_constraint corresponds to no global constraint, a
RuntimeWarning is raised and no global constraint is used.

itakura_max_slope : float or None (default: None) Maximum slope for
the Itakura parallelogram constraint. If None and global_constraint is
set to “itakura”, a maximum slope of 2. is used. If both
sakoe_chiba_radius and itakura_max_slope are set, global_constraint is
used to infer which constraint to use among the two. In this case, if
global_constraint corresponds to no global constraint, a
RuntimeWarning is raised and no global constraint is used.

Thus, I suggest you call

km = TimeSeriesKMeans(n_clusters = cluster_count, metric="dtw", metric_params = {global_constraint:“itakura”} verbose=1)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文