Overview
This is the initial release of the Crop Prediction AI System, a comprehensive solution designed to predict optimal crop yields based on environmental and soil parameters. This project includes both front-end and back-end components, allowing users to interact with the prediction system via a user-friendly API.
Features
- Multi-model prediction using Decision Tree, Logistic Regression, Naive Bayes, and Random Forest algorithms.
- FastAPI-based backend for efficient API handling.
- User-friendly front-end interface for easy input and visualization of predictions.
Installation
To get started with the Crop Prediction AI System, follow these instructions:
Backend Setup
-
Clone the repository:
git clone https://github.com/mosh3eb/Crop_predictor.git cd Crop_predictor/BackEnd -
Install the required dependencies:
pip install -r requirements.txt
-
Start the FastAPI server:
uvicorn main:app --reload
FrontEnd Setup
-
Navigate to the front-end directory:
cd FrontEnd -
Install the front-end dependencies:
npm install
Usage
-
Send a POST request to the
/predictendpoint with the following JSON body:{ "nitrogen": <value>, "phosphorus": <value>, "potassium": <value>, "temperature": <value>, "humidity": <value>, "ph": <value>, "rainfall": <value> } -
The response will include the predicted crop:
{ "predicted_crop": "crop_name" }
Contribution
Contributions are welcome! If you have suggestions for improvements or new features, please fork the repository and submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.