Update pages/3_EDA_and_Feature_Engineering.py
Browse files
pages/3_EDA_and_Feature_Engineering.py
CHANGED
|
@@ -87,9 +87,17 @@ if 'df' in st.session_state:
|
|
| 87 |
st.write("Polynomial Features Created:")
|
| 88 |
st.dataframe(poly_df.head())
|
| 89 |
|
|
|
|
| 90 |
# Correlation Heatmap
|
| 91 |
st.write("### Correlation Matrix")
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
fig, ax = plt.subplots(figsize=(12, 8))
|
| 94 |
sns.heatmap(corr, annot=True, cmap='coolwarm', ax=ax)
|
| 95 |
ax.set_title("Correlation Matrix")
|
|
|
|
| 87 |
st.write("Polynomial Features Created:")
|
| 88 |
st.dataframe(poly_df.head())
|
| 89 |
|
| 90 |
+
# Correlation Heatmap
|
| 91 |
# Correlation Heatmap
|
| 92 |
st.write("### Correlation Matrix")
|
| 93 |
+
|
| 94 |
+
# Select only numerical columns
|
| 95 |
+
numerical_df = df.select_dtypes(include=['int64', 'float64'])
|
| 96 |
+
|
| 97 |
+
# Compute the correlation matrix
|
| 98 |
+
corr = numerical_df.corr()
|
| 99 |
+
|
| 100 |
+
# Plot the heatmap
|
| 101 |
fig, ax = plt.subplots(figsize=(12, 8))
|
| 102 |
sns.heatmap(corr, annot=True, cmap='coolwarm', ax=ax)
|
| 103 |
ax.set_title("Correlation Matrix")
|