public class L1 extends MetricUDF
It returns one of the tuples of the bag of vectors using L1 distance, distance between two vectors. This is otherwise known as the manhattan distance, taxicab distance or city block distance.
L1PStableHash for an example
Constructor and Description |
---|
L1(java.lang.String sDim)
Create a new L1 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)
The distance metric used.
|
static double |
distance(org.apache.commons.math.linear.RealVector v1,
org.apache.commons.math.linear.RealVector v2) |
exec, outputSchema
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public L1(java.lang.String sDim)
sDim
- dimensionpublic static double distance(org.apache.commons.math.linear.RealVector v1, org.apache.commons.math.linear.RealVector v2)
protected double dist(org.apache.commons.math.linear.RealVector v1, org.apache.commons.math.linear.RealVector v2)
MetricUDF