public class Cosine extends MetricUDF
CosineDistanceHash for an example
Constructor and Description |
---|
Cosine(java.lang.String sDim)
Create a new Cosine Metric UDF with a given dimension.
|
Modifier and Type | Method and Description |
---|---|
protected double |
dist(org.apache.commons.math.linear.RealVector v1,
org.apache.commons.math.linear.RealVector v2)
Cosine similarity.
|
static double |
distance(org.apache.commons.math.linear.RealVector v1,
org.apache.commons.math.linear.RealVector v2)
Cosine similarity.
|
exec, outputSchema
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public Cosine(java.lang.String sDim)
sDim
- dimension