diff --git a/GPy/core/model.py b/GPy/core/model.py
index dc0a9f5e..8da52358 100644
--- a/GPy/core/model.py
+++ b/GPy/core/model.py
@@ -381,6 +381,16 @@ class Model(Parameterized):
self.optimizer_array = x
return ret
+ def _repr_html_(self):
+ """Representation of the model in html for notebook display."""
+ model_details = [['Model', self.name + '
'],
+ ['Log-likelihood', '{}
'.format(float(self.log_likelihood()))],
+ ["Number of Parameters", '{}
'.format(self.size)]]
+ from operator import itemgetter
+ to_print = [""] + ["{}: {}".format(name, detail) for name, detail in model_details] + ["
Parameters:"]
+ to_print.append(super(Model, self)._repr_html_())
+ return "\n".join(to_print)
+
def __str__(self):
model_details = [['Name', self.name],
['Log-likelihood', '{}'.format(float(self.log_likelihood()))],
diff --git a/GPy/core/parameterization/param.py b/GPy/core/parameterization/param.py
index cb9b0cfe..d205c9e4 100644
--- a/GPy/core/parameterization/param.py
+++ b/GPy/core/parameterization/param.py
@@ -249,6 +249,29 @@ class Param(Parameterizable, ObsAr):
if ind.size > 4: indstr = ','.join(map(str, ind[:2])) + "..." + ','.join(map(str, ind[-2:]))
else: indstr = ','.join(map(str, ind))
return name + '[' + indstr + ']'
+
+ def _repr_html_(self, constr_matrix=None, indices=None, prirs=None, ties=None):
+ """Representation of the parameter in html for notebook display."""
+ filter_ = self._current_slice_
+ vals = self.flat
+ if indices is None: indices = self._indices(filter_)
+ ravi = self._raveled_index(filter_)
+ if constr_matrix is None: constr_matrix = self.constraints.properties_for(ravi)
+ if prirs is None: prirs = self.priors.properties_for(ravi)
+ if ties is None: ties = self._ties_for(ravi)
+ ties = [' '.join(map(lambda x: x, t)) for t in ties]
+ header_format = """
+
| {i} | {x} | {c} | {p} | {t} |