The example data is as follows:
data = RandomInteger[{0, 50}, {50, 4}];
I have defined a distance function myself (as shown below), but the response cannot be computed (FindClusters::wrgdist: The distance function dist cannot be computed on the data. ); how should I modify it?
dist[{x1_, x2_, x3_, x4_}, {y1_, y2_, y3_, y4_}] :=
N@Norm[#] &@
Flatten@{Abs@(If[#[[2]] != 0, #[[1]]/#[[2]],
10000@#[[1]]]), #[[3]]} &@{Differences[{#[[1, 1]], #[[2,
1]]}], Differences[{#[[1, 2]], #[[2, 2]]}], #[[2,
1]]} &@{{x3, x4}, {y3, y4}};
FindClusters[data, 2, DistanceFunction -> dist]