Views
No views yet
| 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) |
1from huggingface_hub import hf_hub_download
2import pickle, numpy as np
3
4repo = "Arko007/agromind-fertilizer-prediction"
5with open(hf_hub_download(repo, "classifier.pkl"), "rb") as f:
6 clf = pickle.load(f)
7with open(hf_hub_download(repo, "fertilizer.pkl"), "rb") as f:
8 le = pickle.load(f)
9
10features = np.array([[28, 65, 40, 2, 6, 50, 40, 30]]) # [temp, hum, mois, soil, crop, N, K, P]
11pred_idx = clf.predict(features)
12fertilizer = le.inverse_transform(pred_idx)