Examples of EuclideanDistance


Examples of org.apache.commons.math3.ml.distance.EuclideanDistance

    private ClusterEvaluator<DoublePoint> evaluator;

    @Before
    public void setUp() {
        evaluator = new SumOfClusterVariances<DoublePoint>(new EuclideanDistance());
    }
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance

    /**
     * Creates a new cluster evaluator with an {@link EuclideanDistance}
     * as distance measure.
     */
    public ClusterEvaluator() {
        this(new EuclideanDistance());
    }
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance

                position4 += numberOfVariables;
            }

            for (int n = 2; n < 27; ++n) {
                KMeansPlusPlusClusterer<DoublePoint> transformer =
                    new KMeansPlusPlusClusterer<DoublePoint>(n, 100, new EuclideanDistance(), random, strategy);

                List<? extends Cluster<DoublePoint>> clusters =
                        transformer.cluster(Arrays.asList(breakingPoints));

                Assert.assertEquals(n, clusters.size());
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance

     * 2 variables cannot be clustered into 3 clusters. See issue MATH-436.
     */
    @Test(expected=NumberIsTooSmallException.class)
    public void testPerformClusterAnalysisToManyClusters() {
        KMeansPlusPlusClusterer<DoublePoint> transformer =
            new KMeansPlusPlusClusterer<DoublePoint>(3, 1, new EuclideanDistance(), random);
       
        DoublePoint[] points = new DoublePoint[] {
            new DoublePoint(new int[] {
                1959, 325100
            }), new DoublePoint(new int[] {
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance

        final FeatureInitializer init
            = new OffsetFeatureInitializer(FeatureInitializerFactory.uniform(-0.1, 0.1));
        final FeatureInitializer[] initArray = { init };

        final Network net = new NeuronString(3, false, initArray).getNetwork();
        final DistanceMeasure dist = new EuclideanDistance();

        final Set<Neuron> allBest = new HashSet<Neuron>();
        final Set<Neuron> best = new HashSet<Neuron>();
        double[][] features;
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance

     * @param minPts minimum number of points needed for a cluster
     * @throws NotPositiveException if {@code eps < 0.0} or {@code minPts < 0}
     */
    public DBSCANClusterer(final double eps, final int minPts)
        throws NotPositiveException {
        this(eps, minPts, new EuclideanDistance());
    }
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance

     * @param k the number of clusters to split the data into
     * @param maxIterations the maximum number of iterations to run the algorithm for.
     *   If negative, no maximum will be used.
     */
    public KMeansPlusPlusClusterer(final int k, final int maxIterations) {
        this(k, maxIterations, new EuclideanDistance());
    }
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance

                position4 = position4 + numberOfVariables;
            }

            for (int n = 2; n < 27; ++n) {
                KMeansPlusPlusClusterer<DoublePoint> transformer =
                    new KMeansPlusPlusClusterer<DoublePoint>(n, 100, new EuclideanDistance(), random, strategy);

                List<? extends Cluster<DoublePoint>> clusters =
                        transformer.cluster(Arrays.asList(breakingPoints));

                Assert.assertEquals(n, clusters.size());
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance

     * 2 variables cannot be clustered into 3 clusters. See issue MATH-436.
     */
    @Test(expected=NumberIsTooSmallException.class)
    public void testPerformClusterAnalysisToManyClusters() {
        KMeansPlusPlusClusterer<DoublePoint> transformer =
            new KMeansPlusPlusClusterer<DoublePoint>(3, 1, new EuclideanDistance(), random);
       
        DoublePoint[] points = new DoublePoint[] {
            new DoublePoint(new int[] {
                1959, 325100
            }), new DoublePoint(new int[] {
View Full Code Here

Examples of stallone.doubles.EuclideanDistance

        for (double d=0; d<4; d+=0.1)
        {
                DensityBasedClusteringSimple clustering = new DensityBasedClusteringSimple(d, 3);
                clustering.setInput(data);
                clustering.setMetric(new EuclideanDistance());
                clustering.perform();
                System.out.println(d+"\t"+clustering.getNumberOfClusters());
        }

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.