Examples of Clusterable


Examples of com.alibaba.simpleimage.analyze.search.cluster.Clusterable

                InterestPointInfoWriter.writeComplete(featfile, info);
            }

            Iterator<SURFInterestPoint> itr = surfPoints.iterator();
            while (itr.hasNext()) {
                Clusterable next = itr.next();
                if (next != null) {
                    if (count % useEvery == 0) {
                        points.add(next);
                    }
                    count++;
View Full Code Here

Examples of com.alibaba.simpleimage.analyze.search.cluster.Clusterable

        // long end = 0;
        // long cost = 0;
        // start = System.currentTimeMillis();
        for (int j = 0; j < values.size(); j++) {
            // start = System.currentTimeMillis();
            Clusterable val = values.get(j);
            // end = System.currentTimeMillis();
            // start = System.currentTimeMillis();
            Clusterable nearestCluster = null;
            float minDistance = Float.MAX_VALUE;
            for (int i = 0; i < clusters.length; i++) {
                Clusterable cluster = clusters[i];
                float distance = ClusterUtils.getEuclideanDistance(val, cluster);

                if (distance < minDistance) {
                    nearestCluster = cluster;
                    minDistance = distance;
View Full Code Here

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

    public double score(final List<? extends Cluster<T>> clusters) {
        double varianceSum = 0.0;
        for (final Cluster<T> cluster : clusters) {
            if (!cluster.getPoints().isEmpty()) {

                final Clusterable center = centroidOf(cluster);

                // compute the distance variance of the current cluster
                final Variance stat = new Variance();
                for (final T point : cluster.getPoints()) {
                    stat.increment(distance(point, center));
View Full Code Here

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

    public double score(final List<? extends Cluster<T>> clusters) {
        double varianceSum = 0.0;
        for (final Cluster<T> cluster : clusters) {
            if (!cluster.getPoints().isEmpty()) {

                final Clusterable center = centroidOf(cluster);

                // compute the distance variance of the current cluster
                final Variance stat = new Variance();
                for (final T point : cluster.getPoints()) {
                    stat.increment(distance(point, center));
View Full Code Here

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

            int index = 0;
            Color[] colors = new Color[] { Color.red, Color.blue, Color.green.darker() };
            for (Cluster<DoublePoint> cluster : clusters) {
                g2.setPaint(colors[index++]);
                for (DoublePoint point : cluster.getPoints()) {
                    Clusterable p = transform(point, w, h);
                    double[] arr = p.getPoint();
                    g2.fill(new Ellipse2D.Double(arr[0] - 1, arr[1] - 1, 3, 3));
                }
               
                if (cluster instanceof CentroidCluster) {
                    Clusterable p = transform(((CentroidCluster<?>) cluster).getCenter(), w, h);
                    double[] arr = p.getPoint();
                    Shape s = new Ellipse2D.Double(arr[0] - 4, arr[1] - 4, 8, 8);
                    g2.fill(s);
                    g2.setPaint(Color.black);
                    g2.draw(s);
                }
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.