apache.commons.math3.ml.clustering パッケージの DBSCANClusterer を使用しようとしていますが、成功しません。私はApache Common Math 3.4.1を使用しています
DBSCANClusterer.cluster() メソッドを実行すると、常にポイントのリストの最初のポイントに対応する 1 つのポイントを持つ 1 つのクラスターが取得されます。
public static void main(String[] args)
{
DBSCANClusterer dbscan = new DBSCANClusterer(.9,2);
List<DoublePoint> points = new ArrayList<DoublePoint>();
double[] foo = new double[2];
int i = 0;
for (i =0; i<1000 ; i++)
{
foo[0] = 10 + i;
foo[1] = 20 + i;
points.add(new DoublePoint(foo));
}
List<Cluster<DoublePoint>> cluster = dbscan.cluster(points);
// My output here is always: [1009 , 1019]
for(Cluster<DoublePoint> c: cluster){
System.out.println(c.getPoints().get(0));
}
}
私の出力は常に [1009.0, 1019.0] です。ここで何が間違っていますか?