LIVE CLASSIFIER
CS-LLN
Inspector
IRIS
FEATURES
4
d dimensions
INTERACTION PAIRS
3
TOP-K SELECTED
ENRICHED DIM.
7
d + k FEATURES
CLASSIFIER
L2-LR
LOGISTIC REG.
INTERACTION PAIRS k =
3
PAIRS USED: 3 / 6 POSSIBLE
IRIS FEATURES
LIVE
FEATURE ENRICHMENT
x̃ ∈ ℝd+k
COMPUTING...
CLASSIFICATION
CS-LLN
LOADING...
CONTEXT-SHIFT MATRIX ΔRij
4×4
PAIR RANKINGS
TOP-k SELECTED
CONTEXT-SHIFT ANALYSIS
ΔRij MATRIX EXPLORER
Mean Absolute Context-Shift scores for the Breast Cancer Wisconsin dataset (top 12 features by total shift).
Dark accent cells mark pairs where within-class correlation diverges most between malignant and benign tissue.
DATASET
BCW
BREAST CANCER WISCONSIN
FEATURE PAIRS
435
d=30 → C(30,2)
BEST ΔR PAIR
0.70
MEAN AREA × RADIUS ERR
MEAN ABSOLUTE CONTEXT-SHIFT ΔRij
TOP 12 FEATURES
ΔR > 0.5 (HIGH SHIFT)
ΔR 0.25–0.5
ΔR < 0.25 (LOW)
LOADING HEATMAP...
TOP 10 PAIRS BY ΔR SCORE
BREAST CANCER
The dominant pairs all involve combinations of
worst-radius,
worst-area, and
worst-perimeter —
three measures of the same geometric property of the largest observed cell nucleus.
In malignant tissue these co-elevate; in benign tissue they fluctuate independently.
This joint signal is structurally invisible to Naive Bayes.
CS-LLN ACCURACY vs. k (5-FOLD CV)
MODEL COMPARISON
BENCHMARK RESULTS
Five-fold stratified cross-validation against four standard baselines on three UCI benchmark datasets.
All models use StandardScaler fit on training folds only. CS-LLN hyperparameter k selected by inner CV.
ERROR REDUCTION vs NB
63%
BREAST CANCER DATASET
LOG-LOSS IMPROVEMENT
~10×
0.7768 → 0.0779
DATASETS WON
2 / 3
BREAST CANCER + WINE
WINE k=1 ACCURACY
99.4%
SINGLE PAIR SUFFICES
BREAST CANCER WISCONSIN
★ CS-LLN WINS
N=569, d=30, C=2
WINE RECOGNITION
★ CS-LLN WINS
N=178, d=13, C=3
IRIS
LDA WINS
N=150, d=4, C=3
ACCURACY COMPARISON — ALL DATASETS
5-FOLD CV
METHODOLOGY
CS-LLN PIPELINE
Five-step closed-form algorithm. No gradient computation until the final logistic regression step.
All screening is done in a single pass over the training data.
ALGORITHM STEPS
ALGORITHM 1
01
STANDARDISE INPUT
Centre and scale each feature to zero mean and unit variance using training-fold statistics only.
Prevents test-set leakage and stabilises the correlation estimation step.
X ← StandardScaler().fit_transform(X_train)
02
CLASS-CONDITIONAL CORRELATIONS
For each class c, split the training rows and compute a full d×d Pearson correlation matrix R(c).
Each cell R(c)ij measures how features i and j co-vary within that class.
R(c)ij = Pearson(Xc,i, Xc,j) ∀ c, i < j
03
CONTEXT-SHIFT SCORING ΔRij
Compute the Mean Absolute Context-Shift score for every feature pair — the average absolute
difference in class-conditional correlation across all C(C-1)/2 class pairs.
A high ΔR means the pair's relationship is class-specific, something NB cannot see.
ΔRij = (2 / C(C-1)) · Σm<n |R(m)ij − R(n)ij|
04
SPARSE PAIR SELECTION Ωk
Rank all C(d,2) pairs by ΔR descending and select the top-k.
For d=30 with k=45, the enriched space is 75 dimensions vs 465 for full quadratic expansion — a 6.2× reduction.
Ωk = argtop-k(i,j): i<j ΔRij
05
FEATURE ENRICHMENT + LR
Append product terms xi·xj for each selected pair to form the enriched matrix X̃ ∈ ℝN×(d+k).
Train L2-regularised logistic regression on X̃. The decision boundary is linear in X̃ but quadratic in the original space X.
x̃ = [x1…xd, {xi·xj}(i,j)∈Ωk] → L2-LR
KEY INTUITION
WHY IT WORKS
Naive Bayes implicitly assumes R(c)ij = 0 for all classes and all pairs.
A pair with ΔRij = 0 is one NB is wrong about consistently — which doesn't bias the decision boundary.
A pair with ΔRij ≫ 0 is one NB is wrong about in a class-specific way — which systematically distorts posteriors.
CS-LLN targets precisely these pairs.
COMPLEXITY
BIG-O
CLASS CORRELATIONS
O(Nd²)
SORT ΔR
O(d² log d)
LR TRAINING
O(N(d+k)·iter)
INFERENCE / SAMPLE
O((d+k)·C)
GRADIENT STEPS NEEDED
0 (screening is closed-form)
VS. OTHER METHODS
COMPARISON
TAN
Tree structure · 1 parent
AODE
O(d) parameter tables
FACT. MACHINES
All pairs · needs SGD
FULL QUAD. EXPANSION
d+C(d,2) dims · no ranking
CS-LLN
k≪C(d,2) · closed-form rank
REAL-WORLD VALIDATION · COMPLETED STUDY
STUDENT
Performance
LIVE MODEL
CS-LLN applied to the sessional (internal-assessment) marks of 213 Computer Science
undergraduates at LNCT Bhopal, predicting each student's final performance band from
mid-sem, quiz, and practical-lab marks. This validates the method on messy, real institutional
data — not just clean UCI benchmarks.
STUDENTS (N)
213
CSE · LNCT BHOPAL
SESSIONAL FEATURES
14
MID · QUIZ · PRACTICAL
PERFORMANCE CLASSES
3
HIGH · AVERAGE · AT-RISK
CS-LLN ACCURACY
66.69%
+6.13pp vs NAIVE BAYES
DATA NOTE
The headline numbers on this page (accuracy table, top-pair table) come from the
real, anonymized student dataset used in the paper. The live predictor
below trains in your browser on a seeded synthetic proxy that reproduces
the study's class-conditional correlation-shift structure — the raw student marks stay private. This
is the same honesty policy the site uses for the Wine and Breast-Cancer live demos.
WHY THIS DATASET BREAKS NAIVE BAYES
THE WITHDRAWAL SPIRAL
Study habits don't fail independently. A student who starts slipping in theory mid-sems tends,
at the same time, to do worse in quizzes, skip practical classes, and stop submitting
lab term-work — what Tinto's model of student attrition calls the
withdrawal spiral.
That produces a class-specific coupling: among at-risk students, quiz marks and practical marks are strongly correlated (both collapse together); among high performers the same pair is decoupled (uniformly good). Naive Bayes, which assumes features are independent within each class, is structurally blind to this shift. CS-LLN screens for exactly these ΔRij pairs and hands them to logistic regression as product features — turning a blind spot into an early-warning signal.
That produces a class-specific coupling: among at-risk students, quiz marks and practical marks are strongly correlated (both collapse together); among high performers the same pair is decoupled (uniformly good). Naive Bayes, which assumes features are independent within each class, is structurally blind to this shift. CS-LLN screens for exactly these ΔRij pairs and hands them to logistic regression as product features — turning a blind spot into an early-warning signal.
CLASS DEFINITION (BY CGPA)
N = 213
HIGH PERFORMERSCGPA ≥ 7.8 · 69 students
AVERAGE PERFORMERS7.0 ≤ CGPA < 7.8 · 94 students
AT-RISK STUDENTSCGPA < 7.0 · 50 students
PIPELINE ON THIS DATA
STANDARDISEz-score marks (train folds only)
SCREEN ΔRijrank 91 pairs by shift
SELECT kk = 5 (inner CV)
ENRICH + LR14 → 19 features → L2-LR
EVALUATE5-fold stratified CV
INTERACTIVE
LIVE EARLY-WARNING PREDICTOR
A CS-LLN model trained live in your browser on the seeded student proxy. Move the sliders to enter a
student's key sessional marks and watch the predicted performance band update in real time. Unset
features are held at the cohort average.
KEY SESSIONAL MARKS
LIVE
PREDICTED PERFORMANCE BAND
CS-LLN
COMPUTING...
LIVE ΔRij — SELECTED PAIRS
TOP-k
COMPUTING...
5-FOLD CROSS-VALIDATION RESULTS — REAL DATASET
N=213, d=14, C=3
CS-LLN corrects Naive Bayes' calibration (log-loss 1.87 → 0.78, 2.40× better) and beats both tree ensembles.
The discriminative linear baselines (LR, SVM, LDA) lead by a small margin — CS-LLN is competitive while staying interpretable.
ACCURACY — ALL MODELS
5-FOLD CV
LOG-LOSS: CS-LLN vs NAIVE BAYES
2.40× BETTER
The accuracy gain over Gaussian Naive Bayes (+6.13pp) is real, but the bigger story is
calibration. GNB's log-loss on this data is a poor
1.8669 — it is confidently wrong about many
students because it double-counts the coupled quiz/practical marks. Adding just five
correlation-shifting product terms drops the log-loss to
0.7768, meaning CS-LLN's
probability estimates of who is at risk are far more trustworthy — the property that matters most
for an early-warning tool.
TOP-5 CORRELATION-SHIFTING PAIRS — EDUCATIONAL INTERPRETATION
ΔRij · REAL DATA
The ranking is dominated by pairs involving CS503 quiz marks
coupled with practical lab work. These are precisely the
relationships the withdrawal-spiral theory predicts: continuous-assessment engagement (quizzes) and
hands-on engagement (labs) rise and fall together for at-risk students, but move independently for
high performers. CS-LLN discovers this from marks alone — no survey, no manual feature engineering.
PAPER INFO
CS-LLN
PREPRINT
Context-Shift Interaction Screening for Feature-Enriched Classification:
A Sparse, Closed-Form Approach Beyond the Naive Independence Assumption
PAPER DETAILS
AUTHORAtharv Khare
INSTITUTIONLNCT Bhopal, India
DEPARTMENTCSE
METHOD NAMECS-LLN
CORE CRITERIONΔRij (Mean Abs. Context-Shift)
FINAL CLASSIFIERL2 Logistic Regression
CODE FRAMEWORKsklearn-compatible Python
KEY RESULTS
BREAST CANCER ACCURACY97.72% ± 1.6
vs. GAUSSIAN NB+4.75pp (63% error ↓)
LOG-LOSS IMPROVEMENT~10× (0.77 → 0.08)
WINE ACCURACY98.89% with k=5
WINE k=1 ACCURACY99.44% (single pair!)
DATASETS WON2 / 3 UCI BENCHMARKS
ABSTRACT
The Naive Bayes classifier is widely used for its simplicity and speed, but its core assumption
that all features are conditionally independent given the class label does not hold in most
real-world datasets. When features are correlated in class-specific ways, NB either double-counts
redundant evidence or misses compound signals that only appear when features co-occur.
CS-LLN identifies feature pairs whose pairwise Pearson correlation changes most across class boundaries and enriches the feature space with their product terms before discriminative classification. The pair selection criterion (ΔRij) requires no iterative optimization and no gradient computation.
CS-LLN identifies feature pairs whose pairwise Pearson correlation changes most across class boundaries and enriches the feature space with their product terms before discriminative classification. The pair selection criterion (ΔRij) requires no iterative optimization and no gradient computation.
REAL-WORLD VALIDATION
COMPLETED
CS-LLN was validated on a real student academic performance dataset
of 213 CSE undergraduates at LNCT Bhopal, using sessional mid-sem, quiz, and practical-lab marks to
predict final CGPA band. See the STUDENT STUDY tab for the live
model, results, and top correlation-shifting pairs.
DATASETN=213, d=14, C=3 (real, anonymized)
CS-LLN ACCURACY66.69% (k=5)
vs. GAUSSIAN NB+6.13pp · log-loss 2.40× ↓
TOP PAIRCS503 quiz × CS502 lab (ΔR=0.45)
MECHANISMWithdrawal spiral → high ΔR
LIMITATIONS
FEATURE TYPEContinuous only (Pearson)
MIN SAMPLES / CLASSNc ≥ 2d recommended
HYPERPARAMETER kNeeds cross-validation
FUTURE WORKPolychoric corr. for ordinal