clust4j icon indicating copy to clipboard operation
clust4j copied to clipboard

changing Distance has no effect

Open localdevjs opened this issue 7 years ago • 1 comments

This data is a double[], where each value is a "foot above sea level". We might have 14,000 values, spanning from 100 feet to 8500 feet (for example).

We are evaluating dbscan and meanshift as a way to detect clusters in this data, even though it is only 1 dimensional.

This does work, but we have tried using different Distances found in this class: com.clust4j.metrics.pairwise.Distance

However switching the Distances has no effect on the clustering results. We get the same clustering regardless of which Distance is used.

Does that sound normal or am I missing something and using the library incorrectly?

double[] data = ...
MeanShiftParameters p = new MeanShiftParameters();
p.setMetric(Distance.valueOf("EUCLIDEAN"));
RealMatrix mat = new Array2DRowRealMatrix(data);
MeanShift ms = p.fitNewModel(mat);

Thanks!

localdevjs avatar Sep 20 '18 15:09 localdevjs

Hey there, thanks for the issue. Can you provide a sample of your data for me to work with? (Or would randomly creating values between 100 to 8500 suffice?)

tgsmith61591 avatar Sep 22 '18 15:09 tgsmith61591