Skip to content

Commit

Permalink
TCI
Browse files Browse the repository at this point in the history
  • Loading branch information
TheColdIce committed Nov 23, 2023
1 parent 9978d63 commit 3a0cdd2
Show file tree
Hide file tree
Showing 45 changed files with 456 additions and 118 deletions.
2 changes: 1 addition & 1 deletion AMLsim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ COPY index.html index.html
COPY pom.xml pom.xml
COPY target target

ENTRYPOINT ["sh", "scripts/run.sh"]
ENTRYPOINT ["sh", "scripts/run.sh"]
Binary file added AMLsim/paramFiles/10K_accts.zip
Binary file not shown.
24 changes: 12 additions & 12 deletions AMLsim/paramFiles/10K_accts/accounts.csv
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
count,min_balance,max_balance,country,business_type,bank_id
2768,10000,50000,SWE,I,swedbank
1347,10000,50000,SWE,I,handelsbanken
371,10000,50000,SWE,I,seb
2694,10000,50000,SWE,I,nordea
104,10000,50000,SWE,I,danske
458,10000,50000,SWE,I,länsförsäkringar
748,10000,50000,SWE,I,ica
362,10000,50000,SWE,I,sparbanken
23,10000,50000,SWE,I,ålandsbanken
224,10000,50000,SWE,I,marginalen
625,10000,50000,SWE,I,svea
276,10000,50000,SWE,I,skandia
2768,10000,20000,SWE,I,swedbank
1347,5000,10000,SWE,I,handelsbanken
371,5000,10000,SWE,I,seb
2694,5000,10000,SWE,I,nordea
104,5000,10000,SWE,I,danske
458,5000,10000,SWE,I,länsförsäkringar
748,5000,10000,SWE,I,ica
362,5000,10000,SWE,I,sparbanken
23,5000,10000,SWE,I,ålandsbanken
224,5000,10000,SWE,I,marginalen
625,5000,10000,SWE,I,svea
276,5000,10000,SWE,I,skandia
38 changes: 19 additions & 19 deletions AMLsim/paramFiles/10K_accts/alertPatterns.csv
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
count,type,schedule_id,min_accounts,max_accounts,min_amount,max_amount,min_period,max_period,bank_id,is_sar,source_type
1,fan_out,2,7,7,100,1000,1,365,,True,CASH
1,fan_in,2,7,7,100,1000,1,365,,True,CASH
1,cycle,2,7,7,100,1000,1,365,,True,CASH
1,bipartite,2,7,7,100,1000,1,365,,True,CASH
1,stack,2,7,7,100,1000,1,365,,True,CASH
1,scatter_gather,2,7,7,100,1000,1,365,,True,CASH
1,gather_scatter,2,7,7,100,1000,1,365,,True,CASH
1,fan_in,2,4,4,100,1000,1,365,swedbank,True,CASH
1,fan_in,2,4,4,100,1000,1,365,handelsbanken,True,CASH
1,fan_in,2,4,4,100,1000,1,365,seb,True,CASH
1,fan_in,2,4,4,100,1000,1,365,nordea,True,CASH
1,fan_in,2,4,4,100,1000,1,365,danske,True,CASH
1,fan_in,2,4,4,100,1000,1,365,länsförsäkringar,True,CASH
1,fan_in,2,4,4,100,1000,1,365,ica,True,CASH
1,fan_in,2,4,4,100,1000,1,365,sparbanken,True,CASH
1,fan_in,2,4,4,100,1000,1,365,ålandsbanken,True,CASH
1,fan_in,2,4,4,100,1000,1,365,marginalen,True,CASH
1,fan_in,2,4,4,100,1000,1,365,svea,True,CASH
1,fan_in,2,4,4,100,1000,1,365,skandia,True,CASH
1,fan_out,2,7,7,100,1000,1,168,,True,CASH
1,fan_in,2,7,7,100,1000,1,168,,True,CASH
1,cycle,2,7,7,100,1000,1,168,,True,CASH
1,bipartite,2,7,7,100,1000,1,168,,True,CASH
1,stack,2,7,7,100,1000,1,168,,True,CASH
1,scatter_gather,2,7,7,100,1000,1,168,,True,CASH
1,gather_scatter,2,7,7,100,1000,1,168,,True,CASH
1,fan_in,2,4,4,100,1000,1,168,swedbank,True,CASH
1,fan_in,2,4,4,100,1000,1,168,handelsbanken,True,CASH
1,fan_in,2,4,4,100,1000,1,168,seb,True,CASH
1,fan_in,2,4,4,100,1000,1,168,nordea,True,CASH
1,fan_in,2,4,4,100,1000,1,168,danske,True,CASH
1,fan_in,2,4,4,100,1000,1,168,länsförsäkringar,True,CASH
1,fan_in,2,4,4,100,1000,1,168,ica,True,CASH
1,fan_in,2,4,4,100,1000,1,168,sparbanken,True,CASH
1,fan_in,2,4,4,100,1000,1,168,ålandsbanken,True,CASH
1,fan_in,2,4,4,100,1000,1,168,marginalen,True,CASH
1,fan_in,2,4,4,100,1000,1,168,svea,True,CASH
1,fan_in,2,4,4,100,1000,1,168,skandia,True,CASH
74 changes: 12 additions & 62 deletions AMLsim/paramFiles/10K_accts/conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@
"general": {
"random_seed": 0,
"simulation_name": "10K_accts",
"total_steps": 367,
"base_date": "2023-01-01"
"total_steps": 170
},
"default": {
"min_amount": 1,
"max_amount": 150000,
"mean_amount": 637,
"std_amount": 300,
"mean_amount_sar": 1000,
"std_amount_sar": 300,
"std_amount": 3000,
"mean_amount_sar": 2000,
"std_amount_sar": 3000,
"prob_income": 0.0,
"mean_income": 0.0,
"std_income": 0.0,
"prob_income_sar": 0.0,
"mean_income_sar": 0.0,
"std_income_sar": 0.0,
"mean_outcome": 1000,
"std_outcome": 500,
"mean_outcome_sar": 1000,
"std_outcome_sar": 500,
"mean_outcome": 200.0,
"std_outcome": 500.0,
"mean_outcome_sar": 0.0,
"std_outcome_sar": 0.0,
"mean_phone_change_frequency": 1460,
"std_phone_change_frequency": 365,
"mean_phone_change_frequency_sar": 365,
Expand All @@ -30,31 +29,7 @@
"std_bank_change_frequency": 1,
"mean_bank_change_frequency_sar": 1460,
"std_bank_change_frequency_sar": 1,
"min_balance": 100000,
"max_balance": 200000,
"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
}
"margin_ratio": 0.1
},
"input": {
"directory": "paramFiles/10K_accts",
Expand All @@ -75,39 +50,14 @@
},
"output": {
"directory": "outputs",
"accounts": "accounts.csv",
"transactions": "transactions.csv",
"cash_transactions": "cash_tx.csv",
"alert_members": "alert_accounts.csv",
"alert_transactions": "alert_transactions.csv",
"sar_accounts": "sar_accounts.csv",
"party_individuals": "individuals-bulkload.csv",
"party_organizations": "organizations-bulkload.csv",
"account_mapping": "accountMapping.csv",
"resolved_entities": "resolvedentities.csv",
"transaction_log": "tx_log.csv",
"counter_log": "tx_count.csv",
"diameter_log": "diameter.csv"
"transaction_log": "tx_log.csv"
},
"graph_generator": {
"degree_threshold": 1,
"high_risk_countries": "",
"high_risk_business": ""
"degree_threshold": 1
},
"simulator": {
"compute_diameter": false,
"transaction_limit": 100000,
"transaction_interval": 7,
"sar_interval": 7,
"sar_balance_ratio": 1.0,
"numBranches": 1000
},
"visualizer": {
"degree": "deg.png",
"wcc": "wcc.png",
"alert": "alert.png",
"count": "count.png",
"clustering": "cc.png",
"diameter": "diameter.png"
"sar_interval": 7
}
}
113 changes: 113 additions & 0 deletions AMLsim/paramFiles/10K_accts/conf_old.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"general": {
"random_seed": 0,
"simulation_name": "10K_accts",
"total_steps": 732,
"base_date": "2023-01-01"
},
"default": {
"min_amount": 1,
"max_amount": 150000,
"mean_amount": 637,
"std_amount": 1800,
"mean_amount_sar": 2000,
"std_amount_sar": 1800,
"prob_income": 0.0,
"mean_income": 0.0,
"std_income": 0.0,
"prob_income_sar": 0.0,
"mean_income_sar": 0.0,
"std_income_sar": 0.0,
"mean_outcome": 1000,
"std_outcome": 500,
"mean_outcome_sar": 1000,
"std_outcome_sar": 500,
"mean_phone_change_frequency": 1460,
"std_phone_change_frequency": 365,
"mean_phone_change_frequency_sar": 365,
"std_phone_change_frequency_sar": 182,
"mean_bank_change_frequency": 1460,
"std_bank_change_frequency": 1,
"mean_bank_change_frequency_sar": 1460,
"std_bank_change_frequency_sar": 1,
"min_balance": 100000,
"max_balance": 200000,
"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
}
},
"input": {
"directory": "paramFiles/10K_accts",
"schema": "schema.json",
"accounts": "accounts.csv",
"alert_patterns": "alertPatterns.csv",
"normal_models": "normalModels.csv",
"degree": "degree.csv",
"transaction_type": "transactionType.csv",
"is_aggregated_accounts": true
},
"temporal": {
"directory": "tmp",
"transactions": "transactions.csv",
"accounts": "accounts.csv",
"alert_members": "alert_members.csv",
"normal_models": "normal_models.csv"
},
"output": {
"directory": "outputs",
"accounts": "accounts.csv",
"transactions": "transactions.csv",
"cash_transactions": "cash_tx.csv",
"alert_members": "alert_accounts.csv",
"alert_transactions": "alert_transactions.csv",
"sar_accounts": "sar_accounts.csv",
"party_individuals": "individuals-bulkload.csv",
"party_organizations": "organizations-bulkload.csv",
"account_mapping": "accountMapping.csv",
"resolved_entities": "resolvedentities.csv",
"transaction_log": "tx_log.csv",
"counter_log": "tx_count.csv",
"diameter_log": "diameter.csv"
},
"graph_generator": {
"degree_threshold": 1,
"high_risk_countries": "",
"high_risk_business": ""
},
"simulator": {
"compute_diameter": false,
"transaction_limit": 100000,
"transaction_interval": 7,
"sar_interval": 7,
"sar_balance_ratio": 1.0,
"numBranches": 1000
},
"visualizer": {
"degree": "deg.png",
"wcc": "wcc.png",
"alert": "alert.png",
"count": "count.png",
"clustering": "cc.png",
"diameter": "diameter.png"
}
}
20 changes: 14 additions & 6 deletions AMLsim/paramFiles/10K_accts/normalModels.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
count,type,schedule_id,min_accounts,max_accounts,min_period,max_period,bank_id
5000,single,2,1,1,1,365,
5000,fan_out,2,4,4,1,365,
5000,fan_in,2,4,4,1,365,
5000,forward,2,3,3,1,365,
5000,mutual,2,2,2,1,365,
5000,periodical,2,2,2,1,365,
3000,single,2,1,1,1,168,
3000,fan_out,2,4,4,1,168,
3000,fan_in,2,4,4,1,168,
3000,forward,2,3,3,1,168,
3000,mutual,2,2,2,1,168,
3000,periodical,2,2,2,1,168,
1000,single,0,1,1,1,168,handelsbanken
3000,fan_out,1,4,4,1,168,handelsbanken
3000,fan_in,2,4,4,1,168,handelsbanken
3000,forward,3,3,3,1,168,handelsbanken
3000,mutual,2,2,2,1,168,handelsbanken
3000,periodical,2,2,2,1,168,handelsbanken
30,fan_out,3,40,40,1,168,
30,fan_in,3,40,40,1,168,
2 changes: 1 addition & 1 deletion AMLsim/scripts/generate_scalefree.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def powerlaw_cluster_generator(_n, _edge_factor):
print("Number of vertices: %d" % g.number_of_nodes()) # Number of vertices (accounts)
print("Number of edges: %d" % g.number_of_edges()) # Number of edges (transactions)

#out_deg = Counter(g.out_degree().values())
#out_deg = Counter(g.out_degree().values()) # TODO: fix so degree.csv has aggretgates
#in_deg = Counter(g.in_degree().values())

#keys = set(sorted(list(in_deg.keys()) + list(out_deg.keys())))
Expand Down
Loading

0 comments on commit 3a0cdd2

Please sign in to comment.