-
Notifications
You must be signed in to change notification settings - Fork 93
Transaction Model: Create a New Model (Tutorial)
hkanezashi edited this page Aug 21, 2019
·
4 revisions
How to create a new alert transaction model
First, you need to add a function to transaction_graph_generator.py to register a new fraud model.
Add process codes to add_alert_pattern function.
For example, the fan_in pattern is defined as follows:
if pattern_type == "fan_in": # fan_in pattern (multiple accounts --> single (subject) account)
src_list = [n for n in members if n != subject]
dst = subject
if transaction_freq is None:
transaction_freq = num_members - 1
for src in itertools.cycle(src_list): # Generate transactions for the specified number
amount = random.uniform(min_amount, max_amount)
date = random.randrange(start_day, end_day)
sub_g.add_edge(src, dst, amount=amount, date=date)
self.g.add_edge(src, dst, amount=amount, date=date)
transaction_count += 1
total_amount += amount
if transaction_count >= transaction_freq and total_amount >= aggregated_amount:
breakNext, create a Java class extends amlsim.model.fraud.FraudTransactionModel.