Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SingleTransactionModel does not generate normal transactions #34

Open
thanh-nm opened this issue Jan 16, 2020 · 1 comment
Open

SingleTransactionModel does not generate normal transactions #34

thanh-nm opened this issue Jan 16, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@thanh-nm
Copy link

thanh-nm commented Jan 16, 2020

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.

@hkanezashi hkanezashi added this to Issues: AMLSim transactions in Progress of documentations Feb 25, 2020
@hkanezashi hkanezashi added the bug Something isn't working label Feb 28, 2020
@hkanezashi hkanezashi moved this from Issues: Unclassified to In Progress: Update Wiki Pages in Progress of documentations Feb 28, 2020
@hkanezashi
Copy link
Collaborator

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 hkanezashi moved this from In Progress: Update Wiki Pages to Done: Updated Implementations and Documents in Progress of documentations Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Progress of documentations
  
Done: Updated Implementations and Doc...
Development

No branches or pull requests

2 participants