Much more optimized bubble tree
[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
21
<?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 = mysql_query($query);
if (!$result) echo mysql_error().$query;
while ($r = mysql_fetch_array($result, MYSQL_BOTH)) {
    $series[$r["heuristic_name"]][$r["val"]] = $r[2];
}
 
?>