mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-10 12:32:40 +02:00
fixing qualtile code for some likelhoods
This commit is contained in:
parent
2af47f1d31
commit
9780fb48de
2 changed files with 14 additions and 3 deletions
|
|
@ -232,6 +232,17 @@ class Bernoulli(Likelihood):
|
|||
np.seterr(**state)
|
||||
return d3logpdf_dlink3
|
||||
|
||||
def predictive_quantiles(self, mu, var, quantiles, Y_metadata=None):
|
||||
"""
|
||||
Get the "quantiles" of the binary labels (Bernoulli draws). all the
|
||||
quantiles must be either 0 or 1, since those are the only values the
|
||||
draw can take!
|
||||
"""
|
||||
p = self.predictive_mean(mu, var)
|
||||
return [np.asarray(p>(q/100.), dtype=np.int32) for q in quantiles]
|
||||
|
||||
|
||||
|
||||
def samples(self, gp, Y_metadata=None):
|
||||
"""
|
||||
Returns a set of samples of observations based on a given value of the latent variable.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue