parent
3411f29e23
commit
880b04814c
|
@ -46,7 +46,7 @@ import org.apache.commons.math4.ml.clustering.DBSCANClusterer;
|
||||||
import org.apache.commons.math4.ml.clustering.DoublePoint;
|
import org.apache.commons.math4.ml.clustering.DoublePoint;
|
||||||
import org.apache.commons.math4.ml.clustering.FuzzyKMeansClusterer;
|
import org.apache.commons.math4.ml.clustering.FuzzyKMeansClusterer;
|
||||||
import org.apache.commons.math4.ml.clustering.KMeansPlusPlusClusterer;
|
import org.apache.commons.math4.ml.clustering.KMeansPlusPlusClusterer;
|
||||||
import org.apache.commons.math4.random.RandomAdaptor;
|
import org.apache.commons.math4.random.JDKRandomAdaptor;
|
||||||
import org.apache.commons.math4.random.SobolSequenceGenerator;
|
import org.apache.commons.math4.random.SobolSequenceGenerator;
|
||||||
import org.apache.commons.math4.rng.UniformRandomProvider;
|
import org.apache.commons.math4.rng.UniformRandomProvider;
|
||||||
import org.apache.commons.math4.rng.RandomSource;
|
import org.apache.commons.math4.rng.RandomSource;
|
||||||
|
@ -84,8 +84,7 @@ public class ClusterAlgorithmComparison {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shuffle) {
|
if (shuffle) {
|
||||||
// Collections.shuffle(points, new RandomAdaptor(rng)); // XXX TODO
|
Collections.shuffle(points, new JDKRandomAdaptor(rng));
|
||||||
Collections.shuffle(points); // XXX temporary workaround
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return points;
|
return points;
|
||||||
|
@ -115,8 +114,7 @@ public class ClusterAlgorithmComparison {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shuffle) {
|
if (shuffle) {
|
||||||
// Collections.shuffle(points, new RandomAdaptor(rng)); // XXX TODO
|
Collections.shuffle(points, new JDKRandomAdaptor(rng));
|
||||||
Collections.shuffle(points); // XXX temporary workaround
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return points;
|
return points;
|
||||||
|
@ -153,8 +151,7 @@ public class ClusterAlgorithmComparison {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shuffle) {
|
if (shuffle) {
|
||||||
// Collections.shuffle(points, new RandomAdaptor(rng)); // XXX TODO
|
Collections.shuffle(points, new JDKRandomAdaptor(rng));
|
||||||
Collections.shuffle(points); // XXX temporary workaround
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return points;
|
return points;
|
||||||
|
@ -207,7 +204,8 @@ public class ClusterAlgorithmComparison {
|
||||||
|
|
||||||
int nSamples = 1500;
|
int nSamples = 1500;
|
||||||
|
|
||||||
UniformRandomProvider rng = RandomSource.create(RandomSource.WELL_19937_C, 0);
|
final long seed = RandomSource.createLong(); // Random seed.
|
||||||
|
UniformRandomProvider rng = RandomSource.create(RandomSource.WELL_19937_C, seed);
|
||||||
List<List<DoublePoint>> datasets = new ArrayList<List<DoublePoint>>();
|
List<List<DoublePoint>> datasets = new ArrayList<List<DoublePoint>>();
|
||||||
|
|
||||||
datasets.add(normalize(makeCircles(nSamples, true, 0.04, 0.5, rng), -1, 1, -1, 1));
|
datasets.add(normalize(makeCircles(nSamples, true, 0.04, 0.5, rng), -1, 1, -1, 1));
|
||||||
|
|
Loading…
Reference in New Issue