Views
No views yet
pip install pgmpy pandas1from pgmpy.models import BayesianNetwork
2# Load the model
3model3 = BayesianNetwork.load('BDMobileNumberModelV3.bif', filetype='bif')1# Test phone number: +8801716312XXX
2# Remove +8801 and the last 3 digits, resulting in '716312'
3phone_number = {'D1': '7', 'D2': '1', 'D3': '6', 'D4': '3', 'D5': '1', 'D6': '2'}
4
5# Get the state probability
6probability = model3.get_state_probability(phone_number)
7
8# Display the result
9print(f"Result: {probability}")
10
11# Interpretation
12if probability > 0.0000001:
13 print("The phone number +8801716312XXX is most likely in active service.")
14else:
15 print("The phone number +8801716312XXX is likely inactive or incorrect.")
161# Test phone number: +8801716312XXX
2# Remove +8801 and try with fewer digits, e.g., '71631'
3shortened_phone_number = {'D1': '7', 'D2': '1', 'D3': '6', 'D4': '3', 'D5': '1'}
4
5# Get the state probability
6shortened_probability = model3.get_state_probability(shortened_phone_number)
7
8# Display the result
9print(f"Result: {shortened_probability}")
10