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

Fix apparently disordered subsections in chapter 3 section 2 #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Chapter_3_GettingStarted/SimulatedDataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@
" \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h4>Transaction generation process</h4>\n",
"\n",
"The simulation will consist of five main steps:\n",
"\n",
"1. Generation of customer profiles: Every customer is different in their spending habits. This will be simulated by defining some properties for each customer. The main properties will be their geographical location, their spending frequency, and their spending amounts. The customer properties will be represented as a table, referred to as the *customer profile table*. \n",
"2. Generation of terminal profiles: Terminal properties will simply consist of a geographical location. The terminal properties will be represented as a table, referred to as the *terminal profile table*.\n",
"3. Association of customer profiles to terminals: We will assume that customers only make transactions on terminals that are within a radius of $r$ of their geographical locations. This makes the simple assumption that a customer only makes transactions on terminals that are geographically close to their location. This step will consist of adding a feature 'list_terminals' to each customer profile, that contains the set of terminals that a customer can use.\n",
"4. Generation of transactions: The simulator will loop over the set of customer profiles, and generate transactions according to their properties (spending frequencies and amounts, and available terminals). This will result in a table of transactions.\n",
"5. Generation of fraud scenarios: This last step will label the transactions as legitimate or genuine. This will be done by following three different fraud scenarios.\n",
"\n",
"The transaction generation process is illustrated below. \n",
"\n",
"![alt text](images/FlowDatasetGenerator.png)\n",
"<p style=\"text-align: center;\">\n",
"Fig. 2. Transaction generation process. The customer and terminal profiles are used to generate <br> a set of transactions. The final step, which generates fraud scenarios, provides the labeled transactions table.\n",
" \n",
"\n",
"The following sections detail the implementation for each of these steps. \n",
" "
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -91,31 +116,6 @@
"The `generate_customer_profiles_table` function provides an implementation for generating a table of customer profiles. It takes as input the number of customers for which to generate a profile and a random state for reproducibility. It returns a DataFrame containing the properties for each customer. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h4>Transaction generation process</h4>\n",
"\n",
"The simulation will consist of five main steps:\n",
"\n",
"1. Generation of customer profiles: Every customer is different in their spending habits. This will be simulated by defining some properties for each customer. The main properties will be their geographical location, their spending frequency, and their spending amounts. The customer properties will be represented as a table, referred to as the *customer profile table*. \n",
"2. Generation of terminal profiles: Terminal properties will simply consist of a geographical location. The terminal properties will be represented as a table, referred to as the *terminal profile table*.\n",
"3. Association of customer profiles to terminals: We will assume that customers only make transactions on terminals that are within a radius of $r$ of their geographical locations. This makes the simple assumption that a customer only makes transactions on terminals that are geographically close to their location. This step will consist of adding a feature 'list_terminals' to each customer profile, that contains the set of terminals that a customer can use.\n",
"4. Generation of transactions: The simulator will loop over the set of customer profiles, and generate transactions according to their properties (spending frequencies and amounts, and available terminals). This will result in a table of transactions.\n",
"5. Generation of fraud scenarios: This last step will label the transactions as legitimate or genuine. This will be done by following three different fraud scenarios.\n",
"\n",
"The transaction generation process is illustrated below. \n",
"\n",
"![alt text](images/FlowDatasetGenerator.png)\n",
"<p style=\"text-align: center;\">\n",
"Fig. 2. Transaction generation process. The customer and terminal profiles are used to generate <br> a set of transactions. The final step, which generates fraud scenarios, provides the labeled transactions table.\n",
" \n",
"\n",
"The following sections detail the implementation for each of these steps. \n",
" "
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down