GitHub - richartdo/crop-recommendation: Machine learning-based crop recommendation system using soil and climate parameters. · GitHub
Skip to content

About

Machine learning-based crop recommendation system using soil and climate parameters.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

🌱 Crop Recommendation System

📌 Overview

This project leverages Machine Learning to recommend the most suitable crop to grow based on key agricultural factors:

  • Soil nutrients: Nitrogen (N), Phosphorus (P), Potassium (K)
  • Environmental conditions: pH, Rainfall, Temperature, Humidity

The model was trained and evaluated on the Crop Recommendation Dataset and deployed as an API using Flask on Render.


✨ Features

  • ✅ Data preprocessing with Label Encoding and StandardScaler
  • ✅ Multiple ML models tested (Decision Tree, Random Forest, Logistic Regression, etc.)
  • ✅ XGBoost chosen as the best-performing model
  • ✅ Saved trained model + scaler + label encoder for reproducibility
  • ✅ REST API built with Flask for deployment
  • ✅ Hosted live on Render

📂 Project Structure

''' ├── notebooks/ │ └── crop_recommendation.ipynb # Training notebook ├── models/ │ ├── best_model_xgboost.pkl # Saved trained model (XGBoost) │ ├── scaler.pkl # StandardScaler object │ └── label_encoder.pkl # LabelEncoder object ├── app.py # Flask API for deployment ├── requirements.txt # Dependencies ├── README.md # Project documentation '''


🚀 Live API

🔧 Usage

Endpoint: /predict

  • Method: POST
  • Headers:
    Content-Type: application/json

Example Request

{
  "N": 90,
  "P": 42,
  "K": 43,
  "temperature": 20.5,
  "humidity": 80,
  "ph": 6.5,
  "rainfall": 200
}

About

Machine learning-based crop recommendation system using soil and climate parameters.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages