Codota Logo
StandardKMeans_F64.matchPointsToClusters
Code IndexAdd Codota to your IDE (free)

How to use
matchPointsToClusters
method
in
org.ddogleg.clustering.kmeans.StandardKMeans_F64

Best Java code snippets using org.ddogleg.clustering.kmeans.StandardKMeans_F64.matchPointsToClusters (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: org.ddogleg/ddogleg

matchPointsToClusters(points);
origin: lessthanoptimal/ddogleg

matchPointsToClusters(points);
origin: lessthanoptimal/ddogleg

@Test
public void matchPointsToClusters() {
  StandardKMeans_F64 alg = new StandardKMeans_F64(100,100,1,new InitializeStandard_F64());
  alg.init(4, 123);
  alg.clusters.resize(3);
  alg.workClusters.resize(3);
  alg.memberCount.resize(3);
  alg.clusters.data[0] = new double[]{20,0,0,0};
  alg.clusters.data[1] = new double[]{0,20,0,0};
  alg.clusters.data[2] = new double[]{0,0,20,0};
  List<double[]> points = new ArrayList<double[]>();
  points.add( new double[]{20,5,0,0});
  points.add( new double[]{25,-4,0,0});
  points.add( new double[]{0,0,22,0});
  alg.matchPointsToClusters(points);
  assertEquals(2,alg.memberCount.get(0));
  assertEquals(0,alg.memberCount.get(1));
  assertEquals(1,alg.memberCount.get(2));
  assertEquals(45,alg.workClusters.data[0][0],1e-8);
  assertEquals(1 ,alg.workClusters.data[0][1],1e-8);
  assertEquals(0 ,alg.workClusters.data[0][2],1e-8);
  assertEquals(0 ,alg.workClusters.data[0][3],1e-8);
  assertEquals(0 ,alg.workClusters.data[1][1],1e-8);
  assertEquals(22,alg.workClusters.data[2][2],1e-8);
}
org.ddogleg.clustering.kmeansStandardKMeans_F64matchPointsToClusters

Javadoc

Finds the cluster which is the closest to each point. The point is the added to the sum for the cluster and its member count incremented

Popular methods of StandardKMeans_F64

  • <init>
    Configures k-means parameters
  • distanceSq
    Returns the euclidean distance squared between the two poits
  • init
  • updateClusterCenters
    Sets the location of each cluster to the average location of all its members.
  • createQueue
  • findBestMatch
    Searches for this cluster which is the closest to p
  • getClusterMeans
    Returns the mean of each cluster
  • getPointLabels
    Returns the labels assigned to each point
  • process
  • setVerbose

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JButton (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now