Update app.py
Browse files
app.py
CHANGED
@@ -13,13 +13,15 @@ def predict_corrected_calcium(total_calcium, total_protein, albumin):
|
|
13 |
predicted_value = model.predict([[total_calcium, atr]])[0]
|
14 |
|
15 |
# Return the result string
|
16 |
-
return f"
|
17 |
|
18 |
# Define the Gradio interface
|
19 |
interface = gr.Interface(fn=predict_corrected_calcium,
|
20 |
inputs=[gr.inputs.Number(label="Total Calcium in mg/dL"),
|
21 |
gr.inputs.Number(label="Total Protein in g/dL"),
|
22 |
gr.inputs.Number(label="Albumin in g/dL")],
|
23 |
-
outputs=gr.outputs.Textbox()
|
|
|
|
|
24 |
|
25 |
interface.launch()
|
|
|
13 |
predicted_value = model.predict([[total_calcium, atr]])[0]
|
14 |
|
15 |
# Return the result string
|
16 |
+
return f"{predicted_value:.2f}. The model is a RDF Regression Model with a MSE of 0.06 and R-squared of 0.931."
|
17 |
|
18 |
# Define the Gradio interface
|
19 |
interface = gr.Interface(fn=predict_corrected_calcium,
|
20 |
inputs=[gr.inputs.Number(label="Total Calcium in mg/dL"),
|
21 |
gr.inputs.Number(label="Total Protein in g/dL"),
|
22 |
gr.inputs.Number(label="Albumin in g/dL")],
|
23 |
+
outputs=gr.outputs.Textbox(label="Corrected Calcium in mg/dL")
|
24 |
+
title="RandomForestRegressor assisted Calcium Correction (RaCC)")
|
25 |
+
)
|
26 |
|
27 |
interface.launch()
|