MLML Decision SupportAdvanced

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.

99.55%
Test Accuracy
22
Crop Classes
4
Models Compared
Detailed workflow

System Architecture

Guarded inference architecture documented in the Kshetra Sense repository.

Verify on GitHub
01 · Input1

Seven field measurements

Soil nutrients, pH, temperature, humidity, and rainfall enter a validated schema.

02 · Guard2

Range + OOD assessment

The system checks plausibility and distance from training conditions before inference.

03 · Predict3

Tuned multiclass model

Four classifier families are compared before the selected model scores 22 crop classes.

04 · Decide4

Rank or abstain

Calibrated probabilities support a top-five ranking or a guarded abstention when evidence is weak.

05 · Explain5

Recommendation workspace

The Streamlit experience connects rankings, confidence, feature importance, and EDA.

Quality gates
Five-fold GridSearchCV
Out-of-distribution guard
Held-out test accuracy
Validated output

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.

Project Snapshot

99.55%
Test Accuracy
22
Crop Classes
4
Models Compared