Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't use predict_proba() no relevance_ attribute #11

Open
Blair-Young opened this issue Dec 13, 2016 · 7 comments
Open

can't use predict_proba() no relevance_ attribute #11

Blair-Young opened this issue Dec 13, 2016 · 7 comments

Comments

@Blair-Young
Copy link

clf = RVC()
clf.fit(iris.data, iris.target)
clf.predict_proba(iris.data[0])

AttributeError                            Traceback (most recent call last)
<ipython-input-100-dc59cdb5fb6b> in <module>()
----> 1 clf.predict_proba(iris.data[0])

//anaconda/lib/python2.7/site-packages/skrvm/rvm.pyc in predict_proba(self, X)
    286     def predict_proba(self, X):
    287         """Return an array of class probabilities."""
--> 288         phi = self._apply_kernel(X, self.relevance_)
    289         y = self._classify(self.m_, phi)
    290         return np.column_stack((1-y, y))

AttributeError: 'RVC' object has no attribute 'relevance_'
@Blair-Young
Copy link
Author

Hey, just wondering if this has been fixed yet? thanks

@guigzzz
Copy link

guigzzz commented Apr 19, 2017

Hey James, I've been having the same issue as Blair, any updates on this?

@Sandy4321
Copy link

it would great to fix it

@zoushucai
Copy link

I also ran an error. Can you fix it?

@poopanda
Copy link

poopanda commented Dec 2, 2019

I also encountered the same problem, can James fix it,?thanks very much
phi = self.apply_kernel(X, self.relevance)
AttributeError: 'RVC' object has no attribute 'relevance_'

@Sandy4321
Copy link

Pls fixed it

@hectormara
Copy link

hectormara commented Jan 14, 2025

Still unfixed. I do not understand the error since the function 'predict' creates self.relevance_
` def fit(self, X, y):

"""Fit the RVR to the training data."""
X, y = check_X_y(X, y)

    n_samples, n_features = X.shape

    self.phi = self._apply_kernel(X, X)

    n_basis_functions = self.phi.shape[1]

    self.relevance_ = X

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants