Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ loaded_model = pickle.load(open("classroom_xgb.pkl", 'rb'))
|
|
13 |
explainer = shap.Explainer(loaded_model) # PLEASE DO NOT CHANGE THIS.
|
14 |
|
15 |
# Create the main function for server
|
16 |
-
def main_func(Target, Admission_grade, Curricular_units_2nd_sem_grade, Previous_qualifications, Curricular_units_1st_sem_grade, Curricular_units_2nd_sem_approved, Age_at_enrollment):
|
17 |
new_row = pd.DataFrame.from_dict({'Target':Target, 'Admission grade':Admission_grade,'Curricular units 2nd sem (grade)':Curricular_units_2nd_sem_grade,
|
18 |
'Previous qualifications':Previous_qualifications,'Curricular units 1st sem (grade)':Curricular_units_1st_sem_grade, 'Course':Course,'Curricular units 2nd sem (approved)':Curricular_units_2nd_sem_approved,
|
19 |
'Age at enrollment':Age_at_enrollmentenrollment}).transpose()
|
@@ -62,11 +62,11 @@ with gr.Blocks(title=title) as demo:
|
|
62 |
|
63 |
submit_btn.click(
|
64 |
main_func,
|
65 |
-
[
|
66 |
[label,local_plot], api_name="Dropout_Predictor"
|
67 |
)
|
68 |
|
69 |
gr.Markdown("### Click on any of the examples below to see how it works:")
|
70 |
-
gr.Examples([[24,0,4,4,5,5,4,4,5,5,1,2,3], [24,0,4,4,5,3,3,2,1,1,1,2,3]], [
|
71 |
|
72 |
demo.launch()
|
|
|
13 |
explainer = shap.Explainer(loaded_model) # PLEASE DO NOT CHANGE THIS.
|
14 |
|
15 |
# Create the main function for server
|
16 |
+
def main_func(Target, Admission_grade, Curricular_units_2nd_sem_grade, Previous_qualifications, Curricular_units_1st_sem_grade, Course, Curricular_units_2nd_sem_approved, Age_at_enrollment):
|
17 |
new_row = pd.DataFrame.from_dict({'Target':Target, 'Admission grade':Admission_grade,'Curricular units 2nd sem (grade)':Curricular_units_2nd_sem_grade,
|
18 |
'Previous qualifications':Previous_qualifications,'Curricular units 1st sem (grade)':Curricular_units_1st_sem_grade, 'Course':Course,'Curricular units 2nd sem (approved)':Curricular_units_2nd_sem_approved,
|
19 |
'Age at enrollment':Age_at_enrollmentenrollment}).transpose()
|
|
|
62 |
|
63 |
submit_btn.click(
|
64 |
main_func,
|
65 |
+
[Admission_grade, Curricular_units_2nd_sem_grade, Previous_qualifications, Curricular_units_1st_sem_grade, Course, Curricular_units_2nd_sem_approved, Age_at_enrollment],
|
66 |
[label,local_plot], api_name="Dropout_Predictor"
|
67 |
)
|
68 |
|
69 |
gr.Markdown("### Click on any of the examples below to see how it works:")
|
70 |
+
gr.Examples([[24,0,4,4,5,5,4,4,5,5,1,2,3], [24,0,4,4,5,3,3,2,1,1,1,2,3]], [Admission_grade, Curricular_units_2nd_sem_grade, Previous_qualifications, Curricular_units_1st_sem_grade, Course, Curricular_units_2nd_sem_approved, Age_at_enrollment], [label,local_plot], main_func, cache_examples=True)
|
71 |
|
72 |
demo.launch()
|