public
Created

Pig Code to use UDF of accumulator interface

  • Download Gist
gistfile1.c
C
1 2 3 4 5 6 7 8
raw_data = load 'data' using ... as (model:chararray, ctr:double, clicks:int);
A = FOREACH raw_data GENERATE model as model, ctr as pctr, ((clicks > 0) ? 1 : 0) as clicked;
B = GROUP A by model;
C = FOREACH B {
D = ORDER A by pctr asc;
GENERATE com.mediav.ml.AccurateAuc(D.clicked);
}
STORE C INTO 'xxxx';

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.