Jagadesswar commited on
Commit
8bf2953
·
verified ·
1 Parent(s): 1594194

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +22 -0
  2. requirements.txt +2 -0
app.py CHANGED
@@ -76,3 +76,25 @@ if st.button("🚀 Predict Yield"):
76
 
77
  prediction_bags_per_acre = (prediction * 2.47 * 1000) / bag_weight
78
  st.info(f"Equivalent: {prediction_bags_per_acre:.2f} bags per acre")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
  prediction_bags_per_acre = (prediction * 2.47 * 1000) / bag_weight
78
  st.info(f"Equivalent: {prediction_bags_per_acre:.2f} bags per acre")
79
+
80
+ # --- Visualizations ---
81
+ st.subheader("📊 Yield Insights from Your Inputs")
82
+
83
+ fig, axs = plt.subplots(1, 3, figsize=(18, 5))
84
+
85
+ # 1. Fertilizer vs Yield
86
+ sns.barplot(x=["Fertilizer Used"], y=[fertilizer], ax=axs[0], palette="Greens")
87
+ axs[0].set_ylabel("Kg")
88
+ axs[0].set_title("Fertilizer Usage")
89
+
90
+ # 2. Rainfall
91
+ sns.barplot(x=["Annual Rainfall"], y=[rainfall], ax=axs[1], palette="Blues")
92
+ axs[1].set_ylabel("mm")
93
+ axs[1].set_title("Annual Rainfall")
94
+
95
+ # 3. Yield
96
+ sns.barplot(x=["Predicted Yield"], y=[prediction], ax=axs[2], palette="Oranges")
97
+ axs[2].set_ylabel("t/ha")
98
+ axs[2].set_title("Estimated Yield")
99
+
100
+ st.pyplot(fig)
requirements.txt CHANGED
@@ -4,3 +4,5 @@ scikit-learn==1.6.1
4
  xgboost==2.1.4
5
  joblib==1.4.2
6
  streamlit==1.43.2
 
 
 
4
  xgboost==2.1.4
5
  joblib==1.4.2
6
  streamlit==1.43.2
7
+ matplotlib
8
+ seaborn