Examples of DoublePoint


Examples of org.apache.commons.math3.ml.clustering.DoublePoint

            }
        }
        for (int i = 0; i < centroid.length; i++) {
            centroid[i] /= points.size();
        }
        return new DoublePoint(centroid);
    }
View Full Code Here

Examples of org.apache.commons.math3.ml.clustering.DoublePoint

    }

    @Test
    public void testScore() {
        final DoublePoint[] points1 = new DoublePoint[] {
                new DoublePoint(new double[] { 1 }),
                new DoublePoint(new double[] { 2 }),
                new DoublePoint(new double[] { 3 })
        };

        final DoublePoint[] points2 = new DoublePoint[] {
                new DoublePoint(new double[] { 1 }),
                new DoublePoint(new double[] { 5 }),
                new DoublePoint(new double[] { 10 })
        };

        final List<Cluster<DoublePoint>> clusters = new ArrayList<Cluster<DoublePoint>>();
       
        final Cluster<DoublePoint> cluster1 = new Cluster<DoublePoint>();
View Full Code Here

Examples of org.apache.commons.math3.ml.clustering.DoublePoint

            }
        }
        for (int i = 0; i < centroid.length; i++) {
            centroid[i] /= points.size();
        }
        return new DoublePoint(centroid);
    }
View Full Code Here

Examples of org.apache.commons.math3.ml.clustering.DoublePoint

        List<DoublePoint> points = new ArrayList<DoublePoint>();
        for (Vector2D p : input) {
            double[] arr = p.toArray();
            arr[0] = (arr[0] - minX) / rangeX * 2 - 1;
            arr[1] = (arr[1] - minY) / rangeY * 2 - 1;
            points.add(new DoublePoint(arr));
        }
        return points;
    }
View Full Code Here

Examples of org.apache.commons.math3.ml.clustering.DoublePoint

            return new Dimension(150, 150);
        }

        private Clusterable transform(Clusterable point, int width, int height) {
            double[] arr = point.getPoint();
            return new DoublePoint(new double[] { PAD + (arr[0] + 1) / 2.0 * (width - 2 * PAD),
                                                  height - PAD - (arr[1] + 1) / 2.0 * (height - 2 * PAD) });
        }
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.