Tabnine Logo
ClusterFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
ClusterFactory
in
com.oculusinfo.ml.unsupervised.cluster

Best Java code snippets using com.oculusinfo.ml.unsupervised.cluster.ClusterFactory (Showing top 8 results out of 315)

origin: unchartedsoftware/ensemble-clustering

  /***
   * Public method for creating a new cluster instance. The new cluster is associated with
   * the centroids for each feature.
   * 
   * @return the new cluster instance
   */
  public Cluster createCluster() {
    return (new ClusterFactory(this.typeDefs, onlineUpdate)).create();
  }
}
origin: unchartedsoftware/ensemble-clustering

@Override
public Map<String, Instance> call(Tuple2<String, Instance> instance) throws Exception {
  Map<String, Instance> result = new HashMap<String, Instance>();
  Cluster c = clusterFactory.create();
  c.add(instance._2);
  result.put(c.getId(), c);
  return result;
}
origin: unchartedsoftware/ensemble-clustering

ClusterFactory clusterFactory = new ClusterFactory(this.typeDefs, this.onlineUpdate);
origin: unchartedsoftware/ensemble-clustering

@Override
public Instance call(Instance inst1, Instance inst2) throws Exception {
  Cluster c = clusterFactory.create();
  
  // aggregate inst1 and inst2 in a cluster
  updateCluster(inst1, c);
  updateCluster(inst2, c);

  return c;
}

origin: unchartedsoftware/ensemble-clustering

ClusterFactory clusterFactory = new ClusterFactory(this.typeDefs, this.onlineUpdate);
origin: unchartedsoftware/ensemble-clustering

@Override
public Iterable<Instance> call(Iterator<Tuple2<String, Instance>> instances) throws Exception {
  Map<String, Instance> clusters = new HashMap<String, Instance>();
  
  BestClusterFunction bestClusterFunc = new BestClusterFunction(distFunc, clusters, threshold);
  
  while (instances.hasNext()) {
    Tuple2<String, Instance> inst = instances.next();
    
    Tuple2<String, Instance> result = bestClusterFunc.call(inst);
  
    Cluster c;
    if (result._1 == null) {
      c = clusterFactory.create();
      clusters.put(c.getId(), c);
    }
    else {
      c = (Cluster)clusters.get(result._1);
    }
    c.add(inst._2);
  }
  return clusters.values();
}
origin: unchartedsoftware/ensemble-clustering

@Override
public SparkClusterResult doCluster(DataSet ds) {
  distFunc = new DistanceFunction(this.typeDefs);
  clusterFactory = new ClusterFactory(this.typeDefs, this.onlineUpdate);
origin: unchartedsoftware/ensemble-clustering

  @Override
  public Map<String, Instance> call(Tuple2<String, Instance> inst) throws Exception {
    Instance bestCluster = null;
    double bestScore = Double.MAX_VALUE;
    
    for (String clusterId : clusters.keySet()) {
      Instance cluster = clusters.get(clusterId);
      double d = distFunc.distance(inst._2, cluster);
    
      if (d < bestScore && d < threshold) {
        bestScore = d;
        bestCluster = cluster;
      }
    }
    Map<String, Instance> result = new HashMap<String, Instance>();
    if (bestCluster == null) {
      Cluster c = clusterFactory.create();
      c.add(inst._2);
      result.put(c.getId(), c);
    }
    else {
      result.put(bestCluster.getId(), bestCluster);
    }
    return result;
  }
}
com.oculusinfo.ml.unsupervised.clusterClusterFactory

Most used methods

  • <init>
  • create

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JButton (javax.swing)
  • Top PhpStorm 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