Update app.py
Browse files
app.py
CHANGED
@@ -177,5 +177,30 @@ def main():
|
|
177 |
# General recommendation for all negative predictions
|
178 |
st.markdown("- **Exit Interviews**: Conduct exit interviews to gather feedback and identify areas for improvement in retention strategies.")
|
179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
if __name__ == "__main__":
|
181 |
main()
|
|
|
177 |
# General recommendation for all negative predictions
|
178 |
st.markdown("- **Exit Interviews**: Conduct exit interviews to gather feedback and identify areas for improvement in retention strategies.")
|
179 |
|
180 |
+
# Add the attrition prediction to the input DataFrame
|
181 |
+
input_data['Attrition'] = prediction
|
182 |
+
|
183 |
+
# Convert the input data to a pandas DataFrame
|
184 |
+
input_df = pd.DataFrame([input_data])
|
185 |
+
|
186 |
+
# Display the input DataFrame with attrition prediction
|
187 |
+
st.markdown(
|
188 |
+
f"""
|
189 |
+
<div style="text-align: center; font-size: 18px; font-weight: bold;">
|
190 |
+
<p>Input Data with Attrition Prediction</p>
|
191 |
+
</div>
|
192 |
+
""",
|
193 |
+
unsafe_allow_html=True
|
194 |
+
)
|
195 |
+
st.table(input_df)
|
196 |
+
|
197 |
+
except Exception as e:
|
198 |
+
st.error(f"An error occurred: {e}")
|
199 |
+
|
200 |
+
# Display Data Fields and Descriptions
|
201 |
+
st.sidebar.title("🔍 Data Fields")
|
202 |
+
for field, description in data_fields.items():
|
203 |
+
st.sidebar.markdown(f"{field}: {description}")
|
204 |
+
|
205 |
if __name__ == "__main__":
|
206 |
main()
|