Kshetra Sense
Ranked Crop Recommendations from Soil & Climate Data
Built a complete crop-recommendation system that compares four tuned classifiers and returns ranked suggestions for 22 crops from seven soil and climate measurements.
System Architecture
Guarded inference architecture documented in the Kshetra Sense repository.
Seven field measurements
Soil nutrients, pH, temperature, humidity, and rainfall enter a validated schema.
Range + OOD assessment
The system checks plausibility and distance from training conditions before inference.
Tuned multiclass model
Four classifier families are compared before the selected model scores 22 crop classes.
Rank or abstain
Calibrated probabilities support a top-five ranking or a guarded abstention when evidence is weak.
Recommendation workspace
The Streamlit experience connects rankings, confidence, feature importance, and EDA.
99.55% held-out accuracy across 22 balanced crop classes.
Project Overview
Kshetra Sense is an end-to-end machine learning application that recommends crops from nitrogen, phosphorus, potassium, temperature, humidity, soil pH, and rainfall measurements.
The dataset contains 2,200 balanced records across 22 crop classes. The workflow includes data auditing, exploratory analysis, label encoding, scaling, a stratified train-test split, and five-fold GridSearchCV.
KNN, Decision Tree, Random Forest, and SVM classifiers were tuned and evaluated using accuracy, precision, recall, macro F1, and cross-validation. Random Forest achieved the strongest held-out performance with 99.55% accuracy and macro F1.
The Streamlit application validates inputs, applies the saved preprocessing pipeline, and presents the most likely crop plus a ranked top-five probability view, model comparison, feature importance, and interactive EDA.
Problem
Crop suitability depends on interacting soil and weather variables, making single-factor recommendations unreliable and raw model predictions difficult to interpret.
Solution
Built and validated a reusable classification pipeline that compares four tuned models and serves ranked crop probabilities through an interactive Streamlit application.