mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-05 14:55:15 +02:00
Re-definition of the week
This commit is contained in:
parent
f5a5d4b25e
commit
8d98652e8b
1 changed files with 5 additions and 4 deletions
|
|
@ -387,13 +387,14 @@ class Likelihood(Parameterized):
|
|||
|
||||
return pred_mean, pred_var
|
||||
|
||||
def predictive_quantiles(self, mu, var, quantiles, Y_metadata):
|
||||
def predictive_quantiles(self, mu, var, quantiles, Y_metadata=None):
|
||||
#compute the quantiles by sampling!!!
|
||||
N_samp = 1000
|
||||
s = np.random.randn(mu.shape[0], N_samp)*np.sqrt(var) + mu
|
||||
ss_f = s.flatten()
|
||||
ss_y = self.samples(ss_f)
|
||||
ss_y = ss_y.reshape(mu.shape[0], N_samp)
|
||||
#ss_f = s.flatten()
|
||||
#ss_y = self.samples(ss_f, Y_metadata)
|
||||
ss_y = self.samples(s, Y_metadata)
|
||||
#ss_y = ss_y.reshape(mu.shape[0], N_samp)
|
||||
|
||||
return [np.percentile(ss_y ,q, axis=1)[:,None] for q in quantiles]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue