File size: 2,000 Bytes
430e327 0cb4e89 f11ca36 26fa112 f11ca36 986893c f11ca36 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | ---
license: apache-2.0
language:
- en
metrics:
- accuracy
---
# BDMobileNumberModelV3
- **Developed by:** Ariful Ambia
- **Funded by:** Walton Hi-Tech Industries PLC.
- **Website:** https://www.waltonhil.com/
- **Model type:** Probabilistic Model
- **License:** [apache-2.0]
## Overview
Model BDMobileNumberModelV3 is a probabilistic model built using pgmpy Bayesian Network. It is trained on a large dataset of active mobile phone numbers in Bangladesh over the last 5 years. This model predicts the accuracy/State of a given mobile number, providing a probability as output. The model has been tested against known datasets, and it is observed that a probability less than 0.0000001 indicates that the number is likely inactive, wrong, or not currently in service.
## How to Use
### Installation
Install the required libraries:
``` bash
pip install pgmpy pandas
```
### Load the Model
``` python
from pgmpy.models import BayesianNetwork
# Load the model
model3 = BayesianNetwork.load('BDMobileNumberModelV3.bif', filetype='bif')
```
### Example Usage
``` python
# Test phone number: +8801716312XXX
# Remove +8801 and the last 3 digits, resulting in '716312'
phone_number = {'D1': '7', 'D2': '1', 'D3': '6', 'D4': '3', 'D5': '1', 'D6': '2'}
# Get the state probability
probability = model3.get_state_probability(phone_number)
# Display the result
print(f"Result: {probability}")
# Interpretation
if probability > 0.0000001:
print("The phone number +8801716312XXX is most likely in active service.")
else:
print("The phone number +8801716312XXX is likely inactive or incorrect.")
```
### Adjusting Phone Number Digits
``` python
# Test phone number: +8801716312XXX
# Remove +8801 and try with fewer digits, e.g., '71631'
shortened_phone_number = {'D1': '7', 'D2': '1', 'D3': '6', 'D4': '3', 'D5': '1'}
# Get the state probability
shortened_probability = model3.get_state_probability(shortened_phone_number)
# Display the result
print(f"Result: {shortened_probability}")
```
|