kaala
For Farmers. For Hard workers. For Thalaivar.😎😎😎.
What is kaala?
Kaala (pronounced: kaa-la, kaala represents black, the color of hard work in Tamil) is a software that helps farmers to predict the best crop to cultivate for growing perennial crops for that particular season and specific soil conditions. We (@MINOSai, @bhaveshpraveen) and myself made this web application for helping farmers. This is the Data Science Part. Also we won the second place in VIT SCOPE's Software Engineering Hackathon.
What are the features?
- Rainfall
- Temperature
- Vegetation
- Potential evapotranspiration
- Length of growing period as a function of rainfall.
- Soil storage
- Soil scape
- Soil type
- Current season
- Companion crops
- Time for plant to grow
Source: How to determine the kinds of crops suitable to different types of soil? - ResearchGate
Classes/Labels/Crops
CEREALS
- Rice
- Jowar (Cholam)
- Bajra (Cumbu)
- Ragi
PULSES
- Bengalgram
- Redgram
Source: Season and Crop Report of Tamil Nadu
which gives us 6 classes.
More about the Data
I have used scikit-learn's make_classification for creating 6,04,800 observations for 11 above mentioned features and 6 classes, unsupervised learning -> k means clustering couldn't help us achieve a good accuracy, so I had to use kNN with k=30 to get the most probable values using predict_proba
for the particular model. Also 11 features were there, I had to use PCA to reduce the dimensions to 5 to get even better accuracy of 88.54%
. Final results and dumping them into pkl file using Pipeline
and joblib
is shown in kaala-mark2.ipynb. Note this is a normally distributed synthesized data. Not actual data from any particular source.
Usage
kaala.py
has the steps to execute the 11 values obtained from the farmer/technician to get the result, which is a list of probable values for that particular crop being fit for that type of soil.
Below is a demonstrated example.
λ python
Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from kaala import result
>>> result([0.7355922448977834,
... 0.5241942948529987,
... 1.2148519094713788,
... 0.13122963308657765,
... -0.15842665047198703,
... 0.25808805092069,
... -1.6808344120353165,
... 0.09900267090424587,
... -1.2541620126778479,
... 1.1452959921425545,
... -0.4384289245048979])
[0.0, 0.9666666666666667, 0.03333333333333333, 0.0, 0.0, 0.0]
>>>