Exp 13
Exp 13
Program:
import bayespy as bp
import numpy as np
import csv
from colorama import init, Fore, Back, Style
init()
# Interactive Test
m = 0
while m == 0:
print("\n")
input_age = int(input('Enter Age (0-SuperSeniorCitizen, 1-SeniorCitizen, 2-
MiddleAged, 3-Youth, 4-Teen): '))
input_gender = int(input('Enter Gender (0-Male, 1-Female): '))
input_familyhistory = int(input('Enter FamilyHistory (0-Yes, 1-No): '))
input_diet = int(input('Enter Diet (0-High, 1-Medium, 2-Low): '))
input_lifestyle = int(input('Enter LifeStyle (0-Athlete, 1-Active, 2-Moderate,
3-Sedentary): '))
input_cholesterol = int(input('Enter Cholesterol (0-High, 1-BorderLine, 2-
Normal): '))
res = bp.nodes.MultiMixture([
input_age,
input_gender,
input_familyhistory,
input_diet,
input_lifestyle,
input_cholesterol
], bp.nodes.Categorical, p_heartdisease).get_moments()[0]
[heartDiseaseEnum['Yes']]