// Predictive Band Score — uses weighted feature extraction from all practice data // to estimate the user's current IELTS band. Shows feature importance + recommendations. function BandPredictor({ state, setRoute }) { const prediction = useMemo(() => window.nlpAnalyzer.predictOverallBand(state), [state]); const topicStats = useMemo(() => window.getTopicStats(state), [state]); if (!prediction || !prediction.band) { return (
AI Band Predictor

Your predicted band.

Not enough data yet
{prediction?.message || 'Complete more quizzes, write some sentences, and learn vocabulary. The predictor needs at least 5 interactions.'}
); } const gap = state.targetBand - prediction.band; const onTrack = gap <= 0.5; // Generate recommendations based on weakest features const sortedFeatures = Object.entries(prediction.features) .filter(([k]) => k !== 'dataPoints') .sort((a, b) => a[1] - b[1]); const weakest = sortedFeatures.slice(0, 3); const recommendations = weakest.map(([feature, value]) => { const map = { vocabAccuracy: { label: 'Vocabulary Quiz Accuracy', action: 'Take more vocab quizzes. Focus on getting them right, not just fast.', route: 'quiz' }, vocabBreadth: { label: 'Vocabulary Breadth', action: 'Learn more words — browse new vocabulary daily and use the SRS review system.', route: 'vocab' }, grammarAccuracy: { label: 'Grammar Accuracy', action: 'Practice grammar drills. Focus on tenses, articles, and prepositions.', route: 'grammar' }, grammarBreadth: { label: 'Grammar Knowledge', action: 'Read more grammar lessons. You\'ve only covered a portion of the available material.', route: 'grammar' }, writingPractice: { label: 'Writing Practice', action: 'Write more sentences. Use the sentence writing tool and the AI writing analyzer.', route: 'writing' }, streakConsistency: { label: 'Study Consistency', action: 'Study every day, even for just 15 minutes. Consistency beats intensity.', route: 'home' }, srsRetention: { label: 'Long-term Retention', action: 'Review due SRS cards daily. Retention is built through spaced repetition, not cramming.', route: 'vocab' }, }; return { ...map[feature], feature, value: Math.round(value * 100) }; }); return (
AI Band Predictor · {prediction.confidence}% confidence

Your predicted band.

Based on {prediction.features.dataPoints} data points from your quizzes, vocabulary, grammar, and writing practice.

{/* Main prediction card */}
{onTrack ? 'On track for your target' : `${gap} bands below your target`}
{prediction.band}
Predicted band · target: {state.targetBand} · confidence: {prediction.confidence}%
{/* Feature breakdown */}
Skill Breakdown
{Object.entries(prediction.breakdown).map(([label, score]) => { const pct = Math.round((score / 9) * 100); return (
{label} = 7 ? 'var(--success)' : score >= 5 ? 'var(--warning)' : 'var(--danger)' }}>{score.toFixed(1)}
); })}
Raw Feature Values
{Object.entries(prediction.features).filter(([k]) => k !== 'dataPoints').map(([key, value]) => { const labels = { vocabAccuracy: 'Quiz accuracy', vocabBreadth: 'Words learned', grammarAccuracy: 'Grammar accuracy', grammarBreadth: 'Lessons read', writingPractice: 'Writing done', streakConsistency: 'Streak strength', srsRetention: 'SRS retention', }; const pct = Math.round(value * 100); return (
{labels[key] || key}
= 70 ? 'var(--success)' : pct >= 40 ? 'var(--warning)' : 'var(--danger)' }} />
{pct}%
); })}
{/* Recommendations */}
🎯 Priority Recommendations
{recommendations.map((rec, i) => ( ))}
{/* Topic vocabulary coverage */}
Topic Vocabulary Coverage
{topicStats.filter(t => t.totalWords > 5).map(t => (
{t.icon} {t.label} {t.pct}%
{t.learned}/{t.totalWords} words
))}
{/* How it works */}
How the prediction works
This uses a weighted linear model with 7 features extracted from your practice data: quiz accuracy, vocabulary breadth, grammar accuracy, grammar lessons completed, writing practice volume, study streak consistency, and SRS long-term retention rate. Features are normalized to [0,1] and weighted by their correlation to IELTS band scores (calibrated against published score distributions). Confidence increases with more data points — at 50+ interactions the prediction stabilizes.
); } Object.assign(window, { BandPredictor });