AgroMind Crop Recommendation Model
Model Description
Scikit-learn classifier that recommends the optimal crop to cultivate based on soil nutrient levels and weather conditions.
Framework
- Library: scikit-learn
- Format: joblib/pickle (.pkl)
- Scalers included: StandardScaler + MinMaxScaler
Input Features
| Feature | Range | Unit |
|---|---|---|
| N (Nitrogen) | 0β100 | kg/ha |
| P (Phosphorus) | 0β100 | kg/ha |
| K (Potassium) | 0β100 | kg/ha |
| Temperature | -10β50 | Β°C |
| Humidity | 0β100 | % |
| pH | 0β14 | |
| Rainfall | 0β500 | mm |
Usage
from huggingface_hub import hf_hub_download
import joblib, numpy as np
repo = "Arko007/agromind-crop-recommendation"
model = joblib.load(hf_hub_download(repo, "crop_predict_model.pkl"))
sc = joblib.load(hf_hub_download(repo, "crop_predict_standscaler.pkl"))
ms = joblib.load(hf_hub_download(repo, "crop_predict_minmaxscaler.pkl"))
features = np.array([[50, 30, 40, 28, 65, 6.5, 200]])
pred = model.predict(sc.transform(ms.transform(features)))
Output
Integer crop ID (1β22) mapping to: Rice, Maize, Jute, Cotton, Coconut, Papaya, Orange, Apple, Muskmelon, Watermelon, Grapes, Mango, Banana, Pomegranate, Lentil, Blackgram, Mungbean, Mothbeans, Pigeonpeas, Kidneybeans, Chickpea, Coffee.