寻找趋势 block 的算法

标签 algorithm machine-learning cluster-analysis data-mining windows-clustering

假设我有 24 行数据,每行代表一天中的一个小时。我想要实现的是实现一种算法,该算法可以检测数据趋势并将其分为 2 个 block ——一个“好” block 和一个“坏” block 。例如,在附图中,您可以看到在第 6 行,一个好的 block 在第 19 行开始和结束。第 0 行也有一个很好的分数,但它不是 block 的一部分,所以算法应该知道如何处理这种情况。 我认为它与集群有关,但找不到满足我们需求的足够简单的东西。 期待任何建议。

enter image description here

最佳答案

start = -1
Append a below-threshold value to the end of the data array x[]
For i from 1 to n:
    If x[i] >= thresholdValue:
        if start == -1:
            start = i
    Else:
        If start != -1 and i - start >= thresholdLength:
            ReportGoodBlock(start, i-1)
        start = -1

关于寻找趋势 block 的算法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35840536/

相关文章:

cluster-computing - Neo4j 和聚类分析

algorithm - 大十进制整数中的位数

algorithm - 找到完全改变累积和集的排列

algorithm - 找到第n个比较

python - 跨时间暗淡的每个网格单元的线性回归

python-3.x - CountVectorizer 中的 fit() 有何意义?

java - 返回 (a, b) 对的总数,其中 a 来自 A,b 来自 B,且 a + b <= c

python - 如何使用 matplotlib 绘制 Kmeans 文本聚类结果?

python - 在聚类中找到异常值的标识

Python 绘图簇 : high data dimension