AgroMind Fertilizer Prediction Model
Model Description
Scikit-learn classifier that predicts the most suitable fertilizer based on soil conditions, crop type, and environmental factors.
Framework
- Library: scikit-learn
- Format: pickle (.pkl)
- Includes: classifier model + LabelEncoder for fertilizer names
Input Features
| Feature | Type |
|---|---|
| Temperature | int (0β100) |
| Humidity | int (0β100) |
| Moisture | int (0β100) |
| Soil Type | encoded int (Black=0, Clayey=1, Loamy=2, Red=3, Sandy=4) |
| Crop Type | encoded int (Barley=0, Cotton=1, β¦ Wheat=10) |
| Nitrogen | int (0β100) |
| Potassium | int (0β100) |
| Phosphorus | int (0β100) |
Usage
from huggingface_hub import hf_hub_download
import pickle, numpy as np
repo = "Arko007/agromind-fertilizer-prediction"
with open(hf_hub_download(repo, "classifier.pkl"), "rb") as f:
clf = pickle.load(f)
with open(hf_hub_download(repo, "fertilizer.pkl"), "rb") as f:
le = pickle.load(f)
features = np.array([[28, 65, 40, 2, 6, 50, 40, 30]]) # [temp, hum, mois, soil, crop, N, K, P]
pred_idx = clf.predict(features)
fertilizer = le.inverse_transform(pred_idx)
Output
Fertilizer name (string) via LabelEncoder inverse transform.