Update README.md
Browse files
README.md
CHANGED
@@ -1,14 +1,64 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
|
5 |
-
##
|
6 |
|
7 |
-
|
8 |
|
9 |
## Training Data
|
10 |
-
## Usage
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
datasets:
|
4 |
+
- custom
|
5 |
+
metrics:
|
6 |
+
- mean_squared_error
|
7 |
+
- mean_absolute_error
|
8 |
+
- r2_score
|
9 |
+
model_name: Random Forest Regressor for Crop Nutrient Prediction
|
10 |
+
tags:
|
11 |
+
- random-forest
|
12 |
+
- regression
|
13 |
+
- agriculture
|
14 |
+
- soil-nutrients
|
15 |
+
---
|
16 |
|
17 |
+
# Random Forest Regressor for Crop Nutrient Prediction
|
18 |
|
19 |
+
## Overview
|
20 |
|
21 |
+
This model predicts the nutrient needs (Nitrogen, Phosphorus, Potassium) for various crops based on features like crop type, target yield, field size, and soil properties. It is trained using a Random Forest Regressor.
|
22 |
|
23 |
## Training Data
|
|
|
24 |
|
25 |
+
The model was trained on a custom dataset containing the following features:
|
26 |
+
- Crop Name
|
27 |
+
- Target Yield
|
28 |
+
- Field Size
|
29 |
+
- pH (water)
|
30 |
+
- Organic Carbon
|
31 |
+
- Total Nitrogen
|
32 |
+
- Phosphorus (M3)
|
33 |
+
- Potassium (exch.)
|
34 |
+
- Soil moisture
|
35 |
|
36 |
+
The target variables are:
|
37 |
+
- Nitrogen (N) Need
|
38 |
+
- Phosphorus (P2O5) Need
|
39 |
+
- Potassium (K2O) Need
|
40 |
+
|
41 |
+
## Model Training
|
42 |
+
|
43 |
+
The model was trained using a Random Forest Regressor. Below are the steps taken for training:
|
44 |
+
|
45 |
+
1. Data preprocessing: handling missing values, scaling numerical features, and one-hot encoding categorical features.
|
46 |
+
2. Splitting the dataset into training and testing sets.
|
47 |
+
3. Training the Random Forest model on the training set.
|
48 |
+
4. Evaluating the model on the test set.
|
49 |
+
|
50 |
+
## Evaluation Metrics
|
51 |
+
|
52 |
+
The model was evaluated using the following metrics:
|
53 |
+
- Mean Squared Error (MSE)
|
54 |
+
- Mean Absolute Error (MAE)
|
55 |
+
- R-squared (R2) Score
|
56 |
+
|
57 |
+
## How to Use
|
58 |
+
|
59 |
+
### Installation
|
60 |
+
|
61 |
+
To install the necessary packages, run:
|
62 |
+
|
63 |
+
```bash
|
64 |
+
pip install -r requirements.txt
|