π A simple web application built using Flask and a trained machine learning model to predict the most suitable crop based on soil and climate conditions. Users input values like nitrogen, phosphorus, rainfall, and temperature to get real-time crop suggestions. π‘ Powered by Python, Flask, HTML/CSS, and a scikit-learn model serialized with Pickle.
- User-friendly HTML form for input
- Real-time crop prediction using a trained ML model
- Lightweight and easy to deploy locally or online
- Built with Flask and Pickle for backend model handling
app.py
β Main Flask applicationtemplates/myhtml.html
β Frontend form (Jinja2 templating)model.pkl
β Pre-trained machine learning modelrequirements.txt
β List of required Python librariesREADME.md
β Project documentation
- Clone this repo
git clone https://github.com/yourusername/crop-predictor.git cd crop-predictor
Install dependencies
pip install -r requirements.txt
Run the app python app.py Open your browser and go to http://127.0.0.1:5000/
π§ Model Input Format The model expects the following numerical inputs:
-Nitrogen (N) -Phosphorus (P) -Potassium (K) -Temperature (Β°C) -Humidity (%) -pH level -Rainfall (mm)
π¦ Requirements Python 3.x Flask scikit-learn numpy pickle
You can install all dependencies using:
pip install -r requirements.txt
π Deployment To make the app publicly available, consider deploying it using:
-Render -Replit -PythonAnywhere
π Acknowledgements -Dataset from Kaggleβs crop recommendation dataset -Model trained using scikit-learn -Flask documentation and tutorials
π€ Author Eman Ihsan
GitHub: @eman06