Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,13 +55,9 @@ best_model = tuner.get_best_models(1)[0]
|
|
| 55 |
|
| 56 |
# Define prediction function for Gradio
|
| 57 |
def predict_performance(hours, prev_score, sleep, papers, activity):
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
'Sleep Hours': sleep,
|
| 62 |
-
'Sample Question Papers Practiced': papers,
|
| 63 |
-
'Extracurricular Activities': activity
|
| 64 |
-
}])
|
| 65 |
X_user = preprocess.transform(user_input)
|
| 66 |
pred = best_model.predict(X_user).item()
|
| 67 |
return f"📊 Predicted Performance Index: {pred:.2f}"
|
|
|
|
| 55 |
|
| 56 |
# Define prediction function for Gradio
|
| 57 |
def predict_performance(hours, prev_score, sleep, papers, activity):
|
| 58 |
+
cols = ['Hours Studied', 'Previous Scores', 'Sleep Hours', 'Sample Question Papers Practiced', 'Extracurricular Activities']
|
| 59 |
+
values = [hours, prev_score, sleep, papers, activity]
|
| 60 |
+
user_input = pd.DataFrame([dict(zip(cols, values))])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
X_user = preprocess.transform(user_input)
|
| 62 |
pred = best_model.predict(X_user).item()
|
| 63 |
return f"📊 Predicted Performance Index: {pred:.2f}"
|