scikit-learn DBSCAN 実装のカスタム クラスタリング関数を指定しようとしています。
def geodistance(latLngA, latLngB):
print latLngA, latLngB
return vincenty(latLngA, latLngB).miles
cluster_labels = DBSCAN(
eps=500,
min_samples=max(2, len(found_geopoints)/10),
metric=geodistance
).fit(np.array(found_geopoints)).labels_
ただし、距離関数への引数を出力すると、期待したものとはまったく異なります。
[ 0.53084126 0.19584111 0.99640966 0.88013373 0.33753788 0.79983037
0.71716144 0.85832664 0.63559538 0.23032912]
[ 0.53084126 0.19584111 0.99640966 0.88013373 0.33753788 0.79983037
0.71716144 0.85832664 0.63559538 0.23032912]
これは私の found_geopoints 配列がどのように見えるかです:
[[ 4.24680600e+01 1.40868060e+02]
[ -2.97677600e+01 -6.20477000e+01]
[ 3.97550400e+01 2.90069000e+00]
[ 4.21144200e+01 1.43442500e+01]
[ 8.56111000e+00 1.24771390e+02]
...
では、距離関数の引数が緯度経度のペアではないのはなぜですか?