Codota Logo
HeapSelect.<init>
Code IndexAdd Codota to your IDE (free)

How to use
smile.sort.HeapSelect
constructor

Best Java code snippets using smile.sort.HeapSelect.<init> (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: com.github.haifengl/smile-core

@Override
public Neighbor<double[], E>[] knn(double[] q, int k) {
  if (k <= 0) {
    throw new IllegalArgumentException("Invalid k: " + k);
  }
  if (k > keys.length) {
    throw new IllegalArgumentException("Neighbor array length is larger than the dataset size");
  }
  Neighbor<double[], E> neighbor = new Neighbor<>(null, null, 0, Double.MAX_VALUE);
  @SuppressWarnings("unchecked")
  Neighbor<double[], E>[] neighbors = (Neighbor<double[], E>[]) java.lang.reflect.Array.newInstance(neighbor.getClass(), k);
  HeapSelect<Neighbor<double[], E>> heap = new HeapSelect<>(neighbors);
  for (int i = 0; i < k; i++) {
    heap.add(neighbor);
    neighbor = new Neighbor<>(null, null, 0, Double.MAX_VALUE);
  }
  search(q, root, heap);
  heap.sort();
  for (int i = 0; i < neighbors.length; i++) {
    neighbors[i].distance = Math.sqrt(neighbors[i].distance);
  }
  return neighbors;
}
origin: com.github.haifengl/smile-core

HeapSelect<Node> heap = new HeapSelect<>(top2);
for (Node neuron : nodes) {
  neuron.dist = Math.squaredDistance(neuron.w, x);
origin: com.github.haifengl/smile-core

@SuppressWarnings("unchecked")
Neighbor<double[], E>[] neighbors = (Neighbor<double[], E>[]) java.lang.reflect.Array.newInstance(neighbor.getClass(), k);
HeapSelect<Neighbor<double[], E>> heap = new HeapSelect<>(neighbors);
for (int i = 0; i < k; i++) {
  heap.add(neighbor);
origin: com.github.haifengl/smile-core

HeapSelect<Neighbor<AbstractSentence, E>> heap = new HeapSelect<>(neighbors);
Neighbor<AbstractSentence, E> neighbor = new Neighbor<>(null, null, 0, Double.MAX_VALUE);
for (int i = 0; i < k; i++) {
origin: com.github.haifengl/smile-core

@SuppressWarnings("unchecked")
SimpleNeighbor<T>[] neighbors = (SimpleNeighbor<T>[]) java.lang.reflect.Array.newInstance(neighbor.getClass(), k);
HeapSelect<Neighbor<T,T>> heap = new HeapSelect<>(neighbors);
for (int i = 0; i < k; i++) {
  heap.add(neighbor);
origin: com.github.haifengl/smile-core

@SuppressWarnings("unchecked")
Neighbor<double[], E>[] neighbors = (Neighbor<double[], E>[]) java.lang.reflect.Array.newInstance(neighbor.getClass(), k);
HeapSelect<Neighbor<double[], E>> heap = new HeapSelect<>(neighbors);
for (int i = 0; i < k; i++) {
  heap.add(neighbor);
origin: com.github.haifengl/smile-core

HeapSelect<Neighbor> heap = new HeapSelect<>(neighbors);
smile.sortHeapSelect<init>

Javadoc

Constructor.

Popular methods of HeapSelect

  • 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
  • add
    Assimilate a new value from the stream.
  • peek
    Returns the k-th smallest value seen so far.

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • Runner (org.openjdk.jmh.runner)
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