-
Notifications
You must be signed in to change notification settings - Fork 0
03. Data Understanding
- Customer Profile: Customer Profile: GitHub - Leangonplu/Ecommerce_Customer_Churn_Analysis_and_Prediction: Ecommerce Customer Churn Analysis and Prediction
- Customer Metrics: Customer Metrics: 🛒 E-commerce Customer Data For Behavior Analysis | Kaggle
- Marketing Channels and Campaigns: E-commerce multichannel direct messaging 2021-2023 (kaggle.com)
- Customer Reviews Table: [Amazon Sales Dataset. (2023, January 17). Kaggle.] https://www.kaggle.com/datasets/karkavelrajaj/amazon-sales-dataset
| Column Name | Data Type | Description |
|---|---|---|
| Customer ID | int64 | Unique identifier for each customer. |
| Purchase Date | object | The date of the purchase, recorded as a string (yyyy-mm-dd format). |
| Product Category | object | The category of the purchased product (e.g., Electronics, Clothing). |
| Product Price | int64 | The price of the purchased product, in the local currency. |
| Quantity | int64 | The quantity of the product purchased. |
| Total Purchase Amount | int64 | The total amount spent for the purchase. This is the product of Product Price and Quantity. |
| Payment Method | object | The payment method used by the customer (e.g., Credit Card, PayPal). |
| Customer Age | int64 | The age of the customer at the time of purchase. |
| Returns | float64 | Indicates if the product was returned (1.0 for return, 0.0 for not returned, or NaN if not applicable). |
| Customer Name | object | The name of the customer. |
| Age | int64 | The customer's age, potentially derived from their profile information. |
| Gender | object | The gender of the customer (e.g., Male, Female). |
| Churn | int64 | Indicates whether the customer has churned (1 for churned, 0 for active). |
This table contains key metrics related to customer behavior and engagement, including demographic information, churn status, order history, and feedback indicators.
| Column Name | Description | Type |
|---|---|---|
| CustomerID | Unique customer ID | int64 |
| Churn | Churn Flag | int64 |
| Tenure | Tenure of customer in organization | float64 |
| PreferredLoginDevice | Preferred login device of customer | object |
| CityTier | City tier | int64 |
| WarehouseToHome | Distance between warehouse and home of customer | float64 |
| PreferredPaymentMode | Preferred payment method of customer | object |
| Gender | Gender of customer | object |
| HourSpendOnApp | Number of hours spent on mobile application or website | float64 |
| NumberOfDeviceRegistered | Total number of devices registered for customer | int64 |
| PreferedOrderCat | Preferred order category of customer in last month | object |
| SatisfactionScore | Satisfaction score of customer on service | int64 |
| MaritalStatus | Marital status of customer | object |
| NumberOfAddress | Total number of addresses added for customer | int64 |
| Complain | Any complaints raised in the last month | int64 |
| OrderAmountHikeFromlastYear | Percentage increase in orders from last year | float64 |
| CouponUsed | Total number of coupons used in the last month | float64 |
| OrderCount | Total number of orders placed in the last month | float64 |
| DaySinceLastOrder | Days since the last order by customer | float64 |
| CashbackAmount | Average cashback in the last month | float64 |
All messages are related to some kind of campaigns.
campaign_id is unique only for the specific campaign_type. Two campaigns with different campaign_type can have the same campaign_id. So the unique campaign identifier is campaign_type + campaign_id.
| Column Name | Description | Type |
|---|---|---|
| id | Campaign ID | int64 |
| campaign_type | Campaign type (bulk, trigger, transactional) | object |
| channel | Channel (email, mobile_push, web_push, sms) | object |
| topic | Meaning of a campaign | object |
| started_at | Bulk campaign start datetime | object |
| finished_at | Bulk campaign finish datetime | object |
| total_count | Total recipients in bulk campaign | float64 |
| ab_test | Bulk campaign with A/B test mode | object |
| warmup_mode | Bulk campaign with warmup mode | object |
| hour_limit | Hour limit for a bulk campaign with warmup mode | float64 |
| subject_length | Email subject length | float64 |
| subject_with_personalization | Subject contains recipient's name | object |
| subject_with_deadline | Subject has deadline meaning | object |
| subject_with_emoji | Subject has emoji symbols | object |
| subject_with_bonuses | Subject mentions bonuses for actions | object |
| subject_with_discount | Subject mentions a discount | object |
| subject_with_saleout | Subject mentions a sale out | object |
| is_test | It's a test campaign (bulk campaigns only) | object |
| position | Priority of trigger campaigns | float64 |
| Column Name | Description | Type |
|---|---|---|
| id | Message sequence ID (not useful) | int64 |
| message_id | Message unique ID | object |
| campaign_id | Campaign ID (from campaigns.csv) | int64 |
| message_type | Campaign type | object |
| client_id | Client ID | int64 |
| channel | Message channel (email, web_push, mobile_push, sms) | object |
| category | Category (useless) | NULL |
| platform | Device type used to open a message | object |
| email_provider | Public email provider (for email messages) | object |
| stream | Additional identifier of data source | object |
| date | Date of the message event | object |
| sent_at | Timestamp when the message was sent | object |
| is_opened | Indicator if the message was opened | int64 |
| opened_first_time_at | Timestamp when the message was first opened | object |
| opened_last_time_at | Timestamp when the message was last opened | object |
| is_clicked | Indicator if the message was clicked | int64 |
| clicked_first_time_at | Timestamp when the message was first clicked | object |
| clicked_last_time_at | Timestamp when the message was last clicked | object |
| is_unsubscribed | Indicator if the recipient unsubscribed | int64 |
| unsubscribed_at | Timestamp when the recipient unsubscribed | object |
| is_hard_bounced | Indicator if the message hard bounced | int64 |
| hard_bounced_at | Timestamp when the message hard bounced | object |
| is_soft_bounced | Indicator if the message soft bounced | int64 |
| soft_bounced_at | Timestamp when the message soft bounced | object |
| is_complained | Indicator if a complaint was made | int64 |
| complained_at | Timestamp when the complaint was made | object |
| is_blocked | Indicator if the message was blocked | int64 |
| blocked_at | Timestamp when the message was blocked | object |
| is_purchased | Indicator if a purchase was made | int64 |
| purchased_at | Timestamp when the purchase was made | object |
| created_at | Timestamp when the record was created | object |
| updated_at | Timestamp when the record was last updated | object |
| Column Name | Description |
|---|---|
| product_id | Product ID of item purchased |
| product_name | Name of the product |
| category | Category the product belongs to |
| discounted_price | Discounted price of the product |
| actual_price | Actual price of the product |
| discount_percentage | Percentage of the discount of its original price |
| rating | Rating of the product on Amazon’s Website, on a scale from 0 to 5 |
| rating_count | Number of people who voted for the rating for that product |
| about_product | A description of the product |
| user_id | User ID of the consumer that purchased the product |
| user_name | The username of the consumer |
| review_id | Review ID of consumer who purchased the product gave |
| review_title | Summary of the review |
| review_content | Content of the review given by the consumer |
| img_link | Link containing an image of the product |
| product_link | Link of the product on the Amazon website |
The dataset provided contains customer transaction data, including information on purchase behavior, demographics, and churn status. Below are the key observations from the initial exploration:
-
Data Overview: The dataset consists of 13 columns capturing customer purchase data, demographic attributes, and churn information. The columns include identifiers like
Customer ID, transaction-related fields likePurchase Date,Product Price, andQuantity, as well as customer demographic profile fields likeAgeandGender. -
Data Types: The dataset includes various data types:
- Numerical columns:
Customer ID,Product Price,Quantity,Total Purchase Amount,Customer Age,Returns,Age, andChurn. - Categorical columns:
Product Category,Payment Method, andGender. - Date-related columns:
Purchase Date(stored as string).
- Numerical columns:
-
Missing Values: The
Returnscolumn contains some missing values (NaN), indicating that not all transactions have return information available. These need to be handled appropriately depending on the analysis requirements. -
Data Consistency: There are two age-related columns,
Customer AgeandAge, which may create redundancy or inconsistencies. Further examination is required to determine if they represent different points in time or if one can be removed.
- Correlation with churn only significantly high for some columns
- Some columns could be found in other tables, and should be removed to prevent data inconsistencies
- Churn values are imbalanced, which may require resampling techniques.
- Features with missing values had a skewed distribution and with possible gaps in data collection for new customers, it might be better to replace missing values with 0.
- Dataset Overview: The dataset consists of 1,906 rows and 19 columns
-
Data Types:
- Numerical Data Types:
id,total_count,hour_limit,subject_lengthandposition - Categorical Data Types:
campaign_type,channel,topic,ab_test,warmup_mode,subject_with_personalization,subject_with_deadline,subject_with_emoji,subject_with_bonuses,subject_with_discount,subject_with_saleoutandis_test - Datetime Data Types:
started_atandfinished_at
- Numerical Data Types:
-
Missing Values: The
ab_test,positionandis_testcolumns have high percentages of missing data and will be flagged for potential removal due to sparsity.
- Dataset Overview: The dataset consists of 32 columns and an extensive number of rows. Due to its large size, we extracted a portion of the dataset for initial exploration.
-
Missing Values: The
categorycolumn is entirely null, making it not useful for analysis. Theplatformcolumn has 93% null values and theemail_providercolumn has 42% null values. -
Data Types:
- The columns
is_opened,is_clicked,is_unsubscribed,is_hard_bounced,is_soft_bounced,is_complained,is_blocked, andis_purchasedare stored as object types instead of boolean values. - All datetime-related columns are stored as
objecttypes instead ofdatetime.
- The columns
Completeness
- Returns Column: This column has missing values for approximately 19% of the records, with only 202,618 non-null values out of 250,000.
- Other Columns: All other columns are fully populated, with 250,000 non-null entries.
Consistency
- Duplicate Columns: The dataset contains both Customer Age and Age columns, which appear to hold identical information.
-
Total Purchase Amount Discrepancy: There is a significant discrepancy between the
Total Purchase Amountand the calculated value ofProduct Price * Quantity. Approximately 99.98% of the records (249,962 rows) do not match this calculation, indicating a potential data quality issue. This inconsistency may result from factors like discounts, additional fees, or data entry errors, but we do not have enough information to conclude.
Validity
- Date Format: The Purchase Date is currently stored as an object (string) type, and proper date-time formatting should be applied.
- Numerical Columns: No apparent issues with the data types for columns like Product Price, Quantity, and Total Purchase Amount, which are integers, or Returns, which is a float.
-
Missing Values:
- Tenure: 0.05% missing
- HourSpendOnApp: 0.05% missing
- CouponUsed: 0.05% missing
-
Duplicates: 0 duplicate records found
-
Missing Values Analysis:
- The
ab_test,positionandis_testcolumns have high percentages of missing data above 95% - The columns
finished_at,started_at,total_count,warmup_mode,topic,subject_length,subject_with_personalization,subject_with_deadline,subject_with_emoji,subject_with_bonuses,subject_with_discountandsubject_with_saleouthave a low percentage of missing data of below 5%
- The
- Duplicates: There are no duplicated rows and columns in the dataset
-
Validity: The
started_atandfinished_atcolumns should be converted fromobjecttodatetimeformat to ensure accurate chronological operations
-
Missing Values Analysis:
- The
categorycolumn, which is entirely null, will be removed - The
platformandemail_providercolumns, which have a significant number of null values, will be evaluated to determine their relevance and identify any necessary handling strategies
- The
-
Duplicates:
- There are no duplicated rows and columns in the dataset
-
Data Type Validity:
- The binary columns mentioned in the initial data exploration findings will be converted from
objecttypes tobooleanvalues - All datetime-related columns will be converted from
objecttypes todatetimeformats
- The binary columns mentioned in the initial data exploration findings will be converted from
Dataset Overview:
- The dataset contains 1465 entries with 16 columns. Each feature is a pandas object data type.
- It contains key metrics related to customer reviews and their ratings about the product they bought.
Missing values and duplicates:
- The column
rating_counthas two missing entries, accounting for 0.0014% of all observations. - There are no duplicated observations associated with the data.