Upload 4 files
Browse filesFiles changed (4)
- README.mdAdded+15
- inference.pyAdded+15
- label_encoder.pklAdded+3
- soil.pklAdded+3
123456789101112131415---license: mittags:- crop-recommendation- agriculture- random-forest- classification---
# Crop Recommendation Model 🌾
This model recommends the best crop based on soil and weather conditions.Inputs required: Nitrogen, Phosphorus, Potassium, Temperature, Humidity, pH, Rainfall.
Trained on Crop Recommendation Dataset.123456789101112131415import joblibimport numpy as np
# Load model and label encodermodel = joblib.load("soil.pkl")label_encoder = joblib.load("label_encoder.pkl")
def predict(inputs): """ Inputs: List of 7 features [N, P, K, temperature, humidity, ph, rainfall] """ input_array = np.array(inputs).reshape(1, -1) prediction = model.predict(input_array) crop = label_encoder.inverse_transform(prediction) return crop[0]123version https://git-lfs.github.com/spec/v1oid sha256:2c483356146f16bafb2a06d5a2752f59bcad768e83efae06d6a9982e605b4370size 830123version https://git-lfs.github.com/spec/v1oid sha256:5508cefadfad0197f9e5b029eb072fef25ff804a0c23a6a7a427d10a7d97c9b8size 3672233README.mdAdded+15
inference.pyAdded+15
label_encoder.pklAdded+3
soil.pklAdded+3