-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94848a1
commit 33db60c
Showing
6 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sudo code | ||
1. define SAR/normal ratio | ||
2. define bounds for params | ||
3. define constraints, all features should have similar feature importance | ||
4. define recall | ||
5. set target FPR | ||
3. set all distributions equal, simulate data, train and evaluate recall and FPR | ||
if needed use recall and FPR to normalize | ||
4. loop: | ||
suggest config files that satisfies the target SAR/normal ratio | ||
create aml data | ||
train statistical models | ||
end if recall and FPR are satisfied |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"general": { | ||
"random_seed": 0, | ||
"simulation_name": "100K_accts", | ||
"total_steps": 367 | ||
}, | ||
"default": { | ||
"min_amount": 1, | ||
"max_amount": 150000, | ||
"mean_amount": 637, | ||
"std_amount": 500, | ||
"mean_amount_sar": 1000, | ||
"std_amount_sar": 500, | ||
"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": 200.0, | ||
"std_outcome": 500.0, | ||
"mean_outcome_sar": 200.0, | ||
"std_outcome_sar": 500.0, | ||
"prob_spend_cash": 0.7, | ||
"n_steps_balance_history": 56, | ||
"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, | ||
"margin_ratio": 0.1, | ||
"prob_participate_in_multiple_sars": 0.2 | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import os | ||
import json | ||
|
||
def create_param_files(params:dict, param_file_folder:str): | ||
if not os.path.exists(param_file_folder): | ||
os.makedirs(param_file_folder) | ||
config_params = params['config'] | ||
with open(os.path.join(param_file_folder, 'config.json'), 'w') as f: | ||
json.dump(config_params, f, indent=2) | ||
config_params = params['accounts'] | ||
|
||
|
||
|
||
params = { | ||
'config': { | ||
'general': { | ||
'random_seed': 0, | ||
'simulation_name': '100K_accts', | ||
'total_steps': 367 | ||
}, | ||
'default': { | ||
'min_amount': 1, | ||
'max_amount': 150000, | ||
'mean_amount': 637, | ||
'std_amount': 500, | ||
'mean_amount_sar': 1000, | ||
'std_amount_sar': 500, | ||
'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': 200.0, | ||
'std_outcome': 500.0, | ||
'mean_outcome_sar': 200.0, | ||
'std_outcome_sar': 500.0, | ||
'prob_spend_cash': 0.7, | ||
'n_steps_balance_history': 56, | ||
'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, | ||
'margin_ratio': 0.1, | ||
'prob_participate_in_multiple_sars': 0.2 | ||
} | ||
}, | ||
'accounts': [ | ||
(27700, 1000, 100000, 'SWE', 'I', 'swedbank'), | ||
(13480, 1000, 100000, 'SWE', 'I', 'handelsbanken'), | ||
(58820, 1000, 100000, 'SWE', 'I', 'other') | ||
], | ||
'normalModels': { | ||
() | ||
} | ||
} | ||
|
||
param_file_folder = 'param_files/test' | ||
|
||
create_param_files(params, param_file_folder) |