基于社区检测的网络时间序列聚类

参照 Time series clustering via community detection in networks

摘要
(1)首先,我们提出了一种利用不同距离函数将一组时间序列转化为网络的方法,其中每个时间序列都由一个顶点表示,而最相似的被连接起来。
(2)然后,我们应用社区检测算法识别强连通顶点组(称为社区),从而识别时间序列簇。
(3)本文还对时间序列距离函数、网络生成方法和社区检测技术的各种组合对聚类结果的影响进行了综合分析。实验研究表明,所提出的基于网络的聚类方法比所考虑的各种经典或最新的聚类技术取得了更好的结果。
(4)统计检验表明,该方法的聚类性能优于经典聚类算法,如k-medoid算法、Diana聚类算法、中值聚类算法和质心聚类算法。有趣的是,由于在聚类过程中构造的底层网络的拓扑结构,他提出的方法能够有效地检测时间序列中的形状模式。
(5)此外,所提出的方法具有足够的鲁棒性,能够使时间序列呈现相似的模式,但随时间移动和/或幅度的变化而变化。总结性 该方法的重点是时间序列从时空域到拓扑域的变换。因此,我们希望我们的方法不仅对时间序列有所贡献,也适用于一般的时间序列分析任务。
1.引言
背景和相关的工作
在这一部分中,我们回顾了时间序列聚类的三个主要组成部分:时间序列距离度量、聚类算法和网络中的社区检测。
时间序列距离度量
聚类算法:时间序列聚类算法大致可分为两种方法:数据自适应和算法自适应。前者从每个时间序列数据中提取特征数组,然后应用传统的聚类算法。后者修改了传统的聚类算法,使之成为一种新的聚类算法
3.提出的算法的描述
算法的直觉:每条时间序列代表一个节点,把相似的时间序列分为一个社区
每条时间序列代表一个节点,把相似的时间序列分为一个社区
算法的流程(1)时间序列正则化(2)距离矩阵D的构造,dij是时间序列xi和xj之间的相似性
算法的流程(1)时间序列正则化(2)距离矩阵D的构造,dij是时间序列xi和xj之间的相似性(3)把距离矩阵D构造成一个网络,使用k-nn和ε-NN,在这种情况下,每个样本都表示为一个顶点,并连接到它的k个最相似的顶点。这类网络被称为k-最近邻网络(k-NN).以类似的方式,网络也可以 构造时考虑了阈值ε。在这种情况下,如果每个节点之间的相似度高于ε,则每对节点都是连接的。以这种方式构造的网络称为ε-neares。 T neighbor networks (ε-NN)(4)社区检测
4.实验评价
4.1实验设置
实验的目的是检验时间序列距离度量,聚类算法和网络中的社区检测的各个组合的性能。为了比较结果
(正确结果的百分比),用RI
在这里插入图片描述
4.2实验结果

# read dataset
ts_dataset = read.csv("G:/社区检测算法/1/time_series_clustering_via_community_detection-gh-pages/dataset/dataset.csv")
# get time series labels
labels = ts_dataset$class
# remove time series labels
ts_dataset$class = NULL
# transform it into a list 
ts_list = lapply(1:nrow(ts_dataset), function(i) ts_dataset[i,])
# for every plot, the user should press 'enter' to see the next plot
par(ask=T)
# plot the dataset
matplot(t(ts_dataset), pch=1, lty=1, t="l", xlab="time", ylab="value", main="Time series dataset", col=c(rep(2,10),rep(4,10)))

20条时间序列数据如下:
在这里插入图片描述

# calculate the distances for every pair of time series using DTW. 
# You can choose anyone distance function in tsDist.R or write your own one.
ts_dist = dist.parallel(tsList = ts_list, distFunc = tsdiss.dtw, cores = 1)
# Dist matrix normalization
ts_dist = dist.normalize(ts_dist)
# plot the distance matrix
heatmap(ts_dist, main = "Distance matrix")

在这里插入图片描述

# create the network connecting the k = 5 nearest neighbors (shortest distances)
net = net.knn.create(dist = ts_dist, k = 5)
# get the net layout, just to plot the network nodes in the same position
net_layout = layout_components(net)
# plot the network
plot(net, layout=net_layout)
# community detection using 
communities = cluster_louvain(net)
# plot communities
plot(communities, net, layout=net_layout)

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_41106162/article/details/89737461
今日推荐