@extends('user.layout') @section('title','Probabilitas') @section('content')
@if (auth()->user()->level==1) Hitung Reset @endif
Probabilitas Label Kelas
Atribut Nilai Probabilitas
{{$hasil[true]}} {{$kelas['true']}}
{{$hasil[false]}} {{$kelas['false']}}
Total {{$kelas['false'] + $kelas['true']}}
Probabilitas Atribut Diskrit
@foreach ($attribs['atribut'] as $attr) @php $true = $false= $semua = 0.00000; $tot = ['true'=>0,'false' => 0]; $list=['true'=>[],'false'=>[],'all'=>[]]; $probab = $data->where('atribut_id', $attr->id)->first(); if($probab){ $probabs=[ 'true'=>json_decode($probab->true), 'false'=>json_decode($probab->false), 'total'=>json_decode($probab->total) ]; } @endphp
@if($attr->type==='categorical') @forelse($data->where('atribut_id', $attr->id) as $prob) @php $probs=[ 'true'=>json_decode($prob->true), 'false'=>json_decode($prob->false), 'total'=>json_decode($prob->total) ]; $true+=$probs['true']; $false+=$probs['false']; $semua+=$probs['total']; @endphp @empty @foreach($attribs['nilai']->where('atribut_id', $attr->id) as $nilai) @endforeach @endforelse @else @foreach($training as $tr) @php if(empty($tr[$attr->slug])) continue; array_push($list['all'],$tr[$attr->slug]); if($tr['status']){ array_push($list['true'],$tr[$attr->slug]); $tot['true']+=$tr[$attr->slug]; }else{ array_push($list['false'],$tr[$attr->slug]); $tot['false']+=$tr[$attr->slug]; } @endphp @endforeach @endif
{{ $attr->name }}
Sub Atribut {{$hasil[true]}} {{$hasil[false]}} Total Probabilitas
{{ $prob->nilai_atribut->name }} {{ $probs['true'] }} {{ $probs['false'] }} {{ $probs['total'] }}
{{ $nilai->name }} 0 0 0
Total {{ $true }} {{ $false }} {{$semua}}
Data {{implode(', ',$list['true'])}} {{implode(', ',$list['false'])}} {{implode(', ',$list['all'])}}
Jumlah {{ $tot["true"] }} {{ $tot['false'] }} {{ $tot['true'] + $tot['false'] }}
Rata-rata {{ $probabs['true']->mean ?? 0 }} {{ $probabs['false']->mean ?? 0 }} {{ $probabs['total']->mean ?? 0 }}
Simpangan Baku {{ $probabs['true']->sd ?? 0 }} {{ $probabs['false']->sd ?? 0 }} {{ $probabs['total']->sd ?? 0 }}
@endforeach
@csrf @method('DELETE')
@endsection