File size: 1,529 Bytes
b2acdd4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | Soil Fertility Prediction Model
This machine learning model predicts soil fertility status (e.g. fertile or infertile) based on several chemical soil parameters. It was trained using a Random Forest Classifier on real agricultural data.
π§ Model Info
Type: Random Forest Classifier
Framework: Scikit-learn
Input: 13 numerical soil features
Output: Fertility classification with confidence score
π₯ Input Format
The model expects a list of 13 numeric values in the following order:
[
Nitrogen (N),
Phosphorus (P),
Potassium (K),
Soil Acidity (pH),
Electrical Conductivity (EC),
Organic Carbon (OC),
Sulfur (S),
Zinc (Zn),
Iron (Fe),
Copper (Cu),
Manganese (Mn),
Boron (B)
]
Example:
{
"inputs": [12.0, 5.5, 20.0, 6.7, 1.1, 0.6, 10.0, 1.2, 4.1, 0.4, 3.3, 0.2, 0.5]
}
β οΈ Note: The input must be a JSON object with the key "inputs" and a list of exactly 13 values.
π€ Output Format
The model returns a list with one dictionary containing the predicted label and a confidence score.
Example output:
[
{
"label": "fertile",
"score": 0.92
}
]
π¦ Files Included
random_forest_pkl.pkl β The trained model
inference.py β Required for Hugging Face model hub to run inference
requirements.txt β Python dependencies
README.md β This file
π Requirements
Python packages needed (also listed in requirements.txt):
scikit-learn
numpy
π§ Usage
This model can be used via the Hugging Face Inference API once uploaded to the Model Hub.
|