@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
{{ $attr->name }}
Sub Atribut |
{{$hasil[true]}} |
{{$hasil[false]}} |
Total Probabilitas |
@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
{{ $prob->nilai_atribut->name }} |
{{ $probs['true'] }} |
{{ $probs['false'] }} |
{{ $probs['total'] }} |
@empty
@foreach($attribs['nilai']->where('atribut_id', $attr->id) as $nilai)
{{ $nilai->name }} |
0 |
0 |
0 |
@endforeach
@endforelse
Total |
{{ $true }} |
{{ $false }} |
{{$semua}} |
@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
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 }} |
@endif
@endforeach