Spaces:
Sleeping
Sleeping
Update pages/EDA.py
Browse files- pages/EDA.py +3 -6
pages/EDA.py
CHANGED
|
@@ -468,31 +468,28 @@ st.markdown("""
|
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
-
st.markdown("<h2 style='color: #2E86C1; font-size:
|
| 472 |
fig, ax = plt.subplots(figsize=(5, 3)) # Reduced size
|
| 473 |
sns.scatterplot(data=df, x="Rainfall", y="Crop", hue="Crop", palette="rainbow", legend=False, ax=ax,s=10)
|
| 474 |
ax.set_xlabel("Rainfall (mm)", fontsize=6) # Decreased label size
|
| 475 |
ax.set_ylabel("Crop", fontsize=6) # Decreased label size
|
| 476 |
-
ax.set_title("Rainfall vs Crop Type", fontsize=9) # Adjusted title size
|
| 477 |
ax.tick_params(axis='x', labelsize=4) # Decreased x-axis tick size
|
| 478 |
ax.tick_params(axis='y', labelsize=5) # Decreased y-axis tick size
|
| 479 |
st.pyplot(fig)
|
| 480 |
|
| 481 |
-
st.markdown("<h2 style='color: #2E86C1; font-size:
|
| 482 |
fig, ax = plt.subplots(figsize=(5, 3)) # Reduced size
|
| 483 |
sns.scatterplot(data=df, x="Temperature", y="Humidity", alpha=0.6, color="blue", ax=ax,s=10)
|
| 484 |
ax.set_xlabel("Temperature (°C)", fontsize=6) # Decreased label size
|
| 485 |
ax.set_ylabel("Humidity (%)", fontsize=6) # Decreased label size
|
| 486 |
-
ax.set_title("Temperature vs Humidity", fontsize=9) # Adjusted title size
|
| 487 |
ax.tick_params(axis='x', labelsize=5) # Decreased x-axis tick size
|
| 488 |
ax.tick_params(axis='y', labelsize=5) # Decreased y-axis tick size
|
| 489 |
st.pyplot(fig)
|
| 490 |
|
| 491 |
-
st.markdown("<h2 style='color: #2E86C1; font-size:
|
| 492 |
corr_matrix = df[['Nitrogen', 'Phosphorus', 'Potassium', 'Temperature', 'Humidity', 'pH_Value', 'Rainfall']].corr()
|
| 493 |
fig, ax = plt.subplots(figsize=(5, 3)) # Reduced size
|
| 494 |
sns.heatmap(corr_matrix, annot=True, cmap="coolwarm", ax=ax, annot_kws={"size": 5}) # Reduced value size inside heatmap
|
| 495 |
-
ax.set_title("Correlation Heatmap", fontsize=9) # Adjusted title size
|
| 496 |
ax.tick_params(axis='x', labelsize=5) # Decreased x-axis tick size
|
| 497 |
ax.tick_params(axis='y', labelsize=5) # Decreased y-axis tick size
|
| 498 |
st.pyplot(fig)
|
|
|
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
+
st.markdown("<h2 style='color: #2E86C1; font-size: 24px;'> Rainfall vs. Crop</h2>", unsafe_allow_html=True)
|
| 472 |
fig, ax = plt.subplots(figsize=(5, 3)) # Reduced size
|
| 473 |
sns.scatterplot(data=df, x="Rainfall", y="Crop", hue="Crop", palette="rainbow", legend=False, ax=ax,s=10)
|
| 474 |
ax.set_xlabel("Rainfall (mm)", fontsize=6) # Decreased label size
|
| 475 |
ax.set_ylabel("Crop", fontsize=6) # Decreased label size
|
|
|
|
| 476 |
ax.tick_params(axis='x', labelsize=4) # Decreased x-axis tick size
|
| 477 |
ax.tick_params(axis='y', labelsize=5) # Decreased y-axis tick size
|
| 478 |
st.pyplot(fig)
|
| 479 |
|
| 480 |
+
st.markdown("<h2 style='color: #2E86C1; font-size: 24px;'> Temperature vs. Humidity</h2>", unsafe_allow_html=True)
|
| 481 |
fig, ax = plt.subplots(figsize=(5, 3)) # Reduced size
|
| 482 |
sns.scatterplot(data=df, x="Temperature", y="Humidity", alpha=0.6, color="blue", ax=ax,s=10)
|
| 483 |
ax.set_xlabel("Temperature (°C)", fontsize=6) # Decreased label size
|
| 484 |
ax.set_ylabel("Humidity (%)", fontsize=6) # Decreased label size
|
|
|
|
| 485 |
ax.tick_params(axis='x', labelsize=5) # Decreased x-axis tick size
|
| 486 |
ax.tick_params(axis='y', labelsize=5) # Decreased y-axis tick size
|
| 487 |
st.pyplot(fig)
|
| 488 |
|
| 489 |
+
st.markdown("<h2 style='color: #2E86C1; font-size: 24px;'> Correlation Heatmap of Soil & Climate Factors</h2>", unsafe_allow_html=True)
|
| 490 |
corr_matrix = df[['Nitrogen', 'Phosphorus', 'Potassium', 'Temperature', 'Humidity', 'pH_Value', 'Rainfall']].corr()
|
| 491 |
fig, ax = plt.subplots(figsize=(5, 3)) # Reduced size
|
| 492 |
sns.heatmap(corr_matrix, annot=True, cmap="coolwarm", ax=ax, annot_kws={"size": 5}) # Reduced value size inside heatmap
|
|
|
|
| 493 |
ax.tick_params(axis='x', labelsize=5) # Decreased x-axis tick size
|
| 494 |
ax.tick_params(axis='y', labelsize=5) # Decreased y-axis tick size
|
| 495 |
st.pyplot(fig)
|