-
Notifications
You must be signed in to change notification settings - Fork 93
Quick Introduction to AMLSim
Hiroki Kanezashi edited this page Jul 10, 2019
·
8 revisions
Here is a quick introduction on how you can run a series of processes in AMLSim. To understand each process in more details, you can check out pages for all the relevant components including transaction network generator,
- NetworkX 1.10 (2.0 or later will not work)
python scripts/transaction_graph_generator.py [PropFile] [DegreeFile] [TransactionTypeFile]- PropFile: Configuration file path (
prop.ini) of the transaction graph generator - DegreeFile: Degree distribution parameter file
- TransactionTypeFile: Transaction type parameter file
Example:
python scripts/transaction_relationship_generator.py prop.ini paramFiles/deg1K.csv paramFiles/tx_type.csvSee CSV files under paramFiles directory
- accounts.csv
- Account parameter file
- aletPatterns.csv
- Alert (fraud) transaction pattern parameter file
- degree.csv
- Degree distribution parameter file
- transactionType.csv
- Transaction distribution parameter file
Property file
- prop.ini
Put all jar files of the following libraries to jars directory.
- MASON version 18
- Commons-Math version 3.6.1
- DSI Utilities version 2.5.4
- fastutil version 8.2.3
- Sux for Java version 4.2.0
- JSAP version 2.1
- JSON-java version 20180813
- MySQL Connector for Java version 5.1
- SLF4J version 1.7.25
- WebGraph version 3.6.1
-
PaySim Please generate
paysim.jarwith the following commands
git clone https://github.com/EdgarLopezPhD/PaySim.git
cd PaySim
git checkout 62a29b77c28bd03e717a67c8ab975c671ba0080d
mkdir bin jars
cp /path/to/commons-math-3-3.6.1*.jar /path/to/mason.18.jar jars/
javac -d bin -cp "jars/*" src/paysim/*.java
cd bin
jar cf paysim.jar paysim
All output files of the Python script
- accounts.csv
- transactions.csv
- alertPatterns.csv
Java property file
- amlsim.properties
Commands
sh scripts/build_AMLSim.sh
sh scripts/run_AMLSim.sh [SimulationName] [Steps]- SimulationName: Simulation name
- Steps: Number of steps per simulation
Example:
sh scripts/run_AMLSim.sh sample 150cd /path/to/AMLSim
python scripts/transaction_relationship_generator.py prop.ini paramFiles/1K/degree.csv paramFiles/transactionType.csv
sh scripts/run_AMLSim.sh sample 150python scripts/visualize/plot_transaction_graph.py [TransactionLog] [AlertID]- TransactionLog: Log CSV file path from AMLSim (e.g.
outputs/sample/sample_log.csv) - AlertID: An alert ID to be visualized
python scripts/convert_logs.py [ConfFile] [TransactionLog]- ConfFile: Configuration ini file for the data conversion (
convert.ini) - TransactionLog: Transaction log CSV file under
outputs/(name)/(e.g.outputs/sample/sample_log.csv)
Example:
python scripts/convert_logs.py convert.ini outputs/sample/sample_log.csv- First, please copy transaction
tx.csvand case account ID listcase_accts.csvfiles from the sample data directory to theoutputdirectory.cp /path/to/sample/1K/*.csv outputs/ - Launch JanusGraph server
cd /path/to/janusgraph-0.1.1-hadoop2/ ./bin/janusgraph.sh start - Launch Groovy script to load transaction graph edge list and case account file list.
cd /path/to/AMLSim /path/to/janusgraph-0.1.1-hadoop2/bin/gremlin.sh scripts/janusgraph/load_transaction_janusgraph.groovy - Then, run graph analytics on the JanusGraph.
cd /path/to/janusgraph/scripts /path/to/janusgraph-0.1.1-hadoop2/bin/gremlin.sh egonet/ego_test.groovy
sh scripts/clean_logs.sh