类 MinHashLSHModelData


  • public class MinHashLSHModelData
    extends Object
    Model data of MinHashLSHModel.

    This class also provides classes to save/load model data.

    • 字段详细资料

      • numHashTables

        public int numHashTables
      • numHashFunctionsPerTable

        public int numHashFunctionsPerTable
      • randCoefficientA

        public int[] randCoefficientA
      • randCoefficientB

        public int[] randCoefficientB
    • 构造器详细资料

      • MinHashLSHModelData

        public MinHashLSHModelData()
      • MinHashLSHModelData

        public MinHashLSHModelData​(int numHashTables,
                                   int numHashFunctionsPerTable,
                                   int[] randCoefficientA,
                                   int[] randCoefficientB)
    • 方法详细资料

      • generateModelData

        public static MinHashLSHModelData generateModelData​(int numHashTables,
                                                            int numHashFunctionsPerTable,
                                                            int dim,
                                                            long seed)
      • hashFunction

        public org.apache.flink.ml.linalg.DenseVector[] hashFunction​(org.apache.flink.ml.linalg.Vector vec)
        Maps an input feature vector to multiple hash vectors.
        参数:
        vec - input vector.
        返回:
        the mapping of LSH functions.
      • keyDistance

        public double keyDistance​(org.apache.flink.ml.linalg.Vector x,
                                  org.apache.flink.ml.linalg.Vector y)
        Calculates the distance between two different feature vectors using the corresponding distance metric.
        参数:
        x - One input vector in the metric space.
        y - One input vector in the metric space.
        返回:
        The distance between x and y.