Pranjal-psytech commited on
Commit
d03fc86
1 Parent(s): 896a005
Files changed (1) hide show
  1. app.py +8 -21
app.py CHANGED
@@ -36,33 +36,20 @@ examples = [
36
  [72, 1, 3, 160, 114, 0, 0, 115, 0, 1.1, 2, 0, 7],
37
  ]
38
 
39
- app = gr.Interface(fn=heart_disease, inputs=[
40
  gr.inputs.Number(label="Age"),
41
- gr.inputs.Radio(choices=[("Male", 1), ("Female", 0)], label="Sex"),
42
- gr.inputs.Radio(choices=[
43
- ("Typical Angina", 0),
44
- ("Atypical Angina", 1),
45
- ("Non-Anginal Pain", 2),
46
- ("Asymptomatic", 3)
47
- ], label="Chest Pain Type"),
48
  gr.inputs.Number(label="Resting Blood Pressure (mm Hg)"),
49
  gr.inputs.Number(label="Serum Cholesterol Level (mg/dL)"),
50
- gr.inputs.Radio(choices=[("Fasting Blood Sugar > 120 mg/dL", 1), ("Fasting Blood Sugar <= 120 mg/dL", 0)], label="Fasting Blood Sugar Level"),
51
- gr.inputs.Radio(choices=[
52
- ("Normal", 0),
53
- ("ST-T Wave Abnormality", 1),
54
- ("Probable or Definite Left Ventricular Hypertrophy", 2)
55
- ], label="Resting Electrocardiographic Results"),
56
  gr.inputs.Number(label="Maximum Heart Rate Achieved"),
57
- gr.inputs.Radio(choices=[("Exercise-Induced Angina", 1), ("No Exercise-Induced Angina", 0)], label="Exercise-Induced Angina"),
58
  gr.inputs.Number(label="ST Depression Induced by Exercise Relative to Rest"),
59
- gr.inputs.Radio(choices=[("Upsloping", 0), ("Flat", 1), ("Downsloping", 2)], label="Slope of the Peak Exercise ST Segment"),
60
  gr.inputs.Number(label="Number of Major Vessels (0-3) Colored by Fluoroscopy"),
61
- gr.inputs.Radio(choices=[
62
- ("Normal", 3),
63
- ("Fixed Defect", 6),
64
- ("Reversible Defect", 7)
65
- ], label="Thalassemia")
66
  ], outputs=outputs, examples=examples,title="Heart Disease Prediction",description='''
67
  This model predicts the presence of heart disease based on various input parameters. Please enter the values for the following inputs:
68
 
 
36
  [72, 1, 3, 160, 114, 0, 0, 115, 0, 1.1, 2, 0, 7],
37
  ]
38
 
39
+ app = gr.Interface(fn=heart_disease, inputs=[
40
  gr.inputs.Number(label="Age"),
41
+ gr.inputs.Number(label="Sex (0 for Female, 1 for Male)"),
42
+ gr.inputs.Number(label="Chest Pain Type (0 for Typical Angina, 1 for Atypical Angina, 2 for Non-Anginal Pain, 3 for Asymptomatic)"),
 
 
 
 
 
43
  gr.inputs.Number(label="Resting Blood Pressure (mm Hg)"),
44
  gr.inputs.Number(label="Serum Cholesterol Level (mg/dL)"),
45
+ gr.inputs.Number(label="Fasting Blood Sugar Level (0 for <= 120 mg/dL, 1 for > 120 mg/dL)"),
46
+ gr.inputs.Number(label="Resting Electrocardiographic Results (0 for Normal, 1 for ST-T Wave Abnormality, 2 for Probable or Definite Left Ventricular Hypertrophy)"),
 
 
 
 
47
  gr.inputs.Number(label="Maximum Heart Rate Achieved"),
48
+ gr.inputs.Number(label="Exercise-Induced Angina (0 for No, 1 for Yes)"),
49
  gr.inputs.Number(label="ST Depression Induced by Exercise Relative to Rest"),
50
+ gr.inputs.Number(label="Slope of the Peak Exercise ST Segment (0 for Upsloping, 1 for Flat, 2 for Downsloping)"),
51
  gr.inputs.Number(label="Number of Major Vessels (0-3) Colored by Fluoroscopy"),
52
+ gr.inputs.Number(label="Thalassemia (3 for Normal, 6 for Fixed Defect, 7 for Reversible Defect)")
 
 
 
 
53
  ], outputs=outputs, examples=examples,title="Heart Disease Prediction",description='''
54
  This model predicts the presence of heart disease based on various input parameters. Please enter the values for the following inputs:
55