info.debatty.spark.knngraphs.builder.LSHSuperBitSparseIntegerVector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spark-knn-graphs Show documentation
Show all versions of spark-knn-graphs Show documentation
Spark algorithms for building k-nn graphs
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package info.debatty.spark.knngraphs.builder;
import info.debatty.java.graphs.SimilarityInterface;
import info.debatty.java.utils.SparseIntegerVector;
/**
*
* @author tibo
*/
public class LSHSuperBitSparseIntegerVector extends LSHSuperBit {
public LSHSuperBitSparseIntegerVector() {
super();
this.similarity = new SimilarityInterface() {
public double similarity(SparseIntegerVector value1, SparseIntegerVector value2) {
return value1.cosineSimilarity(value2);
}
};
}
@Override
int[] hash(SparseIntegerVector node_value) {
return lsh.hash(node_value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy