Spaces:
Sleeping
Sleeping
kkhushisaid
commited on
Commit
•
ae60247
1
Parent(s):
63c4b45
Update app.py
Browse files
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.
|
73 |
-
gr.
|
74 |
-
gr.
|
75 |
-
gr.
|
76 |
-
gr.
|
77 |
-
gr.
|
78 |
-
gr.
|
79 |
-
gr.
|
80 |
-
gr.
|
81 |
-
gr.
|
82 |
-
gr.
|
83 |
-
gr.
|
84 |
-
gr.
|
85 |
-
gr.
|
86 |
]
|
87 |
|
88 |
-
outputs = gr.
|
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()
|