D599 Task 3 – Market Basket Analysis Report
Part I: Research Question
This section demonstrates competency by presenting a specific, relevant, and addressable
business question. It also outlines a clearly defined analysis goal that is aligned with the
dataset and the capabilities of Market Basket Analysis. Together, these elements ensure
the report has a logical purpose and measurable direction.
1. Proposed Question:
Which products are frequently co-purchased in high-priority transactions from the
Northeast region?
2. Defined Goal:
The goal of this analysis is to identify product bundles from high-priority Northeast
orders to inform targeted promotions and cross-selling strategies.
Part II: Market Basket Justification
This section explains why Market Basket Analysis is the appropriate technique for the
given scenario. By including an example transaction and a core assumption of the
method, it confirms understanding of the analytical approach and its relevance to the
data. This meets competency by logically justifying the use of the method.
1. Market Basket Analysis Explanation:
Market Basket Analysis (MBA) discovers relationships between items bought together
using association rules. In this dataset, it analyzes patterns of co-purchased ProductName
items under similar OrderID. Expected outcomes include rule sets like 'If product A, then
product B' with measurable support, confidence, and lift values.
2. Example Transaction:
OrderID: 536370
Products: [INFLATABLE POLITICAL GLOBE, SET2 RED RETROSPOT TEA
TOWELS, PANDA AND BUNNIES STICKER SHEET]
3. Assumption Summary:
Market Basket Analysis assumes that product co-occurrence in a single transaction
indicates a meaningful association that can inform marketing or inventory strategies.
Part III: Data Preparation and Analysis
Here, the report fulfills multiple rubric criteria by selecting and encoding appropriate
categorical variables and by correctly transactionalizing the dataset. Justification for each
transformation step is clearly provided, and required files—including both encoded and
cleaned datasets—are submitted.
, 1a. Selected Categorical Variables:
Nominal: ProductName, Country, Region, PaymentMethod
Ordinal: CustomerOrderSatisfaction, OrderPriority
1b. Encoding:
All four categorical variables selected in C1a were encoded using appropriate methods.
The ordinal variables OrderPriority and CustomerSatisfaction were mapped according to
the data dictionary: 'Low' to 'Critical' as 1 to 4, and 'Very Dissatisfied' to 'Very Satisfied'
as 2 to 4, with 'Prefer to not respond' encoded as 0. The nominal variables ProductName
and PaymentMethod were one-hot encoded to generate binary columns representing each
unique category. To ensure data quality, any rows with missing or invalid entries in these
fields were removed. The result is a complete and accurately encoded dataset ready for
market basket analysis.
1c. Transactionalization:
The dataset was grouped by OrderID, and product quantities were converted into a binary
format representing item presence per transaction.
1d. Justification:
To prepare the dataset, I selected four categorical variables: two ordinal (OrderPriority,
CustomerOrderSatisfaction) and two nominal (ProductName, PaymentMethod). These
were chosen because they influence customer purchasing behavior and allow for
meaningful pattern detection in the dataset.
OrderPriority and CustomerOrderSatisfaction were ordinally encoded to preserve their
inherent rankings, where "High" priority or "Very Satisfied" customers may indicate
more intentional or valuable purchases. For nominal variables, I used one-hot encoding to
represent each category as a binary column, which is suitable for preparing a dataset for
market basket analysis.
After encoding, the dataset was filtered to include only high-priority transactions in the
Northeast region to align with the research question. Then, transactionalization was
performed by grouping transactions by OrderID and converting item purchases into a
binary matrix format where 1 indicates an item was purchased in a given transaction.
This format is required by the Apriori algorithm.
2. Cleaned Dataset:
See attached file: Cleaned_Megastore_Task3.csv
3–5. Association Rules:
The Apriori algorithm generated multiple rules. Below are the top three relevant rules,
ranked by lift:
Part I: Research Question
This section demonstrates competency by presenting a specific, relevant, and addressable
business question. It also outlines a clearly defined analysis goal that is aligned with the
dataset and the capabilities of Market Basket Analysis. Together, these elements ensure
the report has a logical purpose and measurable direction.
1. Proposed Question:
Which products are frequently co-purchased in high-priority transactions from the
Northeast region?
2. Defined Goal:
The goal of this analysis is to identify product bundles from high-priority Northeast
orders to inform targeted promotions and cross-selling strategies.
Part II: Market Basket Justification
This section explains why Market Basket Analysis is the appropriate technique for the
given scenario. By including an example transaction and a core assumption of the
method, it confirms understanding of the analytical approach and its relevance to the
data. This meets competency by logically justifying the use of the method.
1. Market Basket Analysis Explanation:
Market Basket Analysis (MBA) discovers relationships between items bought together
using association rules. In this dataset, it analyzes patterns of co-purchased ProductName
items under similar OrderID. Expected outcomes include rule sets like 'If product A, then
product B' with measurable support, confidence, and lift values.
2. Example Transaction:
OrderID: 536370
Products: [INFLATABLE POLITICAL GLOBE, SET2 RED RETROSPOT TEA
TOWELS, PANDA AND BUNNIES STICKER SHEET]
3. Assumption Summary:
Market Basket Analysis assumes that product co-occurrence in a single transaction
indicates a meaningful association that can inform marketing or inventory strategies.
Part III: Data Preparation and Analysis
Here, the report fulfills multiple rubric criteria by selecting and encoding appropriate
categorical variables and by correctly transactionalizing the dataset. Justification for each
transformation step is clearly provided, and required files—including both encoded and
cleaned datasets—are submitted.
, 1a. Selected Categorical Variables:
Nominal: ProductName, Country, Region, PaymentMethod
Ordinal: CustomerOrderSatisfaction, OrderPriority
1b. Encoding:
All four categorical variables selected in C1a were encoded using appropriate methods.
The ordinal variables OrderPriority and CustomerSatisfaction were mapped according to
the data dictionary: 'Low' to 'Critical' as 1 to 4, and 'Very Dissatisfied' to 'Very Satisfied'
as 2 to 4, with 'Prefer to not respond' encoded as 0. The nominal variables ProductName
and PaymentMethod were one-hot encoded to generate binary columns representing each
unique category. To ensure data quality, any rows with missing or invalid entries in these
fields were removed. The result is a complete and accurately encoded dataset ready for
market basket analysis.
1c. Transactionalization:
The dataset was grouped by OrderID, and product quantities were converted into a binary
format representing item presence per transaction.
1d. Justification:
To prepare the dataset, I selected four categorical variables: two ordinal (OrderPriority,
CustomerOrderSatisfaction) and two nominal (ProductName, PaymentMethod). These
were chosen because they influence customer purchasing behavior and allow for
meaningful pattern detection in the dataset.
OrderPriority and CustomerOrderSatisfaction were ordinally encoded to preserve their
inherent rankings, where "High" priority or "Very Satisfied" customers may indicate
more intentional or valuable purchases. For nominal variables, I used one-hot encoding to
represent each category as a binary column, which is suitable for preparing a dataset for
market basket analysis.
After encoding, the dataset was filtered to include only high-priority transactions in the
Northeast region to align with the research question. Then, transactionalization was
performed by grouping transactions by OrderID and converting item purchases into a
binary matrix format where 1 indicates an item was purchased in a given transaction.
This format is required by the Apriori algorithm.
2. Cleaned Dataset:
See attached file: Cleaned_Megastore_Task3.csv
3–5. Association Rules:
The Apriori algorithm generated multiple rules. Below are the top three relevant rules,
ranked by lift: