Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 一维信号聚类_Python_Cluster Analysis_Scikit Learn - Fatal编程技术网

Python 一维信号聚类

Python 一维信号聚类,python,cluster-analysis,scikit-learn,Python,Cluster Analysis,Scikit Learn,我有几个一维信号,显示两个或更多波段。下面是一个例子。 我需要提取属于单个频带的数据点 我的第一个简单方法是对数据进行移动平均,得到数据大于平均值的指数 def seperate(x): average = scipy.ndimage.gaussian_filter(x, 10) # this gives me a boolean array with the indices of the upper band. idx = x > average #

我有几个一维信号,显示两个或更多波段。下面是一个例子。

我需要提取属于单个频带的数据点


我的第一个简单方法是对数据进行移动平均,得到数据大于平均值的指数

def seperate(x):
    average = scipy.ndimage.gaussian_filter(x, 10)
    # this gives me a boolean array with the indices of the upper band.
    idx = x > average
    # return the indices of the upper and lower band
    return idx, ~idx
绘制这些曲线和平均曲线将如下所示,其中红色表示上部,蓝色表示下部

这在本例中效果很好,但当存在两个以上的频带和/或频带没有很好地分开时,则会失败


我正在寻找一个更健壮、更通用的解决方案。我正在研究scikit learn,想知道是否可以使用一种聚类算法来实现这一点。

看一看时间序列相似性度量

事实上,我见过你在那里尝试过的二元阈值法,叫做“阈值交叉”,还有更多

一般来说,不存在“一刀切”的时间序列相似性。不同类型的信号需要不同的措施。这一点可以从以下事实中得到最好的体现:一些在FFT之后进行了更好的分析,而另一些FFT则毫无意义