Spaces:
Runtime error
Runtime error
Commit
·
786dd64
1
Parent(s):
390ba15
app
Browse files
app.py
CHANGED
|
@@ -22,8 +22,13 @@ def outbreak(plot_type):
|
|
| 22 |
if plot_type == "Find Data Correlation":
|
| 23 |
fig = plt.figure()
|
| 24 |
data_correlation = data_encoded.corr()
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
return fig
|
| 28 |
if plot_type == "Age Attrition":
|
| 29 |
fig = plt.figure()
|
|
@@ -43,7 +48,7 @@ def outbreak(plot_type):
|
|
| 43 |
return fig
|
| 44 |
|
| 45 |
inputs = [
|
| 46 |
-
gr.Dropdown(["Find Data Correlation", "Age Attrition", "Distance Attrition"], label="Data Correlation and Visualization")
|
| 47 |
]
|
| 48 |
|
| 49 |
outputs = gr.Plot()
|
|
|
|
| 22 |
if plot_type == "Find Data Correlation":
|
| 23 |
fig = plt.figure()
|
| 24 |
data_correlation = data_encoded.corr()
|
| 25 |
+
sns.heatmap(data_correlation, xticklabels = data_correlation.columns, yticklabels = data_correlation.columns)
|
| 26 |
+
return fig
|
| 27 |
+
if plot_type == "Filter Correlation Data":
|
| 28 |
+
fig = plt.figure()
|
| 29 |
+
filtered_df = df[['EmployeeExperience', 'EmployeeFeedbackSentiments', 'Age', 'SalarySatisfaction', 'BusinessTravel', 'HealthBenefitsSatisfaction']]
|
| 30 |
+
correlation_filter_data = filtered_df.corr()
|
| 31 |
+
sns.heatmap(correlation_filter_data, xticklabels = filtered_df.columns, yticklabels = filtered_df.columns)
|
| 32 |
return fig
|
| 33 |
if plot_type == "Age Attrition":
|
| 34 |
fig = plt.figure()
|
|
|
|
| 48 |
return fig
|
| 49 |
|
| 50 |
inputs = [
|
| 51 |
+
gr.Dropdown(["Find Data Correlation", "Filter Correlation Data", "Age Attrition", "Distance Attrition"], label="Data Correlation and Visualization")
|
| 52 |
]
|
| 53 |
|
| 54 |
outputs = gr.Plot()
|