【问题标题】:How to see ELKI DBSCAN clustering result如何查看 ELKI DBSCAN 聚类结果
【发布时间】:2014-07-10 02:55:41
【问题描述】:

我正在使用 ELKI 对大约 14,000 个 GPS 点进行 DBSCAN 聚类。它运行良好,但我想查看有关聚类的信息,例如聚类中有多少点。?

【问题讨论】:

    标签: cluster-analysis data-mining dbscan elki


    【解决方案1】:

    如果使用 -resulthandler ResultWriter 并输出为文本,则簇大小将位于每个簇文件的顶部。

    另外,如果你想将所有这些结果合并到一个文件中,这里有一个可以工作的 python 脚本:

    clusterout_path = "path/to/where/files/all/go/"
    finalout_path = "/path/for/single/merged/file/"
    consol_filename= "single_merged_file.txt"
    
    cll_file = open(finalout_path + consol_filename,"a")
    cll_file.write("ClusterID"+ "\t" + "Lon" + "\t" + "Lat" + "\n")
    def readFile(file):
        f = open(clusterout_path + file)
        counter = 0
        cluster = ""
        lon = ""
        lat = ""
        for line in f.readlines():
            counter+=1
            if counter == 1:
                cluster = line.split(":")[1].strip().lower()
    
            if counter > 4 and line.startswith("ID"):
                arr = line.split(" ")
                lon = arr[1]
                lat = arr[2]
                cll_file.write(cluster + "\t" + lon + "\t" + lat + "\n") 
        f.close()
    
    listing = os.listdir(clusterout_path)
    for infile in listing:
        print "Processing file: " + infile
        readFile(infile) 
    
    cll_file.close()
    

    【讨论】:

      【解决方案2】:

      如果您使用-resulthandler ResultWriter 并输出为文本,则簇大小将位于每个簇文件的顶部。

      可视化工具目前似乎没有显示集群大小。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-01-12
        • 1970-01-01
        • 2014-07-17
        • 2017-09-04
        • 2023-03-15
        • 1970-01-01
        • 1970-01-01
        • 2020-03-13
        相关资源
        最近更新 更多