Skip to content

Commit

Permalink
Making the web interface display some more useful stats
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperSnoek committed Oct 15, 2013
1 parent ea88780 commit 89926f5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions spearmint/spearmint/chooser/GPEIOptChooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,22 @@ def generate_stats_html(self):
if not self._read_only():
return 'Chooser not yet ready to display output'

mean_ls = np.mean(np.vstack([h[3][np.newaxis,:] for h in self.hyper_samples]),0)
mean_mean = np.mean(np.vstack([h[0] for h in self.hyper_samples]))
mean_noise = np.mean(np.vstack([h[1] for h in self.hyper_samples]))
mean_ls = np.mean(np.vstack([h[3][np.newaxis,:] for h in self.hyper_samples]),0)

try:
output = (
'<span class=\"label label-info\">Inverse parameter sensitivity' +
'<br /><span class=\"label label-info\">Estimated mean:</span> ' + str(mean_mean) +
'<br /><span class=\"label label-info\">Estimated noise:</span> ' + str(mean_noise) +
'<br /><br /><span class=\"label label-info\">Inverse parameter sensitivity' +
' - Gaussian Process length scales</span><br /><br />' +
'<div id=\"lschart\"></div><script type=\"text/javascript\">' +
'var data = [' + ','.join(['%.2f' % i for i in mean_ls]) + '];')
'var lsdata = [' + ','.join(['%.2f' % i for i in mean_ls]) + '];')
except:
return 'Chooser not yet ready to display output.'

output += ('bar_chart("#lschart", data, ' + str(self.max_ls) + ');' +
output += ('bar_chart("#lschart", lsdata, ' + str(self.max_ls) + ');' +
'</script>')
return output

Expand Down

0 comments on commit 89926f5

Please sign in to comment.