|
import gradio as gr |
|
from joblib import load |
|
import numpy as np |
|
|
|
|
|
model = load("ML_Model_CallCorr.joblib") |
|
|
|
def predict_corrected_calcium(total_calcium, total_protein, albumin): |
|
|
|
atr = albumin / total_protein |
|
|
|
|
|
predicted_value = model.predict([[total_calcium, atr]])[0] |
|
|
|
|
|
return f"{predicted_value:.2f}.\n\nThe model has a MSE of 0.06, MAD of 0.08 and R-squared of 0.931." |
|
|
|
|
|
interface = gr.Interface(fn=predict_corrected_calcium, |
|
inputs=[gr.inputs.Number(label="Total Calcium"), |
|
gr.inputs.Number(label="Total Protein"), |
|
gr.inputs.Number(label="Albumin")], |
|
outputs=gr.outputs.Textbox(label="Status of Actual Hypocalcemia "), |
|
title="Artificial Neural Network Assisted True Hypocalcemia Prediction") |
|
|
|
interface.launch() |