public class SuperBit extends Object implements Serializable
| Constructor and Description |
|---|
SuperBit()
Initialize SuperBit algorithm without parameters
(used only for serialization).
|
SuperBit(int d)
Initialize SuperBit algorithm.
|
SuperBit(int d,
int n,
int l)
Initialize SuperBit algorithm.
|
SuperBit(int d,
int n,
int l,
long seed)
Initialize SuperBit algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
static double |
cosineSimilarity(double[] v1,
double[] v2)
Computes the cosine similarity, computed as v1 dot v2 / (|v1| * |v2|).
|
double[][] |
getHyperplanes()
Get the hyperplanes coefficients used to compute signatures.
|
boolean[] |
signature(double[] vector)
Compute the signature of this vector.
|
double |
similarity(boolean[] sig1,
boolean[] sig2)
Compute the similarity between two signature, which is also an
estimation of the cosine similarity between the two vectors.
|
public SuperBit(int d,
int n,
int l)
d - data space dimensionn - Super-Bit depth [1 .. d]l - number of Super-Bit [1 ..public SuperBit(int d,
int n,
int l,
long seed)
d - data space dimensionn - Super-Bit depth [1 .. d]l - number of Super-Bit [1 ..seed - to use for the random number generatorpublic SuperBit(int d)
d - public SuperBit()
public final boolean[] signature(double[] vector)
vector - public final double similarity(boolean[] sig1,
boolean[] sig2)
sig1 - sig2 - public final double[][] getHyperplanes()
public static double cosineSimilarity(double[] v1,
double[] v2)
v1 - v2 - Copyright © 2019. All rights reserved.