This project takes into account the growing trend of precision agriculture; loosely defined as the farming strategy where observation and measurement are used to make informed decision that can improve agricultural production and sustainability.
Therefore, this will be a proof of concept project that shows how a predictive model can be created to help farmers identify the "right" crop to focus on based on some parameters such as the content of nitrogen, phosphorous, and potassium in the soil; temperature, humidity, pH, and rainfall.
💾 The dataset used was obtained here.
📒 The notebook used to train different predictive models can be accessed here.
💻 The deployed application can be accessed here
👀 Here is a quick look at how it works:
🔊 Disclaimer: This is a proof-of-concept project and should not be taken as an expert opinion regarding the crop recommended to grow. Moreover, this is an augmented dataset that was obtained in India based on the data available and could not be reflective of other regions' crop growth conditions.
.github
: contains GitHub action workflow file for continuous integration.app
: the Flask application files (included just for trial purposes).models
: the pre-trained models used.src
: the project's predefined packagestreamlit
: the streamlit application file(s).
Create a virtual environment with the libraries need by the application.
For this project Python 3.10 was used if you don't have it installed you can follow the instructions provided by pyenv to get it.
With that done, run the commands below to create the virtual environment with pipenv
and use the Pipfile
file provided to install the required libraries.
pipenv --python=3.10
pipenv shell
pipenv install
Pre-commit is also used in this project, therefore ensure you install it and run it.
pip install pre-commit
pre-commit install
Check the content of the pre-commit file to confirm the Python location and where the pre-commit needs to execute every time we make a commit
less .git/hooks/pre-commit