public class MinHashLSHModelData extends Object
MinHashLSHModel
.
This class also provides classes to save/load model data.
Modifier and Type | Class and Description |
---|---|
static class |
MinHashLSHModelData.ModelDataEncoder
Encoder for
MinHashLSHModelData . |
Modifier and Type | Field and Description |
---|---|
int |
numHashFunctionsPerTable |
int |
numHashTables |
int[] |
randCoefficientA |
int[] |
randCoefficientB |
Constructor and Description |
---|
MinHashLSHModelData() |
MinHashLSHModelData(int numHashTables,
int numHashFunctionsPerTable,
int[] randCoefficientA,
int[] randCoefficientB) |
Modifier and Type | Method and Description |
---|---|
static MinHashLSHModelData |
generateModelData(int numHashTables,
int numHashFunctionsPerTable,
int dim,
long seed) |
DenseVector[] |
hashFunction(Vector vec)
Maps an input feature vector to multiple hash vectors.
|
double |
keyDistance(Vector x,
Vector y)
Calculates the distance between two different feature vectors using the corresponding
distance metric.
|
public int numHashTables
public int numHashFunctionsPerTable
public int[] randCoefficientA
public int[] randCoefficientB
public MinHashLSHModelData()
public MinHashLSHModelData(int numHashTables, int numHashFunctionsPerTable, int[] randCoefficientA, int[] randCoefficientB)
public static MinHashLSHModelData generateModelData(int numHashTables, int numHashFunctionsPerTable, int dim, long seed)
public DenseVector[] hashFunction(Vector vec)
vec
- input vector.Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.