Update app.py
Browse files
app.py
CHANGED
|
@@ -56,14 +56,6 @@ def main():
|
|
| 56 |
|
| 57 |
# Predict button
|
| 58 |
if st.button("Predict"):
|
| 59 |
-
# Convert numerical features to strings
|
| 60 |
-
age = str(age)
|
| 61 |
-
monthly_income = str(monthly_income)
|
| 62 |
-
num_companies_worked = str(num_companies_worked)
|
| 63 |
-
percent_salary_hike = str(percent_salary_hike)
|
| 64 |
-
training_times_last_year = str(training_times_last_year)
|
| 65 |
-
years_since_last_promotion = str(years_since_last_promotion)
|
| 66 |
-
years_with_curr_manager = str(years_with_curr_manager)
|
| 67 |
|
| 68 |
# Create a DataFrame to hold the user input data
|
| 69 |
input_data = pd.DataFrame({
|
|
@@ -92,15 +84,6 @@ def main():
|
|
| 92 |
# Make predictions
|
| 93 |
prediction = model.predict(input_data)
|
| 94 |
probability = model.predict_proba(input_data)[:, 1]
|
| 95 |
-
|
| 96 |
-
# Convert integer inputs to integers
|
| 97 |
-
age = int(age)
|
| 98 |
-
monthly_income = int(float(monthly_income))
|
| 99 |
-
num_companies_worked = float(num_companies_worked)
|
| 100 |
-
percent_salary_hike = int(percent_salary_hike)
|
| 101 |
-
training_times_last_year = int(training_times_last_year)
|
| 102 |
-
years_since_last_promotion = int(years_since_last_promotion)
|
| 103 |
-
years_with_curr_manager = int(years_with_curr_manager)
|
| 104 |
|
| 105 |
# Display characteristic-based recommendations
|
| 106 |
st.subheader("Suggestions for retaining the employee:")
|
|
|
|
| 56 |
|
| 57 |
# Predict button
|
| 58 |
if st.button("Predict"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
# Create a DataFrame to hold the user input data
|
| 61 |
input_data = pd.DataFrame({
|
|
|
|
| 84 |
# Make predictions
|
| 85 |
prediction = model.predict(input_data)
|
| 86 |
probability = model.predict_proba(input_data)[:, 1]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
# Display characteristic-based recommendations
|
| 89 |
st.subheader("Suggestions for retaining the employee:")
|