Spaces:
Runtime error
Runtime error
jaleesahmed
commited on
Commit
·
1693da5
1
Parent(s):
3c33efd
app
Browse files- app.py +1 -5
- requirements.txt +2 -0
app.py
CHANGED
@@ -20,15 +20,11 @@ def update(name):
|
|
20 |
data_selected = data_encoded[['EmployeeExperience', 'HealthBenefitsSatisfaction', 'SalarySatisfaction', 'Designation', 'HealthConscious',
|
21 |
'EmployeeFeedbackSentiments', 'Education', 'Gender', 'HoursOfTrainingAttendedLastYear', 'InternalJobMovement', 'Attrition']]
|
22 |
|
23 |
-
|
24 |
-
target_data = data_selected[['Attrition']]
|
25 |
-
input_data = input_data[0:100]
|
26 |
-
validation_data = input_data[100:198]
|
27 |
validation_input_data = validation_data.drop(['Attrition'], axis=1)
|
28 |
validation_target_data = validation_data[['Attrition']]
|
29 |
reg = LinearRegression().fit(validation_input_data, validation_target_data)
|
30 |
prediction_value = reg.predict(np.array([[2,2,1,3,1,2,0,1,40,1]]))
|
31 |
-
print(prediction_value)
|
32 |
return f"Prediction : , {prediction_value}!"
|
33 |
|
34 |
with gr.Blocks() as demo:
|
|
|
20 |
data_selected = data_encoded[['EmployeeExperience', 'HealthBenefitsSatisfaction', 'SalarySatisfaction', 'Designation', 'HealthConscious',
|
21 |
'EmployeeFeedbackSentiments', 'Education', 'Gender', 'HoursOfTrainingAttendedLastYear', 'InternalJobMovement', 'Attrition']]
|
22 |
|
23 |
+
validation_data = data_selected[100:198]
|
|
|
|
|
|
|
24 |
validation_input_data = validation_data.drop(['Attrition'], axis=1)
|
25 |
validation_target_data = validation_data[['Attrition']]
|
26 |
reg = LinearRegression().fit(validation_input_data, validation_target_data)
|
27 |
prediction_value = reg.predict(np.array([[2,2,1,3,1,2,0,1,40,1]]))
|
|
|
28 |
return f"Prediction : , {prediction_value}!"
|
29 |
|
30 |
with gr.Blocks() as demo:
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
cufflinks
|
2 |
+
sklearn
|