Data Mining Exercise 1
An overview of Data Mining (DM), its techniques, applications, and challenges.
Warning
This article is a work in progress and may contain incomplete information or inaccuracies. Please verify details from reliable sources.
Data Mining Exercise 1
Problem: Predict "Which customers are likely to change their provider next month?"
1. Data Selection
We don't need to pull all the data in the company's universe. We only select data that is likely to affect the decision to change providers.
Selected:
- Call history
- Billing amount
- Calls to Call Center
- Promotion type
Not selected:
- First and last name (unrelated to the decision)
- ID card number
- Favorite color
Simulated Raw Data Extracted:
| ID | Monthly_Bill (THB) | Data_Usage (GB) | Calls_to_Support (Times) | Contract | Last_Month_Usage | Churn (Label) | | --- | ---
--------------- | --------------- | ---------------------- | --------------- | ---------------- | ------------- | | 101 | 899 | 50 | 0 | 1 Year | 50 GB | No | | 102 | 1200 | 10 | 5 | Monthly | NULL | Yes | | 103 | 399 | 2 | 0 | Monthly | 2 GB | No | | 104 | 2500 | 100 | 1 | 2 Years | 200 GB | Yes |
2. Data Preprocessing
Raw data is often dirty. We need to handle it first.
🔍 Missing Values
- Problem: Customer 102's
Last_Month_Usagedata is missing (NULL). - Solution: Mean Imputation or drop it.
- Here, let's assume we fill in the mean = 40 GB.
⚡ Noise/Outlier
- Problem: Suppose Customer 104's internet usage last month was 200GB (abnormally high).
- Solution: Check if it's an error or actual usage.
- If actual usage → Keep it, because they might be a VIP group.
Result after Cleaning:
- ID 102:
Last_Month_Usagechanged fromNULL→40 GB
3. Data Transformation
This step involves transforming data to make it easier for Algorithms to understand and learn.
🔨 Feature Construction
Create Usage_Drop_Rate:
Usage_Drop_Rate = (Last month - This month) / Last monthReason: A sharp drop in usage might mean they've started using another provider's SIM.
📊 Normalization
Problem: Monthly_Bill (thousands) and Calls_to_Support (single digits) have scales that are too different.
Solution: Scale everything to a range of 0-1 (Min-Max Scaling).
🔢 Encoding
| ID | Norm_Bill | Norm_Support_Calls | Usage_Drop_Rate | Is_Monthly_Contract | Churn (Target) | | --- | ---
------ | ------------------ | ------------------ | ------------------- | -------------- | | 101 | 0.3 | 0.0 | 0.0 (Constant) | 0 | No | | 102 | 0.5 | 1.0 (Frequent calls)| 0.6 (Large drop) | 1 | Yes | | 103 | 0.1 | 0.0 | 0.0 | 1 | No | | 104 | 1.0 | 0.2 | 0.5 (Drop) | 0 | Yes |
4. Data Mining
Send the table data above into an Algorithm (like Decision Tree or Logistic Regression).
Goal: Find the relationship between (Bill, Calls, Drop_rate) and (Churn).
Simulating Algorithm Operation (Decision Tree Learning)
5. Pattern Evaluation
We have the "rules" now, we must see if they are reliable.
🧪 Test
Try applying the rules to guess a new set of customer data (Test Set).
Result:
- ✅ Guessed correctly 90 people
- ❌ Guessed incorrectly 10 people (e.g., guessed they would churn, but they didn't)
- Accuracy = 90%
💡 Interpretation
We found an interesting Pattern (Knowledge):
📌 Key Finding
"Customers who are on a Monthly Contract and have a usage drop of more than 50% or called the Call Center more than 3 times in a single month have a high chance of churning up to 85%."
Simulating Algorithm Operation (Decision Tree Learning)
The model will try to create rules like this:
- First Node: Check Calls_to_Support first → If > 0.8 (calls often) → High chance of Churn.
- Second Node: Check Usage_Drop_Rate → If drops more than 40% → High chance of Churn.
5. Pattern Evaluation
We have the "rules" now, we must see if they are reliable.
🧪 Test
Try applying the rules to guess a new set of customer data (Test Set).
Result:
- ✅ Guessed correctly 90 people
- ❌ Guessed incorrectly 10 people (e.g., guessed they would churn, but they didn't)
- Accuracy = 90%
💡 Interpretation
We found an interesting Pattern (Knowledge):
6. Knowledge Presentation & Action
This step is the destination of KDD.
🎯 Action
The system will automatically pull a list of customers who fall into this Pattern every morning.
🎁 Retention Campaign
Send an SMS or have an employee call to offer:
- "50% discount for 6 months" immediately.
- Before the customer walks over to a competitor's service center.
📝 Takeaway
| Step | Details | | ------
-------- | ------------------------------------------------------------------------------------------------- | | Input | Millions of rows of customer data | | KDD Process| Filter → Clean → Transform numbers → Create model → Select rules | | Output | "List of at-risk customers" and "Logic" indicating why they are at risk (e.g. frequent Call center calls) |
🎯 Goal: Allow the marketing team to solve the problem directly. KDD Process: Filter -> Clean -> Transform numbers -> Create model -> Select rules
Output: "List of at-risk customers" and "Logic" indicating why they are at risk (e.g. frequent Call center calls) to allow the marketing team to solve the problem directly.