Overview
This project built a production-ready Multi-SIM detection system for a telecom operator. The objective was to identify subscribers who use multiple SIM cards across different operators — a behavior that is economically significant but invisible in any single database column.
The challenge was not modeling. It was label construction. No reliable ground truth existed. The project had to build the label from scratch, using a pipeline that went from behavioral hypotheses to unsupervised discovery, then from profiled clusters to rule-based operationalization and supervised scoring.
The full pipeline combined four data domains (usage, social graph, handset, geolocation), multiple clustering iterations, call-center validation, data augmentation across months, and a decision tree designed not for accuracy alone — but for business-readable rule extraction.
Pipeline at a glance
Define what Multi-SIM behavior should look like in telecom usage traces before any modeling
Fuse usage, social graph (CLA), handset characteristics, and geolocation into one analytical base table
Run iterative segmentation not to partition the full base — but to isolate the one cluster that matches the hypothesized pattern
Cross-validate the discovered cluster against agent-confirmed Multi-SIM and mono-SIM subscriber lists
Train decision tree on labeled data, extract interpretable thresholds, adjust for business readability, deploy for monthly scoring
Architecture
📋 View detailed text-based architecture diagram
┌─────────────────────────────────────────────────────────┐
│ PHASE 1: DISCOVERY — Building the Label │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ Behavioral Hypotheses │
│ asymmetric in/out, recharge instability, │
│ selective service use, community structure │
└──────────────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Multi-Source ABT Construction │
│ Usage (OG/IC) + CLA Social Graph │
│ + Handset/SIM type + Geolocation │
│ 3-month rolling averages for temporal stability│
└──────────────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Unsupervised Segmentation (iterations A → G) │
│ K-means compression → Hierarchical Ward │
│ Profiling each candidate cluster │
└──────────────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Multi-SIM Phenotype Identified │
│ Cluster 7F — best match for hypothesized │
│ behavioral signature │
└──────────────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Call-Center Validation │
│ Cross-check against agent-confirmed lists │
│ (mono-SIM confirmed / Multi-SIM confirmed) │
└──────────────────────┬──────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ PHASE 2: OPERATIONALIZATION — Scoring at Scale │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Manual Rule Extraction │
│ role score, degree in/out, community size, │
│ TT share in community, traffic frequency │
└──────────────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Data Augmentation (multi-month labeled set) │
│ Extend labeled population across time windows │
└──────────────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Decision Tree Training │
│ 7 key variables: Days with Calls, │
│ Recharge Count, Cross-Operator Call Share, │
│ Cross-Operator Duration Share, │
│ TT Community Share, Recharge Frequency, │
│ Outgoing Traffic Frequency │
└──────────────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Business Threshold Adjustment │
│ Round values, validate with CVM teams │
└──────────────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Monthly Production Scoring │
│ Full base re-scored every month │
│ Without re-running unsupervised pipeline │
└─────────────────────────────────────────────────┘
The Segment Was Discovered Unsupervised. The Final Target Was Defined by Rules.
In a telecom Multi-SIM detection project, we did not start with a clean target label.
There was no reliable column saying: this customer is definitely Multi-SIM.
So the project started differently. First, we defined behavioral hypotheses for what a likely Multi-SIM customer should look like in telecom data. Then we used unsupervised segmentation to search for clusters that matched that behavioral shape. Once the relevant cluster was identified and profiled, we translated that latent segment into an operational target.
The label-construction pipeline
The final target was not given at the beginning. It was constructed after discovery.
Why this matters in practice
The standard assumption
Most ML workflows start with a labeled dataset. Target column exists. Train/test split. Fit model. The label is assumed to be ready.
This project's reality
No label column existed. Label had to be constructed. The pipeline was: domain theory → data → discovery → definition → label. Discovery preceded the target.
Validation: call-center ground truth
Once the cluster was profiled and rules were extracted, the labeled population was cross-validated against call-center confirmed lists: agents who had directly spoken with subscribers and confirmed whether they used multiple SIMs.
This was the closest thing to ground truth available — and it was used as validation, not as the starting point.
Selected code: profiling the candidate cluster against population means
/* Profile cluster 7F (candidate Multi-SIM segment) against full base */
/* Compare means across 50+ behavioral dimensions */
proc means data=libcomdm.mt_multi (where=(7f=1)) n mean;
var
ARPU ARPM Evaporation
DUREE_APPEL DUREE_APPEL_IN
Duree_offnet DUREE_APPEL_OFF_Net_IN
P_Dur_G P_DUR_OOR P_DUR_ORG
DUR_Out_In DUR_OUT_IN_TT DUR_OUT_IN_Ooredoo DUR_OUT_IN_Orange
Freq_OUT Freq_IN
Rech_Moy Freq_rech NB_JR_RECHARGE
role_quant NB_Comm
Prct_Comm_TT Prct_Comm_OOR Prct_Comm_ORG
deg_in deg_out R_IN_OU_deg
freq_data VOL_FMS NB_JOUR_MOIS
ANC_M avg_j_S SEG_MOB_Q;
run;
/* Result: cluster 7F shows distinctive profile */
/* Low deg_in, low deg_out, low Prct_Comm_TT */
/* High Freq_OUT relative to incoming, small community size */
Design insight: In some real-world problems, the target is not a column you receive. It is the result of hypothesis → clustering → profiling → definition. Applied ML does not always begin with labeled truth. Sometimes it begins with a behavioral pattern you have to uncover first.
The First Model Input Was Not Labels. It Was Behavioral Hypotheses.
In a telecom Multi-SIM project, the first step was not choosing an algorithm.
It was writing down what Multi-SIM behavior should look like in real usage traces — before any data was pulled, before any variable was built, before any clustering was run.
The hypotheses
- Asymmetric in/out behavior — outgoing activity very different from incoming, suggesting calls routed through a different SIM for receiving
- Low community TT share — social group dominated by competitor-network subscribers, indicating the TT SIM is used selectively
- Selective service use — strong activity on one service type, weak or zero on others
- Recharge instability — irregular recharge patterns inconsistent with primary-SIM usage
- Small, isolated community — few connections, small community size, low degree in/out
- Handset multi-SIM capability — Nano or Micro SIM type, smartphone device class
How hypotheses shaped the pipeline
Variable Selection
Hypotheses determined which features entered the ABT — not just statistical availability.
DUR_OUT_IN_TT, DUR_OUT_IN_Ooredoo, Prct_Comm_TT, R_IN_OU_deg
Cluster Profiling Criteria
Hypotheses defined what a "good" candidate cluster should show when profiled.
Low deg_in, high Freq_OUT, low Prct_Comm_TT, small NB_Comm
Rule Extraction Focus
Hypotheses identified which variable splits to prioritize during rule extraction.
role_quant ≤ 2, r_in_ou_deg ≤ 0.8, prct_comm_tt ≤ 0.2
Validation Logic
Hypotheses provided the checklist for validating whether the discovered cluster was meaningful.
Does the cluster show all 6 hypothesized behavioral signals?
From hypothesis to measurable feature
/* Hypothesis: Multi-SIM users have asymmetric in/out behavior */
/* Measured as: ratio of incoming to outgoing duration */
Outgoing_Incoming_Duration_TT = Outgoing_MOU / Incoming_MOU /* overall ratio */
Outgoing_Incoming_Duration_OOR = Outgoing_Local_Offnet_OOR / Incoming_MOU_OOR /* operator-specific */
Degree_In_Out_Ratio = Incoming_Degree / Outgoing_Degree /* degree asymmetry */
Active_Day_In_Out_Ratio = Days_Calls_Incoming / Days_with_Calls /* active day ratio */
/* Hypothesis: Low TT engagement relative to community */
TT_Community_Share = (TT_Members - 1) / (Community_Size - 1) /* TT share excluding self */
/* Hypothesis: Selective service use */
Voice_Share_Total = Total_Call_Duration / Outgoing_MOU /* voice share of total */
Voice_Share_Ooredoo = Ooredoo_Call_Duration / Outgoing_MOU /* Ooredoo call share */
Voice_Share_Orange = Orange_Call_Duration / Outgoing_MOU /* Orange call share */
Design insight: Good modeling sometimes starts before the dataset. It starts with a behavioral theory precise enough to become features. Hypotheses that cannot be translated into measurable variables should be revised, not ignored — because they reveal missing data sources.
We Did Not Use Clustering to Segment the Whole Base. We Used It to Isolate One Behavioral Phenotype.
In a telecom Multi-SIM project, clustering was not used in the usual way.
The objective was not to produce a complete, elegant segmentation of the full customer base. The actual goal was narrower: find the one cluster that best captured Multi-SIM-like behavior.
Two different uses of clustering
Standard segmentation goal
Partition the full customer base into coherent, equally meaningful, operationally distinct groups.
Every cluster matters. The whole partition is the deliverable.
This project's goal
Surface the one cluster that most closely matches the hypothesized Multi-SIM behavioral profile.
One cluster is the deliverable. The others are context.
What changed because of this framing
- Multiple variable sets were tested — not to optimize global cohesion, but to see which set made the target phenotype most separable
- Multiple cluster solutions (A through G) were compared — each profiled specifically for whether the candidate Multi-SIM cluster appeared cleanly
- Cluster evaluation was behavioral, not just statistical — pseudo-F and R² helped, but the final decision was whether the cluster looked like the hypothesis
- No requirement that other clusters be perfect — they needed to be coherent enough, not optimal
Iteration process: testing cluster solutions
/* Each iteration used a different variable set */
/* Goal: find the one that makes the Multi-SIM phenotype clearest */
/* Iteration A: usage variables only */
/* Iteration B: usage + social graph */
/* Iteration C: usage + social graph + handset */
/* Iteration D: usage + social graph + handset + geo */
/* Iterations E-G: variable subset combinations */
/* For each solution: profile the candidate cluster */
proc means data=seg_iteration_d (where=(cluster_id = 7)) n mean;
var TT_Community_Share Incoming_Degree Outgoing_Degree Outgoing_Traffic_Freq Degree_In_Out_Ratio Community_Size;
run;
/* Selection criterion: which iteration produces a cluster */
/* where TT_Community_Share is lowest, Incoming_Degree/Outgoing_Degree are most asymmetric, */
/* Outgoing_Traffic_Freq is highest relative to population mean? */
/* Answer: iteration D (all 4 domains) — cluster 7F */
Why this matters for search-driven segmentation
Framing clustering as a search tool rather than a taxonomy tool changes how you evaluate results. You are not asking "is this a good partition?" You are asking "does this partition reveal the pattern I am looking for?"
That question has a cleaner answer — and it keeps the modeling purpose honest.
Design insight: Unsupervised learning is not always about building a full taxonomy. Sometimes it is about isolating one meaningful pattern that would be hard to label directly. Clustering does not always need to explain the whole population — sometimes it only needs to help you find the part you care about most.
A Discovered Segment Is Not Operational Until You Can Assign It Back with Rules.
In a telecom Multi-SIM project, unsupervised segmentation helped identify a cluster that strongly resembled Multi-SIM behavior.
That answered one question: where is the latent pattern?
But it did not answer the next one: how do we assign future subscribers to that segment at scale, in a way the business can actually use?
The operationalization pipeline
1 — Label
Assign the discovered cluster's identity as a supervised target variable for existing subscribers.
2 — Augment
Extend labeled population across multiple months to increase training set size and temporal diversity.
3 — Train
Fit decision tree on labeled data. Compare with neural network and logistic regression as benchmarks.
4 — Extract and Adjust
Extract splitting rules. Round thresholds to business-meaningful values. Validate with CVM teams.
From manual rule to adjusted business rule
/* Step 1: Manual rules extracted from cluster profiling */
proc sql;
create table libcomdm.MT_multi_manual as select a.*
from libcomdm.mt_multi a
where Role_Rank <= and /* peripheral role in community */
Degree_In_Out_Ratio <= and /* outgoing dominates incoming */
Incoming_Degree <= and /* very few inbound connections */
Outgoing_Degree <= and /* very few outbound connections */
Community_Size <= and /* small community size */
TT_Community_Share <= and /* less than % TT in community */
Incoming_Call_Frequency >= and /* minimum incoming call frequency */
Outgoing_Traffic_Frequency >=; /* high outgoing call frequency */
quit;
/* Step 2: Decision tree trained on labeled multi-month data */
/* Key variables selected by tree: */
/* Days_with_Calls, Recharge_Count, Cross_Op_Call_Share, Cross_Op_Duration_Share */
/* TT_Community_Share, Recharge_Frequency, Outgoing_Traffic_Frequency */
/* Step 3: Raw tree split example */
/* if TT_Community_Share < and Outgoing_Traffic_Freq > → Multi-SIM */
/* Step 4: Business-adjusted rule */
/* if TT_Community_Share < and Outgoing_Traffic_Frequency > → Multi-SIM */
/* Rounded. Readable. Validated with CVM team. */
Variable mapping: from cluster profiling to decision tree
/* Cluster profile variables → Decision tree input variables */
Role_Rank → Role_in_Community
Community_Size → Community_Size_Bins
Degree_In_Out_Ratio → Degree_Asymmetry
Incoming_Degree → Incoming_Connections
Outgoing_Degree → Outgoing_Connections
TT_Community_Share → TT_Community_Share /* kept as-is */
Incoming_Call_Frequency → Incoming_Traffic_Freq
Outgoing_Traffic_Frequency → Outgoing_Traffic_Frequency /* kept as-is */
Days_with_Calls → Days_with_Calls /* kept as-is */
Recharge_Count → Recharge_Count /* kept as-is */
Cross_Op_Call_Share → Cross_Op_Call_Share /* kept as-is */
Cross_Op_Duration_Share → Cross_Op_Duration_Share /* kept as-is */
Why the cluster size changes after rule extraction
A discovered cluster of 239K subscribers may become a rule-based segment of 373K after applying the extracted rules to the full base. That is expected and acceptable.
The original cluster was defined by distance-based geometry. The rule-based segment is defined by interpretable conditions. The two definitions capture slightly different populations — and the goal shifts: from preserving exact cluster membership to producing a stable, reusable assignment system.
Design insight: Discovery is unsupervised. Assignment is supervised. The bridge between them is rule extraction with business-adjusted thresholds. The model that assigns is not the model that discovered — and that is not a weakness. It is the architecture.
Four Data Domains. One Behavioral Question. No Single Source Could Answer It Alone.
In a telecom Multi-SIM project, one of the most important decisions was not about modeling.
It was about which data sources to combine.
A single usage table cannot tell you whether a subscriber is truly low-usage, or simply splitting behavior across multiple SIMs from different operators. Each domain alone gives partial signal. Together, they form a realistic behavioral picture.
The four data domains
Usage Behavior
- Outgoing/incoming MOU by operator (TT, Ooredoo, Orange, Lyca, Nessma)
- Weekend vs weekday splits (OG_MOU_WEND, OG_MOU_WDAY)
- On-net vs off-net volumes and charges
- SMS volumes, roaming, international
- 3-month rolling averages (L3P_AVG) for temporal stability
Social Graph (CLA)
- Community membership and size (NB_Comm)
- Operator mix in community (Prct_Comm_TT, Prct_Comm_OOR, Prct_Comm_ORG)
- Degree in / degree out (deg_in, deg_out)
- In/out degree ratio (R_IN_OU_deg)
- Role in graph: Leader, Bridge, Follower
Handset and SIM Type
- SIM format: Nano, Micro, Micro+Nano, Mini
- Device class: Smartphone vs Feature Phone
- Mobility score 0–5 derived from SIM+device combination
- Higher score = more likely to support dual-SIM usage
Geolocation
- Cell-ID mapped to site coordinates (X, Y)
- Delegation and region classification
- Urban vs Rural flag from 2G/3G tower data
- Mobility footprint: distinct sites visited per month
How the four domains combine into the ABT
/* Final ABT: join all four domain tables on subscriber + month */
proc sql;
create table libcomdm.Mahmoud_Usage_NetWork as
select distinct
coalesce(a.subscrp_id, b.subscrp_id) as subscrp_id,
coalesce(a.month, b.months) as Month,
a.*, /* usage layer: OG/IC MOU, SMS, charges, L3P_AVG */
b.* /* geolocation: HOME_CELL_NAME, DELEGATION, REGION, Tech */
from libcomdm.MT_Usage1 a
full join MT_Net_Work b
on a.subscrp_id = b.subscrp_id
and a.month = b.months;
/* Then join: social graph layer (CLA) */
/* Already embedded via Prct_Comm_TT, deg_in, deg_out, role */
/* Then join: handset layer */
/* SEG_MOB_Q (0-5) from SIM type + device class */
/* case TYPE_SIM = 'Nano' then 5 */
/* case TYPE_SIM = 'Micro,Nano' then 4 */
/* case TYPE_SIM in ('Micro','Micro,Mini') then 3*/
/* case Smartphone + Mini/unknown then 2 */
/* case Mobile Phone then 1 else 0 */
Why no single domain was sufficient
A subscriber with low outgoing MOU might be inactive — or splitting traffic across a Ooredoo SIM for offnet calls. Usage alone cannot distinguish the two.
But if that same subscriber also has a community dominated by competitor-network users, a handset score of 4 (Micro+Nano dual-SIM capable), and an urban location with high operator competition — the interpretation changes completely.
Design insight: In applied ML, feature engineering across multiple data systems often matters more than model selection. Each domain captures a different dimension of the same behavior. The algorithm is usually the easy part. The hard part is assembling the right signal from scattered sources.
Why This Matters
- Shows that in real-world ML, the hardest problem is often label construction — not model selection
- Demonstrates that unsupervised clustering can be used as a search tool for one behavioral phenotype, not just for full-base taxonomy
- Treats behavioral hypotheses as first-class design inputs — not as informal pre-analysis
- Bridges unsupervised discovery to production assignment through interpretable rule extraction
- Shows that a discovered cluster and a rule-based segment are two different things — and that the gap between them is acceptable by design
- Fuses four data domains (usage, social graph, handset, geography) into one ABT — each contributing signal that the others cannot provide alone
Where This Pattern Generalizes
The same pipeline applies in any domain where a latent behavior must be discovered before it can be labeled and scored:
- Banking — detecting account-sharing or proxy-use patterns without ground truth
- Insurance — identifying undisclosed household structures from claims behavior
- E-commerce — spotting shared-account usage across multiple real users
- Subscription services — finding credential-sharing without direct observation
- Healthcare — surfacing care-avoidance patterns before labeling dropout behavior
The reusable pattern: when no label exists, build it. Use domain hypotheses to guide discovery. Use discovery to create a definition. Use the definition to train an assignment system that works at scale.
Key Takeaway
The Multi-SIM detection project did not start with a model problem. It started with a label problem.
No system tracked Multi-SIM behavior. No flag existed. The data was available — but the target was not.
Building the target required a full pipeline: hypotheses, discovery, profiling, validation, rule extraction, and only then — supervised scoring.
That pipeline took longer than training any model. But it was the only honest path from a behavioral question to a production answer.
Final insight: The model that assigns subscribers is not the model that discovered the behavior. The label that trained the classifier was not a column in any database — it was constructed through six stages of applied data science. That is what the project was actually about.