- Find the feature (chemical element) that predicts the crop type the best
- Various preferred concentration combinations of chemical elements for different crop types
- Source: DataCamp
- Multi-class classification to group crops given the conditions under which they thrive
- Apply logistic regression for each feature (concentration) to identify which soil characteristic determines the crop type the best
Nitrogen concentration |
Phosphorous concentration |
Potassium concentration |
PH value | |
---|---|---|---|---|
mean | 50.6 | 53.4 | 48.1 | 6.5 |
std | 36.9 | 33.0 | 50.6 | 0.8 |
min | 0.0 | 5.0 | 5.0 | 3.5 |
25% | 21.0 | 28.0 | 20.0 | 6.0 |
50% | 37.0 | 51.0 | 32.0 | 6.4 |
75% | 84.2 | 68.0 | 49.0 | 6.9 |
max | 140.0 | 145.0 | 205.0 | 9.9 |
- Nitrogen concentration: Median concentrations for many crops centers around 20 but few outliers with larger concentration values.
- Phosphorous concentration: Broader values than for Nitrogen. Most crops prefer concentrations below 100, except Grapes and Apples.
- Potassium concentration: Most crops prefer lower concentration values (between 25 and 50) but Apples and Grapes show extreme values around 200.
- PH values are mostly between 6 and 7 which makes sense as crops cannot flourish under too alkaline or acidic conditions. However, Mothbeans show a broad distribution (values between 4 and 10).
Nitrogen concentration |
Phosphorous concentration |
Potassium concentration |
PH value | |
---|---|---|---|---|
Nitrogen concentration |
1.00 | -0.23 | -0.14 | 0.10 |
Phosphorous concentration |
-0.23 | 1.00 | 0.74 | -0.14 |
Potassium concentration |
-0.14 | 0.74 | 1.00 | -0.17 |
PH value | 0.10 | -0.14 | -0.17 | 1.00 |
- Phosphorous and Potassium are strongly positively correlated
- Nitrogen and Phosphorous have a weak to moderate negative correlation
concentration | F1 score |
---|---|
Nitrogen concentration |
0.104057 |
Phosphorous concentration |
0.182618 |
Potassium concentration |
0.260034 |
PH value | 0.076458 |
- Best predictor for the crop type: Potassium (F1 Score = 0.26) followed by Phosphorous (F1 score = 0.18)
- That Phosphorous follows Potassium quite closely and is also a (relatively) good predictor might be suspected from the correlation table above. Phosphorous and Potassium are strongly positively correlated.
- PH value is a bad predictor for the crops.