Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,10 @@ from joblib import load
|
|
| 4 |
from tensorflow.keras.models import load_model
|
| 5 |
import tensorflow as tf
|
| 6 |
import pickle
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Load the LabelEncoder and ColumnTransformer before prediction
|
| 9 |
with open('label_encoder.pkl', 'rb') as f:
|
|
@@ -108,10 +112,8 @@ def predict_dosage(gender, race, age, height, weight, diabetes, simvastatin, ami
|
|
| 108 |
# Launch Gradio app
|
| 109 |
gr.Interface(
|
| 110 |
fn=predict_dosage,
|
| 111 |
-
inputs=[
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
input_INR_reported, input_Cyp2C9_genotypes, input_VKORC1_genotypes, input_model
|
| 115 |
-
],
|
| 116 |
outputs=[output_warfarin_dosage]
|
| 117 |
).launch(debug=True)
|
|
|
|
| 4 |
from tensorflow.keras.models import load_model
|
| 5 |
import tensorflow as tf
|
| 6 |
import pickle
|
| 7 |
+
import pandas as pd # Ensure pandas is imported for DataFrame operations
|
| 8 |
+
|
| 9 |
+
# Load dataset
|
| 10 |
+
df = pd.read_csv('your_dataset.csv') # Replace with the correct path to your dataset
|
| 11 |
|
| 12 |
# Load the LabelEncoder and ColumnTransformer before prediction
|
| 13 |
with open('label_encoder.pkl', 'rb') as f:
|
|
|
|
| 112 |
# Launch Gradio app
|
| 113 |
gr.Interface(
|
| 114 |
fn=predict_dosage,
|
| 115 |
+
inputs=[input_Gender, input_Race, input_Age, input_Height, input_Weight,
|
| 116 |
+
input_Diabetes, input_Simvastatin, input_Amiodarone,
|
| 117 |
+
input_INR_reported, input_Cyp2C9_genotypes, input_VKORC1_genotypes, input_model],
|
|
|
|
|
|
|
| 118 |
outputs=[output_warfarin_dosage]
|
| 119 |
).launch(debug=True)
|