Input: Legal Pattern Database LPD, Fraud Pattern Database FPD, Incoming Transaction , |
Number of costumers “”, Number of attributes “”, matching percentage “mp” |
Output: 0 (if legal) or 1 (if fraud) |
Assumption: |
(1) First attribute of each record in pattern databases and incoming transaction is Customer ID |
(2) If an attribute is missing in the frequent itemset (ie, this attribute has different values in |
each transaction and thus it is not contributing to the pattern) then we considered it as invalid. |
Begin |
lc = 0; //legal attribute match count |
fc = 0; //fraud attribute match count |
for = 1 to do |
if (LPD(, 1) = (1)) then //First attribute |
for = 2 to do |
if (LPD() is valid and LPD() = ()) then |
lc = lc + 1; |
endif |
endfor |
endif |
endfor |
for = 1 to do |
if (FPD() = (1)) then |
for = 2 to do |
if (FPD() is valid and FPD() = ()) then |
fc = fc + 1; |
endif |
endfor |
endif |
endfor |
if (fc = 0) then //no fraud pattern |
if ((lc/no. of valid attributes in legal pattern) ≥ mp) then |
return (0); //legal transaction |
else return (1); //fraud transaction |
endif |
elseif (lc = 0) then //no legal pattern |
if ((fc/no. of valid attributes in fraud pattern) ≥ mp) then |
return (1); //fraud transaction |
else return (0); //legal transaction |
endif |
elseif (lc > 0 && fc > 0) then //both legal and fraud |
patterns are available |
if (fc ≥ lc) then return (1); //fraud transaction |
else return (0); //legal Transaction |
endif |
endif |
End |