Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import pickle
|
|
| 3 |
import pandas as pd
|
| 4 |
|
| 5 |
# Load model
|
| 6 |
-
with open("
|
| 7 |
model = pickle.load(f)
|
| 8 |
|
| 9 |
# Define categorical mappings (must match training!)
|
|
@@ -52,15 +52,16 @@ def predict_jamb(study_hours, attendance, teacher_quality, distance,
|
|
| 52 |
|
| 53 |
if prediction == 0:
|
| 54 |
return "π Below Average"
|
| 55 |
-
elif prediction == 1:
|
| 56 |
-
|
| 57 |
else:
|
| 58 |
return "β
Pass"
|
| 59 |
|
| 60 |
# Gradio UI
|
| 61 |
with gr.Blocks() as demo:
|
| 62 |
gr.Markdown("# π JAMB Score Prediction App")
|
| 63 |
-
gr.Markdown("Predict student's JAMB performance (Below Average,
|
|
|
|
| 64 |
|
| 65 |
with gr.Row():
|
| 66 |
study_hours = gr.Slider(0, 40, value=10, label="Study Hours per Week")
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
|
| 5 |
# Load model
|
| 6 |
+
with open("model1.pkl", "rb") as f:
|
| 7 |
model = pickle.load(f)
|
| 8 |
|
| 9 |
# Define categorical mappings (must match training!)
|
|
|
|
| 52 |
|
| 53 |
if prediction == 0:
|
| 54 |
return "π Below Average"
|
| 55 |
+
#elif prediction == 1:
|
| 56 |
+
# return "βοΈ Average"
|
| 57 |
else:
|
| 58 |
return "β
Pass"
|
| 59 |
|
| 60 |
# Gradio UI
|
| 61 |
with gr.Blocks() as demo:
|
| 62 |
gr.Markdown("# π JAMB Score Prediction App")
|
| 63 |
+
gr.Markdown("Predict student's JAMB performance (Below Average, Pass).")
|
| 64 |
+
gr.Markdown("Fill in the details below to predict!")
|
| 65 |
|
| 66 |
with gr.Row():
|
| 67 |
study_hours = gr.Slider(0, 40, value=10, label="Study Hours per Week")
|