Tabnine Logo
IntHeapSelect.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
smile.sort.IntHeapSelect

Best Java code snippets using smile.sort.IntHeapSelect.get (Showing top 1 results out of 315)

origin: com.github.haifengl/smile-core

/**
 * Cuts a tree into several groups by specifying the desired number.
 * @param k the number of clusters.
 * @return the cluster label of each sample.
 */
public int[] partition(int k) {
  int n = merge.length + 1;
  int[] membership = new int[n];
  IntHeapSelect heap = new IntHeapSelect(k);
  for (int i = 2; i <= k; i++) {
    heap.add(merge[n - i][0]);
    heap.add(merge[n - i][1]);
  }
  for (int i = 0; i < k; i++) {
    bfs(membership, heap.get(i), i);
  }
  return membership;
}
smile.sortIntHeapSelectget

Javadoc

Returns the i-th smallest value seen so far. i = 0 returns the smallest value seen, i = 1 the second largest, ..., i = k-1 the last position tracked. Also, i must be less than the number of previous assimilated.

Popular methods of IntHeapSelect

  • <init>
    Constructor.
  • add
    Assimilate a new value from the stream.
  • heapify
    Place the array in max-heap order. Note that the array is not fully sorted.
  • sort
    Sorts the specified array into descending order. It is based on Shell sort, which is very efficient

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • getContentResolver (Context)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now