@extends('layouts.admin') @section('content')

AI Cut-off Predictor

Predict Cut-off

Select history sessions + target session. AI will calculate the average difficulty of each session and predict the cut-off.

Sessions
@if(session('status'))
{{ session('status') }}
@endif @if($errors->any())
@foreach($errors->all() as $e)
{{ $e }}
@endforeach
@endif
@csrf
@forelse($sessions as $s) @if($s->cut_off_general) @endif @empty

No sessions found for this exam type.

@endforelse
{{-- RESULT --}} @if(session('prediction')) @php $r = session('prediction'); @endphp
{{-- Header --}}

Prediction

{{ $r['prediction']['target_year'] ?? 'โ€”' }} ยท {{ $r['prediction']['target_session'] ?? 'โ€”' }}

@php $conf = $r['prediction']['confidence'] ?? 'n/a'; $confColor = match($conf) { 'high' => 'bg-emerald-500/20 text-emerald-200 border-emerald-400/40', 'medium' => 'bg-amber-500/20 text-amber-200 border-amber-400/40', default => 'bg-rose-500/20 text-rose-200 border-rose-400/40', }; @endphp {{ $conf }} confidence
{{-- Category Cut-off --}} @php $cut = $r['prediction']['predicted_cutoff'] ?? []; $ci = $r['prediction']['confidence_interval'] ?? []; $cats = [ 'general' => ['label' => 'General', 'color' => 'from-cyan-400 to-blue-500'], 'obc' => ['label' => 'OBC', 'color' => 'from-emerald-400 to-teal-500'], 'sc' => ['label' => 'SC', 'color' => 'from-amber-400 to-orange-500'], 'st' => ['label' => 'ST', 'color' => 'from-pink-400 to-rose-500'], ]; @endphp
@foreach($cats as $key => $meta) @php $val = $cut[$key] ?? null; $range = $ci[$key] ?? 0; $min = $val !== null ? $val - $range : null; $max = $val !== null ? $val + $range : null; @endphp

{{ $meta['label'] }}

{{ $val ?? 'โ€”' }}

@if($val !== null && $range)

Range: {{ $min }} โ€“ {{ $max }}

@endif
@endforeach
{{-- โญ NEW: Cut-off Factors Breakdown --}} @if(!empty($r['cut_off_factors'])) @php $cf = $r['cut_off_factors']; @endphp

Prediction Breakdown (how it was calculated)

@php $cats = ['general' => 'General', 'obc' => 'OBC', 'sc' => 'SC', 'st' => 'ST']; $base = $cf['base_value'] ?? []; $diff = $cf['difficulty_impact'] ?? []; $comp = $cf['competition_impact'] ?? []; $trend = $cf['trend_impact'] ?? []; @endphp
@foreach($cats as $k => $l) @endforeach @foreach($cats as $k => $l) @php $v = $diff[$k] ?? 0; @endphp @endforeach @foreach($cats as $k => $l) @php $v = $comp[$k] ?? 0; @endphp @endforeach @foreach($cats as $k => $l) @php $v = $trend[$k] ?? 0; @endphp @endforeach @foreach($cats as $k => $l) @endforeach
Factor General OBC SC ST
Base (last year){{ $base[$k] ?? 'โ€”' }}
Difficulty impact {{ $v >= 0 ? '+' : '' }}{{ $v }}
Competition impact {{ $v >= 0 ? '+' : '' }}{{ $v }}
Trend impact {{ $v >= 0 ? '+' : '' }}{{ $v }}
Final Predicted {{ $r['prediction']['predicted_cutoff'][$k] ?? 'โ€”' }}
@if(!empty($cf['explanation']))

Reason: {{ $cf['explanation'] }}

@endif
@endif {{-- Trend Chart --}} @if(!empty($r['yearly_cutoff_table']))

Cut-off Trend

@endif {{-- Subject + Topic Charts --}}
@if(!empty($r['subject_weightage']))

๐Ÿ“Š Subject Weightage

@endif @if(!empty($r['topic_weightage']))

๐ŸŽฏ Topic Weightage (Top 10)

@endif
{{-- Subject-Topic Breakdown --}} @if(!empty($r['subject_topic_breakdown']))

๐Ÿ“š Subject-wise Topic Breakdown

@foreach($r['subject_topic_breakdown'] as $group)

{{ $group['subject'] ?? 'โ€”' }}

{{ $group['weightage'] ?? 0 }}%
    @foreach($group['topics'] ?? [] as $topic)
  • {{ $topic['name'] ?? 'โ€”' }} {{ $topic['weightage'] ?? 0 }}%
  • @endforeach
@endforeach
@endif {{-- Important + Ignored --}}
@if(!empty($r['important_topics']))

โœ… Important Topics

    @foreach($r['important_topics'] as $t)
  • {{ $t['topic'] ?? 'โ€”' }} ยท {{ $t['subject'] ?? '' }} {{ $t['weightage'] ?? 0 }}%
  • @endforeach
@endif @if(!empty($r['ignored_topics']))

โš ๏ธ Ignored Topics

    @foreach($r['ignored_topics'] as $t)
  • {{ $t['topic'] ?? 'โ€”' }} ยท {{ $t['subject'] ?? '' }} {{ $t['weightage'] ?? 0 }}%
  • @endforeach
@endif
{{-- Reasoning --}} @if(!empty($r['prediction']['reasoning']))

AI Reasoning

{{ $r['prediction']['reasoning'] }}

@endif
@endif @endsection