[BETA] prediction"; $date=array(date("Y"),date("n"),date("j")); $diffuse=0; $selectionStart=mktime(0,0,0,$date[1],$date[2],$date[0]); $selectionEnd=$selectionStart+(60*60*(24+date("I",$selectionStart))); $rangeSelector=array('time',$selectionStart-$diffuse,$selectionEnd+$diffuse); $data= $db->selectRange('temp2','*',$rangeSelector); foreach($data as $record){ $tupel=$record; } $data=null; $month=date('n', $tupel['time']); $year=date('Y', $tupel['time']); $day=date('j', $tupel['time']); #$div=getdiv('temp'); $div=1; for($i=1; $i<=$day;$i++){ $selectionStart=mktime(0,0,0,$month,$i,$year); $selectionEnd=$selectionStart+(60*60*(24+date("I",$selectionStart))); $rangeSelector=array('time',$selectionStart-$diffuse,$selectionEnd+$diffuse); $data= $db->selectRange('temp2','*',$rangeSelector); $sumary[]=prepareData($data,$div,$selectionStart,$selectionEnd); } $gl=new Grouplens(); $div=getdiv('temp'); echo "prediction for ".date("d.m.Y"); echo "
| hour | prediction | difference | actual measurement |
|---|---|---|---|
| ".$i." | ".$r." | ".round($r-$a,2)." | ".$a." |