Examples of CosineDistance


Examples of com.jgaap.distances.CosineDistance

   * @throws AnalyzeException
   */
  @Test
  public void testAnalyze() throws AnalyzeException {
    NearestNeighborDriver nearest = new NearestNeighborDriver();
    CosineDistance cosine = new CosineDistance();
    nearest.setDistance(cosine);

    EventSet known1 = new EventSet();
    EventSet known2 = new EventSet();
    EventSet unknown = new EventSet();
View Full Code Here

Examples of de.jungblut.distance.CosineDistance

  @Test
  public void testVectorInvertedIndex() {

    InvertedIndex<DoubleVector, Integer> invIndex = InvertedIndex
        .createVectorIndex(new CosineDistance());
    DoubleVector v1 = new SparseDoubleVector(4);
    v1.set(1, 0.6931471805599453);
    v1.set(0, 1.3862943611198906);
    DoubleVector v2 = new SparseDoubleVector(4);
    v2.set(2, 0.6931471805599453);
View Full Code Here

Examples of de.jungblut.distance.CosineDistance

  @Test
  public void testSparseKNN() {

    SparseKNearestNeighbours neighbours = new SparseKNearestNeighbours(2, 2,
        new CosineDistance());

    // we seperate stuff in two dimensions each
    DoubleVector left = new SingleEntryDoubleVector(0d);
    DoubleVector right = new SingleEntryDoubleVector(1d);
    DoubleVector v1 = new SparseDoubleVector(4);
View Full Code Here

Examples of de.jungblut.distance.CosineDistance

   * entity tokens count and m is the number of the context vertices. Alpha is
   * set to 0.5 and the cosine distance is used.
   */
  public IterativeSimilarityAggregation(String[] seedTokens,
      Tuple<String[], DoubleMatrix> bipartiteGraph) {
    this(seedTokens, bipartiteGraph, 0.5d, new CosineDistance());
  }
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.