Package de.jungblut.distance

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


  @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

   * 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

Related Classes of de.jungblut.distance.CosineDistance

Copyright © 2018 www.massapicom. 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.