【发布时间】:2021-08-18 19:18:37
【问题描述】:
我正在尝试使用 R 应用聚类算法。 我还阅读了在 R 中应用 dbscan 的基本介绍。 我的数据是开始/结束位置和时间(超过 50k 行)。
示例如下:
# A tibble: 10 x 6
start_location_Long start_location_Lat end_location_Long end_location_Lat start_time1_cos end_time1_cos
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 101. 13.9 101. 13.9 -0.978 -0.998
2 101. 13.9 101. 13.8 -0.465 0.503
3 101. 13.9 101. 13.9 -0.756 -0.982
4 101. 13.8 101. 13.8 -0.827 -0.773
5 101. 13.8 101. 13.8 -0.956 -0.949
6 101. 13.8 101. 13.8 -0.969 -0.961
7 101. 13.8 101. 13.8 -0.946 -0.521
8 101. 13.8 101. 13.7 -0.972 -0.910
9 101. 13.7 101. 13.7 -0.840 -0.837
10 101. 13.8 101. 13.7 -0.497 -0.313
data <- structure(list(start_location_Long = c(100.60066, 100.60039,100.56864, 100.59018, 100.55926, 100.61014, 100.61504, 100.75646,100.56093, 100.52679), start_location_Lat = c(13.91761, 13.91746,13.88542, 13.7969, 13.83207, 13.82256, 13.80237, 13.82296, 13.73084,13.76592), end_location_Long = c(100.59982, 100.53864, 100.57354,100.59309, 100.56502, 100.56652, 100.65582, 100.73325, 100.56094,100.53465), end_location_Lat = c(13.91616, 13.8288, 13.86449,13.84172, 13.82841, 13.82762, 13.82176, 13.72228, 13.73224, 13.74595), start_time1_cos = c(-0.977783236758606, -0.464584475495966,-0.756281834105734, -0.827489114105152, -0.955963918764982, -0.968565073328525,-0.946485086708269, -0.971772589428584, -0.839856789165117, -0.497478722371776), end_time1_cos = c(-0.998416312411851, 0.502642787734849, -0.98199994355324,-0.772641247513493, -0.949334100771872, -0.960940326679488, -0.521319957219796,-0.910443172287846, -0.837480354951308, -0.313301931309727)), row.names = c(NA,-10L), class = c("tbl_df", "tbl", "data.frame"))
基于此张贴Choosing eps and minpts for DBSCAN (R)? 我缩放了我的数据并尝试将 minpts 用作 4 并从 KNN 距离中找到 eps。
但是,即使我多次尝试更改 minpts 和 eps,我的聚类结果也总是合并为一组。
因此,任何有使用 dbscan 算法的经验的人请帮助我。如何聚类?因为我的数据很大,简单的数据可能帮不上忙,所以我也提供了原始数据here
提前谢谢你。
【问题讨论】:
标签: r cluster-analysis dbscan