Input
This example uses the MaxDistance syntax element to limit the output to target vectors within the specified distances for each measure.
SQL Call
SELECT * FROM VectorDistance ( ON target_mobile_data as TargetTable PARTITION BY UserID ON ref_mobile_data as ReferenceTable DIMENSION USING TargetIdColumns ('UserID') TargetAttributeNameColumn ('Feature') TargetAttributeValueColumn ('value1') DistanceMeasure ('Cosine','Euclidean','Manhattan') MaxDistance (0.03,0.8,1.0) ) AS dt ORDER BY 1;
Output
Only UserID 2 and UserID 3 meet the threshold criteria.
target_userid ref_userid type distance ------------- ---------- --------- -------------------- 2 5 manhattan 0.73 2 5 euclidean 0.5243090691567331 2 5 cosine 0.02608922985452755 3 5 manhattan 0.67 3 5 euclidean 0.4526588119102511 3 5 cosine 0.024150544155866593
Download a zip file of all examples and a SQL script file that creates their input tables.