kkhushisaid commited on
Commit
ae60247
1 Parent(s): 63c4b45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -19
app.py CHANGED
@@ -3,10 +3,6 @@ import pickle
3
  import pandas as pd
4
  from sklearn.preprocessing import StandardScaler
5
  from sklearn.model_selection import train_test_split
6
- from sklearn import __version__ as sklearn_version
7
-
8
- # Check scikit-learn version
9
- print(f"scikit-learn version: {sklearn_version}")
10
 
11
  # Load the data
12
  heart = pd.read_csv('heart.dat', header=None, sep=' ', names=['age', 'sex', 'cp', 'trestbps', 'chol',
@@ -69,22 +65,22 @@ def make_prediction(age, sex, cp, trestbps, chol, fbs, restecg, thalach, exang,
69
 
70
  # Create the Gradio interface
71
  inputs = [
72
- gr.inputs.Number(label='age'),
73
- gr.inputs.Radio(choices=[0,1], label='sex'),
74
- gr.inputs.Dropdown(choices=[1,2,3,4], label='chest pain type'),
75
- gr.inputs.Number(label='resting blood pressure'),
76
- gr.inputs.Number(label='serum cholestoral'),
77
- gr.inputs.Radio(choices=[0,1], label='fasting blood sugar'),
78
- gr.inputs.Radio(choices=[0,1,2], label='resting electrocardiographic'),
79
- gr.inputs.Number(label='maximum heart rate'),
80
- gr.inputs.Radio(choices=[0,1], label='exercise induced angina'),
81
- gr.inputs.Number(label='oldpeak'),
82
- gr.inputs.Dropdown(choices=[1,2,3], label='slope ST'),
83
- gr.inputs.Dropdown(choices=[0,1,2,3], label='major vessels'),
84
- gr.inputs.Dropdown(choices=[3,6,7], label='thal'),
85
- gr.inputs.Dropdown(choices=['Tree', 'QDA', 'MLP', 'Log', 'LDA', 'For', 'SVM'], label='Select the model')
86
  ]
87
 
88
- outputs = gr.outputs.Label(label='Predicted class probabilities')
89
 
90
  gr.Interface(fn=make_prediction, inputs=inputs, outputs=outputs).launch()
 
3
  import pandas as pd
4
  from sklearn.preprocessing import StandardScaler
5
  from sklearn.model_selection import train_test_split
 
 
 
 
6
 
7
  # Load the data
8
  heart = pd.read_csv('heart.dat', header=None, sep=' ', names=['age', 'sex', 'cp', 'trestbps', 'chol',
 
65
 
66
  # Create the Gradio interface
67
  inputs = [
68
+ gr.Number(label='age'),
69
+ gr.Radio(choices=[0,1], label='sex'),
70
+ gr.Dropdown(choices=[1,2,3,4], label='chest pain type'),
71
+ gr.Number(label='resting blood pressure'),
72
+ gr.Number(label='serum cholestoral'),
73
+ gr.Radio(choices=[0,1], label='fasting blood sugar'),
74
+ gr.Radio(choices=[0,1,2], label='resting electrocardiographic'),
75
+ gr.Number(label='maximum heart rate'),
76
+ gr.Radio(choices=[0,1], label='exercise induced angina'),
77
+ gr.Number(label='oldpeak'),
78
+ gr.Dropdown(choices=[1,2,3], label='slope ST'),
79
+ gr.Dropdown(choices=[0,1,2,3], label='major vessels'),
80
+ gr.Dropdown(choices=[3,6,7], label='thal'),
81
+ gr.Dropdown(choices=['Tree', 'QDA', 'MLP', 'Log', 'LDA', 'For', 'SVM'], label='Select the model')
82
  ]
83
 
84
+ outputs = gr.Label(label='Predicted class probabilities')
85
 
86
  gr.Interface(fn=make_prediction, inputs=inputs, outputs=outputs).launch()