Spaces:
Runtime error
Runtime error
Commit
·
045b70a
1
Parent(s):
a7afcc6
app
Browse files
app.py
CHANGED
@@ -25,14 +25,22 @@ def update(array_value):
|
|
25 |
validation_target_data = validation_data[['Attrition']]
|
26 |
reg = LinearRegression().fit(validation_input_data, validation_target_data)
|
27 |
# In future pass data through array_value parameter
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
with gr.Blocks() as demo:
|
32 |
gr.Markdown("*** Employee Experience Prediction ***")
|
33 |
gr.Markdown("[EmployeeExperience, HealthBenefitsSatisfaction, SalarySatisfaction, Designation, HealthConscious, EmployeeFeedbackSentiments, Education, Gender, HoursOfTrainingAttendedLastYear, InternalJobMovement, Attrition]")
|
34 |
with gr.Row():
|
35 |
-
inp =
|
36 |
out = gr.Textbox()
|
37 |
btn = gr.Button("Run")
|
38 |
btn.click(fn=update, inputs=inp, outputs=out)
|
|
|
25 |
validation_target_data = validation_data[['Attrition']]
|
26 |
reg = LinearRegression().fit(validation_input_data, validation_target_data)
|
27 |
# In future pass data through array_value parameter
|
28 |
+
if array_value == "2,2,1,3,1,2,0,1,40,1":
|
29 |
+
prediction_value = reg.predict(np.array([[2,2,1,3,1,2,0,1,40,1]]))
|
30 |
+
return f"Prediction : {prediction_value}!"
|
31 |
+
if array_value == "0,0,0,3,0,2,0,1,2,1":
|
32 |
+
prediction_value = reg.predict(np.array([[2,2,1,3,1,2,0,1,40,1]]))
|
33 |
+
return f"Prediction : {prediction_value}!"
|
34 |
+
|
35 |
+
inputs = [
|
36 |
+
gr.Dropdown(["2,2,1,3,1,2,0,1,40,1", "0,0,0,3,0,2,0,1,2,1"], label="Prediction Scenario:")
|
37 |
+
]
|
38 |
|
39 |
with gr.Blocks() as demo:
|
40 |
gr.Markdown("*** Employee Experience Prediction ***")
|
41 |
gr.Markdown("[EmployeeExperience, HealthBenefitsSatisfaction, SalarySatisfaction, Designation, HealthConscious, EmployeeFeedbackSentiments, Education, Gender, HoursOfTrainingAttendedLastYear, InternalJobMovement, Attrition]")
|
42 |
with gr.Row():
|
43 |
+
inp = inputs
|
44 |
out = gr.Textbox()
|
45 |
btn = gr.Button("Run")
|
46 |
btn.click(fn=update, inputs=inp, outputs=out)
|