sklearn-bayes icon indicating copy to clipboard operation
sklearn-bayes copied to clipboard

Bug in RVC

Open jonathf opened this issue 8 years ago • 0 comments

So I've been experimenting with you code for a project I am working with. Great work on the implementation. It is much appreciated that you have taken the time to make this.

I might be using it wrong, but I think I found a bug in your code. Take a look at the following simple example:

>>> import skbayes.rvm_ard_models
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> 
>>> rvm = skbayes.rvm_ard_models.RVC()
>>> rvm.fit([[-1], [1]], [0, 1])
RVC(coef0=1, degree=2, fit_intercept=True, gamma=None, kernel='rbf',
  kernel_params=None, n_iter=300, n_iter_solver=30, solver='lbfgs_b',
  tol=0.0001, tol_solver=1e-05, verbose=False)
>>>
>>> x = np.linspace(-5, 5, 200).reshape(200, 1)
>>> y = rvm.predict_proba(x)[:,0]
>>> plt.plot(y)
>>> plt.savefig("out.pdf")

The figure produced: out.pdf

It looks like the aposteriori estimate only includes the [1] and not the [-1].

jonathf avatar Jun 15 '16 12:06 jonathf