Spaces:
Sleeping
Sleeping
Upload 6 files
Browse files- .gitattributes +1 -0
- Crop_Yield_DF.csv +0 -0
- Crop_Yield_Prediction_doc.docx +3 -0
- Crop_Yield_Predictiton_Notebook.ipynb +0 -0
- app.py +56 -0
- crop_yield_model_rf.joblib +3 -0
- requirements.txt +9 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
Crop_Yield_Prediction_doc.docx filter=lfs diff=lfs merge=lfs -text
|
Crop_Yield_DF.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
Crop_Yield_Prediction_doc.docx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fef4a7457a9406952a6060f43d6d6a2e8aa0551f220fa284309817add6144929
|
3 |
+
size 1782316
|
Crop_Yield_Predictiton_Notebook.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import joblib
|
3 |
+
|
4 |
+
html_temp = """
|
5 |
+
<div style="background-color:lightgreen;padding:10px">
|
6 |
+
<h2 style="color:white;text-align:center;">Crop Yeid Prediction </h2>
|
7 |
+
</div>
|
8 |
+
"""
|
9 |
+
st.markdown(html_temp, unsafe_allow_html=True)
|
10 |
+
|
11 |
+
image_url="https://miro.medium.com/v2/resize:fit:1358/0*k-lYNf3gZ1M2u6AN"
|
12 |
+
|
13 |
+
st.image(image_url, use_container_width=True)
|
14 |
+
|
15 |
+
# Area
|
16 |
+
options_Area = ['Albania', 'Algeria', 'Angola', 'Argentina', 'Armenia','Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain',
|
17 |
+
'Bangladesh', 'Belarus', 'Belgium', 'Botswana', 'Brazil','Bulgaria', 'Burkina Faso', 'Burundi', 'Cameroon', 'Canada',
|
18 |
+
'Central African Republic', 'Chile', 'Colombia', 'Croatia',
|
19 |
+
'Denmark', 'Dominican Republic', 'Ecuador', 'Egypt', 'El Salvador','Eritrea', 'Estonia', 'Finland', 'France', 'Germany', 'Ghana',
|
20 |
+
'Greece', 'Guatemala', 'Guinea', 'Guyana', 'Haiti', 'Honduras',
|
21 |
+
'Hungary', 'India', 'Indonesia', 'Iraq', 'Ireland', 'Italy',
|
22 |
+
'Jamaica', 'Japan', 'Kazakhstan', 'Kenya', 'Latvia', 'Lebanon',
|
23 |
+
'Lesotho', 'Libya', 'Lithuania', 'Madagascar', 'Malawi',
|
24 |
+
'Malaysia', 'Mali', 'Mauritania', 'Mauritius', 'Mexico',
|
25 |
+
'Montenegro', 'Morocco', 'Mozambique', 'Namibia', 'Nepal',
|
26 |
+
'Netherlands', 'New Zealand', 'Nicaragua', 'Niger', 'Norway',
|
27 |
+
'Pakistan', 'Papua New Guinea', 'Peru', 'Poland', 'Portugal',
|
28 |
+
'Qatar', 'Romania', 'Rwanda', 'Saudi Arabia', 'Senegal',
|
29 |
+
'Slovenia', 'South Africa', 'Spain', 'Sri Lanka', 'Sudan',
|
30 |
+
'Suriname', 'Sweden', 'Switzerland', 'Tajikistan', 'Thailand',
|
31 |
+
'Tunisia', 'Turkey', 'Uganda', 'Ukraine', 'United Kingdom',
|
32 |
+
'Uruguay', 'Zambia', 'Zimbabwe']
|
33 |
+
Area= st.selectbox('Choose an Area:', options_Area)
|
34 |
+
Area_value=options_Area.index(Area)
|
35 |
+
|
36 |
+
# Item
|
37 |
+
options_Item =['Maize','Potatoes', 'Rice, paddy', 'Sorghum', 'Soybeans',
|
38 |
+
'Wheat','Cassava', 'Sweet potatoes', 'Plantains and others', 'Yams']
|
39 |
+
Item= st.selectbox('Choose a Item:', options_Item)
|
40 |
+
Item_value=options_Item.index(Item)
|
41 |
+
|
42 |
+
# average_rain_fall_mm_per_year
|
43 |
+
avg_rainfall=st.slider('Slide The value to get Avg Rainfall',min_value=51,max_value=3240,value=51)
|
44 |
+
|
45 |
+
# Pesticides_tonnes
|
46 |
+
pes_tonnes=st.slider('Slide The value to get Pesticides in Tonnes',min_value=1,max_value=367778,value=1)
|
47 |
+
|
48 |
+
# Avg Temp
|
49 |
+
avg_temp=st.slider('Slide The value to get Avg Temperature',min_value=1,max_value=30,value=1)
|
50 |
+
|
51 |
+
model=joblib.load("crop_yield_model_rf.joblib")
|
52 |
+
|
53 |
+
if st.button("Enter"):
|
54 |
+
output=model.predict([[Area_value,Item_value,avg_rainfall,pes_tonnes,avg_temp]])
|
55 |
+
|
56 |
+
st.write("The Predicted Value of Yield:",output)
|
crop_yield_model_rf.joblib
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b706ac59309765a28d368882be9dc32aada684680b613bff00243cb25e3e6e31
|
3 |
+
size 118439330
|
requirements.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
joblib==1.3.2
|
2 |
+
matplotlib==3.8.3
|
3 |
+
matplotlib-inline==0.1.6
|
4 |
+
numpy==1.26.4
|
5 |
+
pandas==2.2.0
|
6 |
+
scikit-learn==1.4.1.post1
|
7 |
+
seaborn==0.13.2
|
8 |
+
streamlit==1.32.2
|
9 |
+
streamlit-chat==0.1.1
|