Skip to content

A recommendation tool that helps farmers identify the most suitable crop to grow based on the soil nutrient level and environmental conditions

Notifications You must be signed in to change notification settings

midega-g/crop-recommendation

Repository files navigation

Crop Recommendation

About the Project

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.

Supporting Files

💾 The dataset used was obtained here.

📒 The notebook used to train different predictive models can be accessed here.

Application

💻 The deployed application can be accessed here

👀 Here is a quick look at how it works:

crop recommender demo

🔊 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.

Project's Structure

  • .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 package
  • streamlit: the streamlit application file(s).

Environment Setup

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

Creating a Pre-Commit

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

About

A recommendation tool that helps farmers identify the most suitable crop to grow based on the soil nutrient level and environmental conditions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published