MCPcopy
hub / github.com/hyperopt/hyperopt / main_plot_histogram

Function main_plot_histogram

hyperopt/plotting.py:65–86  ·  view source on GitHub ↗
(trials, do_show=True, title="Loss Histogram")

Source from the content-addressed store, hash-verified

63
64
65def main_plot_histogram(trials, do_show=True, title="Loss Histogram"):
66 # -- import here because file-level import is too early
67 import matplotlib.pyplot as plt
68
69 status_colors = default_status_colors
70 Xs, Ys, Ss, Cs = zip(
71 *[
72 (x, y, s, status_colors[s])
73 for (x, y, s) in zip(trials.specs, trials.losses(), trials.statuses())
74 if y is not None
75 ]
76 )
77
78 # XXX: deal with ok vs. un-finished vs. error trials
79 print("Showing Histogram of %i jobs" % len(Ys))
80 plt.hist(Ys)
81 plt.xlabel("loss")
82 plt.ylabel("frequency")
83
84 plt.title(title)
85 if do_show:
86 plt.show()
87
88
89def main_plot_vars(

Callers

nothing calls this directly

Calls 2

lossesMethod · 0.80
statusesMethod · 0.80

Tested by

no test coverage detected