The app predicts the amount of Agricultural Nitrous Oxide flux released into the atmosphere from intensively managed cropping systems.
Table of Contents
Nitrous Oxide is one of the potent greenhouse gas that is accumulating in the atmosphere at extraordinary rates. This can be largely attributed to intensification of agricultural cropping systems where the cultivated soil contribute almost 60% of the agricultural flux.
Though there were previous attempts at identifying and quantifying the agricultural Nitrous Oxide flux, these attempts could only predict the results with an R2-score ranging from 25-40%. The model used in this app is aimed at outperforming the previous models and has been able to succesfully produce the results with almost 78% R2-score.
Agricultural-N2O-Predictor-App
|
|—— .streamlit
| |—— config.toml
|
|—— data
| |—— Saha_et_al_2020_ERL_Data.xlsx
| |—— processed_data.csv
|
|—— images
| |—— app_recording.gif
| |—— app_working.png
| |—— sidebar_image.png
| |—— title_image.jpg
|
|—— model
| |—— explained_shapvalues.pickle
| |—— explainer.pickle
| |—— features.pickle
| |—— final_model.pickle
| |—— scaled_df.pickle
| |—— scaler.pickle
|
|—— notebooks
| |—— Agri_N2O_Notebook.ipynb
|
|—— plots
| |—— airt_dep_plot.png
| |—— dafsd_dep_plot.png
| |—— force_plot.png
| |—— nh4_dep_plot.png
| |—— no3_dep_plot.png
| |—— pp7_dep_plot.png
| |—— som_dep_plot.png
| |—— summaryplot.png
| |—— wfps_dep_plot.png
|
|—— src
| |—— explain_model.py
| |—— model.py
| |—— multipage.py
| |—— scaler.py
|
|—— .gitignore
|—— Procfile
|—— README.md
|—— app.py
|—— model_form.py
|—— requirements.txt
|—— runtime.txt
|—— setup.sh
Hence, I have used an explainable AI tool known as "SHAP" for understanding the model and interpreting the output.
Check the app for more detailed explanation of the model and the predicted output.
- The data that quantified Nitrous Oxide flux was heavily right skewed and also contained few negative values.
- The data for Water frontage pore space, Ammonia and Nitrate had some values missing.
- Vegetation data was highly imbalanced with almost 84% of the data were recorded for Corn. Data for Wheat and Soy constituted only about 8.5 and 7.5% each.
- Numpy
- Pandas
- Matplotlib
- Scikit-learn
- Shap
-
Inside a new directory clone the files from the repo using
https:/Retinpkumar/Agricultural-N2O-Predictor-App.git
-
Create a new virtual environment and activate it.
-
Open the terminal and install the libraries and dependancies using
pip install -r requirements.txt
-
Start and run the app by entering the code given below in the terminal
streamlit run app.py
For further discussions and queries, contact me at: [email protected]