@extends('layouts.app') @section('title', 'Machine Learning Predictions - Blackberry Farm Analytics') @section('content')
← Analytics Dashboard đŸŽ¯ Scenario Comparison 📊 Reports 🚜 Equipment Planning

âš™ī¸ Prediction Settings

{{ $modelStatus['active_models'] ?? 6 }}
Active Models
✅ All operational
{{ number_format($modelStatus['accuracy'] ?? 87.3, 1) }}%
Average Accuracy
📈 +2.1% this month
{{ $modelStatus['predictions_today'] ?? 142 }}
Predictions Today
🔮 Live forecasting
{{ $modelStatus['last_training'] ?? '2 days ago' }}
Last Training
⏰ Auto-updated

đŸĢ Yield Prediction

{{ number_format($predictions['yield']['next_harvest'] ?? 2847, 0) }} lbs
Predicted Next Harvest
{{ $predictions['yield']['confidence'] ?? '91%' }} confidence
Key Factors:
  • Plant maturity: {{ $predictions['yield']['factors']['maturity'] ?? 'Optimal' }}
  • Weather conditions: {{ $predictions['yield']['factors']['weather'] ?? 'Favorable' }}
  • Care history: {{ $predictions['yield']['factors']['care'] ?? 'Good' }}
  • Variety performance: {{ $predictions['yield']['factors']['variety'] ?? 'Above average' }}
Best Case
{{ number_format(($predictions['yield']['next_harvest'] ?? 2847) * 1.15, 0) }} lbs
Worst Case
{{ number_format(($predictions['yield']['next_harvest'] ?? 2847) * 0.85, 0) }} lbs

⏰ Harvest Timing

{{ $predictions['timing']['optimal_date'] ?? 'Jul 18' }}
Optimal Harvest Start
{{ $predictions['timing']['days_remaining'] ?? 23 }} days remaining
Peak Windows:
@foreach($predictions['timing']['peak_windows'] ?? [ ['variety' => 'Triple Crown', 'start' => 'Jul 18', 'end' => 'Aug 5'], ['variety' => 'Ouachita', 'start' => 'Jul 25', 'end' => 'Aug 12'], ['variety' => 'Navaho', 'start' => 'Aug 2', 'end' => 'Aug 18'] ] as $window)
{{ $window['variety'] }}: {{ $window['start'] }} - {{ $window['end'] }}
@endforeach
Labor Optimization:
  • Peak crew needed: {{ $predictions['timing']['peak_crew'] ?? 8 }} workers
  • Equipment prep: {{ $predictions['timing']['equipment_prep'] ?? '3 days before' }}
  • Processing capacity: {{ $predictions['timing']['processing'] ?? '95% utilized' }}

đŸŒŋ Plant Health Prediction

{{ $predictions['health']['at_risk_plants'] ?? 23 }}
Plants at Risk
{{ $predictions['health']['risk_trend'] ?? '-5 vs last week' }}
Risk Categories:
@foreach($predictions['health']['risk_breakdown'] ?? [ ['level' => 'High Risk', 'count' => 8, 'color' => 'var(--berry-red)'], ['level' => 'Medium Risk', 'count' => 15, 'color' => 'var(--warning)'], ['level' => 'Watch List', 'count' => 32, 'color' => 'var(--sky-blue)'] ] as $risk)
{{ $risk['level'] }}: {{ $risk['count'] }} plants
@endforeach
Predicted Issues:
  • Drought stress: {{ $predictions['health']['issues']['drought'] ?? '12 plants' }}
  • Nutrient deficiency: {{ $predictions['health']['issues']['nutrients'] ?? '6 plants' }}
  • Pest pressure: {{ $predictions['health']['issues']['pests'] ?? '5 plants' }}

💰 Price Forecasting

${{ number_format($predictions['pricing']['next_month'] ?? 5.25, 2) }}/lb
Predicted Price (30 days)
{{ $predictions['pricing']['trend'] ?? '+8.6%' }} vs current
Price Drivers:
  • Seasonal demand: {{ $predictions['pricing']['factors']['seasonal'] ?? 'Peak season approaching' }}
  • Supply forecast: {{ $predictions['pricing']['factors']['supply'] ?? 'Below average' }}
  • Weather impact: {{ $predictions['pricing']['factors']['weather'] ?? 'Drought concerns' }}
  • Market trends: {{ $predictions['pricing']['factors']['trends'] ?? 'Organic premium growing' }}
Next Week
${{ number_format(($predictions['pricing']['next_month'] ?? 5.25) * 0.95, 2) }}
Peak Season
${{ number_format(($predictions['pricing']['next_month'] ?? 5.25) * 1.15, 2) }}
End Season
${{ number_format(($predictions['pricing']['next_month'] ?? 5.25) * 0.80, 2) }}

