Skip to content

Commit

Permalink
Crop_recommendation added
Browse files Browse the repository at this point in the history
  • Loading branch information
Shy029 committed Oct 29, 2024
1 parent 5fcd73a commit 469656c
Show file tree
Hide file tree
Showing 7 changed files with 4,164 additions and 0 deletions.
2,201 changes: 2,201 additions & 0 deletions Recommendation Systems/Crop_recommendation System/Crop_recommendation.csv

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions Recommendation Systems/Crop_recommendation System/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# **Crop Recommendation System 🌾**

This project is a machine learning-powered tool that suggests the most suitable crop based on environmental parameters such as **temperature, humidity, pH, and rainfall**. It aims to help farmers make data-driven decisions, boosting productivity and sustainability.

## **Features**
- **Multiple ML Models**: Utilizes Logistic Regression, Naive Bayes, SVM, Random Forest, and more.
- **Flask-based Web App**: User-friendly interface for real-time crop recommendations.
- **Scalable Solution**: Adaptable for different regions and climates.

## **Tech Stack**
- **Python**, **Scikit-Learn** for machine learning
- **Flask** for web application
- **Pickle** for model persistence
- **Jupyter Notebook** for development

## **How to Run the Application**
1. **Clone the repository**:
```bash
git clone <repo_url> && cd crop-recommendation-system
```

2. **Install dependencies**:
```bash
pip install -r requirements.txt
```

3. **Train the Model (Optional)**:
Use `crop_main.ipynb` to train the model or load the existing one.
```python
import pickle
model = pickle.load(open('model.pkl', 'rb'))
```

4. **Run the Flask App**:
```bash
python app.py
```


5. **Sample Input Example**:
```
N = 10, P = 10, K = 10
Temperature = 15.0°C
Humidity = 80%
pH = 4.5
Rainfall = 10 mm
```

## **Troubleshooting**
- **Pickle Load Error**: Ensure the **same scikit-learn version** used for training is installed.
- **Alternative with Joblib**:
```python
import joblib
model = joblib.load('model.pkl')
```

Loading

0 comments on commit 469656c

Please sign in to comment.