AMLSim icon indicating copy to clipboard operation
AMLSim copied to clipboard

SingleTransactionModel does not generate normal transactions

Open thanh-nm opened this issue 5 years ago • 1 comments

According to Wiki:

an account sends a transaction to another account in his/her neighborhood that is currently selected in a random way

However with account's model set to 0 (SINGLE) in accounts.csv the simulator does not generate any normal transactions between the accounts at all.

This can be reproducible with the following test config:

conf.json

{
  "general": {
    "random_seed": 0,
    "simulation_name": "sample",
    "total_steps": 720,
    "base_date": "2020-01-08"
  },
  "default": {
    "min_amount": 100,
    "max_amount": 1000,
    "min_balance": 50000,
    "max_balance": 100000,
    "start_step": -1,
    "end_step": -1,
    "start_range": -1,
    "end_range": -1,
    "transaction_model": 1,
    "margin_ratio": 0.1,
    "bank_id": "default",

    "cash_in": {
      "normal_interval": 100,
      "fraud_interval": 50,
      "normal_min_amount": 50,
      "normal_max_amount": 100,
      "fraud_min_amount": 500,
      "fraud_max_amount": 1000
    },
    "cash_out": {
      "normal_interval": 10,
      "fraud_interval": 100,
      "normal_min_amount": 10,
      "normal_max_amount": 100,
      "fraud_min_amount": 1000,
      "fraud_max_amount": 2000
    }
  },
  ...

accounts.csv

count,min_balance,max_balance,country,business_type,model,bank_id
5,50000,100000,AUS,I,0, CBA
5,50000,100000,AUS,I,0, NAB
2,50000,100000,AUS,I,0, ING

degree.csv

Count,In-degree,Out-degree
4,1,0
1,0,4
0,3,0

alertPatterns.csv

count,type,schedule_id,min_accounts,max_accounts,min_amount,max_amount,min_period,max_period,bank_id,is_sar
2,fan_in,1,3,3,100.0,200.0,1,5,,True
1,fan_out,1,2,2,100.0,200.0,1,5,,False

This seems to happen due to this condition in SingleTransactionModel when endStep = -1 and step goes from 0 to 720.

thanh-nm avatar Jan 16 '20 02:01 thanh-nm

Thank you for the bug report. I fixed the SingleTransactionModel so that each account sends money to another account only once.

By the way, these parameter sets you showed will not work because a sufficient number of account vertices cannot be the main accounts of alerts. It should work with the following updated parameter files.

conf.json

...
  "graph_generator": {
    "degree_threshold": 2,  // Please change this value
    "high_risk_countries": "",
    "high_risk_business": ""
  },
...

degree.csv

Count,In-degree,Out-degree
0,4,0
1,0,8
2,6,0
3,0,4
4,2,0

hkanezashi avatar Feb 28 '20 06:02 hkanezashi