You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

船舶位置数据集上DBSCAN聚类结果异常问题排查

船舶坐标DBSCAN聚类异常点问题

数据集与聚类代码

数据集包含约10000个船舶坐标点,存储于86b44fe9.txt文件中,当前使用DBSCAN进行聚类的代码如下:

from sklearn.cluster import DBSCAN

file = open("86b44fe9.txt", "r")
lines = file.readlines()
x = []
for p in lines:
    poi = p.rstrip("\n").split(" ")
    x.append([float(poi[2]), float(poi[3])])

# DBSCAN参数设置
min_samples = 42
eps = 0.001 

dbscan = DBSCAN(eps, min_samples).fit(x)  # 拟合聚类模型
labels = dbscan.labels_

out_file = open("clusters.txt", "w")    
for p in range(len(lines)):
    poi = lines[p].rstrip("\n").split(" ")
    out_file.write(poi[0] + " ")
    out_file.write(poi[1] + " ")
    out_file.write(str(labels[p]))
    out_file.write("\n")
    
out_file.close() 

异常问题说明

聚类结果中出现大量黄色异常点,其中红框标注的点(如ID为10248558的点)不符合预期。曾考虑是否因使用欧氏距离而非Haversine距离导致该问题,但目前暂不认为是此原因。

船舶聚类结果可视化


内容的提问来源于stack exchange,提问作者banbar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 18:56:01