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.