📈 Growth Rate Prediction

{{ number_format($predictions['growth']['avg_monthly_rate'] ?? 3.4, 1) }}"
Avg Monthly Growth
{{ $predictions['growth']['season_projection'] ?? 'Above average' }}
Growth Predictions by Variety:
@foreach($predictions['growth']['by_variety'] ?? [ ['variety' => 'Triple Crown', 'rate' => 3.8, 'status' => 'Excellent'], ['variety' => 'Ouachita', 'rate' => 3.2, 'status' => 'Good'], ['variety' => 'Navaho', 'rate' => 2.9, 'status' => 'Average'] ] as $variety)
{{ $variety['variety'] }}: {{ $variety['rate'] }}" ({{ $variety['status'] }})
@endforeach
Growth Factors:
  • Soil conditions: {{ $predictions['growth']['factors']['soil'] ?? 'Optimal pH' }}
  • Water availability: {{ $predictions['growth']['factors']['water'] ?? 'Adequate' }}
  • Temperature: {{ $predictions['growth']['factors']['temperature'] ?? 'Ideal range' }}
  • Nutrition: {{ $predictions['growth']['factors']['nutrition'] ?? 'Well balanced' }}

💧 Resource Optimization

{{ number_format($predictions['resources']['efficiency_gain'] ?? 23.5, 1) }}%
Efficiency Improvement
With ML optimization
Optimization Recommendations:
  • Water: {{ $predictions['resources']['water'] ?? 'Reduce 15% in section B' }}
  • Fertilizer: {{ $predictions['resources']['fertilizer'] ?? 'Increase nitrogen in young plants' }}
  • Labor: {{ $predictions['resources']['labor'] ?? 'Focus on high-yield areas' }}
  • Timing: {{ $predictions['resources']['timing'] ?? 'Shift pruning to early morning' }}
Cost Savings
${{ number_format($predictions['resources']['cost_savings'] ?? 1247, 0) }}/month
Yield Boost
+{{ number_format($predictions['resources']['yield_boost'] ?? 8.3, 1) }}%

📊 Model Performance & Accuracy

@foreach($modelStatus['model_accuracy'] ?? [ ['name' => 'Yield Prediction', 'accuracy' => 91.3, 'trend' => '+2.1%'], ['name' => 'Health Scoring', 'accuracy' => 87.9, 'trend' => '+0.8%'], ['name' => 'Price Forecast', 'accuracy' => 82.4, 'trend' => '+3.2%'], ['name' => 'Growth Rate', 'accuracy' => 89.7, 'trend' => '+1.4%'], ['name' => 'Resource Opt', 'accuracy' => 85.1, 'trend' => '+2.7%'] ] as $model)
{{ $model['name'] }}
{{ $model['accuracy'] }}%
{{ $model['trend'] }} vs last month
@endforeach

đŸŽ¯ Model Training & Configuration

🔄 Training Status

Last Training: {{ $modelStatus['training']['last_run'] ?? '2024-01-15 14:30' }}
Next Scheduled: {{ $modelStatus['training']['next_run'] ?? '2024-01-20 02:00' }}
Training Data: {{ number_format($modelStatus['training']['data_points'] ?? 47329) }} records
Model Version: {{ $modelStatus['training']['version'] ?? 'v2.1.3' }}
Training Time: {{ $modelStatus['training']['duration'] ?? '24 minutes' }}
Status: {{ $modelStatus['training']['status'] ?? 'Ready' }}

âš™ī¸ Model Configuration

85%

âš ī¸ Prediction Insights & Alerts

@foreach($predictions['alerts'] ?? [ ['type' => 'warning', 'title' => 'Drought Stress Predicted', 'message' => 'ML model predicts 15 plants will experience drought stress in next 2 weeks', 'confidence' => 87, 'action' => 'Increase irrigation schedule'], ['type' => 'info', 'title' => 'Optimal Harvest Window', 'message' => 'Price and ripeness models suggest best harvest window: July 18-25', 'confidence' => 92, 'action' => 'Schedule harvest crew'], ['type' => 'success', 'title' => 'Resource Optimization', 'message' => 'ML suggests 23% efficiency gain with recommended resource adjustments', 'confidence' => 84, 'action' => 'Apply optimizations'] ] as $alert)
{{ $alert['type'] === 'warning' ? 'âš ī¸' : ($alert['type'] === 'info' ? 'â„šī¸' : '✅') }} {{ $alert['title'] }}
{{ $alert['confidence'] }}% confidence

{{ $alert['message'] }}

@endforeach
@endsection @push('scripts') @endpush