mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
Merge branch 'devel' of github.com:SheffieldML/GPy into ties
for new bug fix
This commit is contained in:
commit
c9f3d652b7
27 changed files with 930 additions and 296 deletions
|
|
@ -368,4 +368,13 @@ class Model(Parameterized):
|
|||
self.optimizer_array = x
|
||||
return ret
|
||||
|
||||
def __str__(self):
|
||||
model_details = [['Name', self.name],
|
||||
['Log-likelihood', '{}'.format(float(self.log_likelihood()))],
|
||||
["Number of Parameters", '{}'.format(self.size)]]
|
||||
from operator import itemgetter
|
||||
max_len = reduce(lambda a, b: max(len(b[0]), a), model_details, 0)
|
||||
to_print = [""] + ["{0:{l}} : {1}".format(name, detail, l=max_len) for name, detail in model_details] + ["Parameters:"]
|
||||
to_print.append(super(Model, self).__str__())
|
||||
return "\n".join(to_print)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue