More value heuristics
[contractdashboard.git] / heuristics / viewHeuristicsDistribution.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php    
 
/*// most interesting
SELECT sum(heuristic_value) as sum, CNID
FROM heuristic_results group by CNID order by sum DESC limit 30
 
// spread of values
select floor(sum) as val,count(*) from (SELECT sum(heuristic_value) 
as sum FROM heuristic_results group by CNID) as a group by val*/
 
$series = Array();
 
  include_once("../lib/common.inc.php");
$query = "select heuristic_name, floor(heuristic_value) as val,count(*) from heuristic_results group by heuristic_name, val";
    $result = $conn->query($query);
foreach ($result->fetchAll() as $r) {
    $series[$r["heuristic_name"]][$r["val"]] = $r[2];
}
 
?>