Skip to content

Commit

Permalink
fix the untrsuted issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kingabzpro committed Dec 2, 2024
1 parent 2c7feff commit e52027a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion App/drug_app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
import gradio as gr
import skops.io as sio
import warnings
from sklearn.exceptions import InconsistentVersionWarning

pipe = sio.load("./Model/drug_pipeline.skops", trusted=False)
# Suppress the version warnings
warnings.filterwarnings("ignore", category=InconsistentVersionWarning)

# Explicitly specify trusted types
trusted_types = [
"sklearn.pipeline.Pipeline",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.preprocessing.StandardScaler",
"sklearn.compose.ColumnTransformer",
"sklearn.preprocessing.OrdinalEncoder",
"sklearn.impute.SimpleImputer",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.ensemble.RandomForestClassifier",
"numpy.dtype",
]
pipe = sio.load("./Model/drug_pipeline.skops", trusted=trusted_types)


def predict_drug(age, sex, blood_pressure, cholesterol, na_to_k_ratio):
Expand Down

1 comment on commit e52027a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Model Metrics

Accuracy = 0.87, F1 Score = 0.84

Confusion Matrix Plot

Confusion Matrix

Please sign in to comment.