Python error in SVM classifier.predict ()

I am getting the following error when I classify new data with the following command in Python:

classifier.predict(new_data)

      

AttributeError: python object 'SVC' has no _dual_coef _ attribute

On my laptop, although the command works great! What's wrong?

+3


source to share


2 answers


I had this exact error AttributeError: python 'SVC' object has no attribute _dual_coef_

with a model trained using scikit-learn version 0.15.2 when I tried to run it in scikit-learn version 0.16.1. I solved this by retraining the model in the latest scikit-learn 0.16.1.



Make sure you download the correct version of the package.

+3


source


Have you downloaded the model from which you are trying to predict? In this case it may be a version conflict, try re-examining the model using the same version of sklearn. You can see a similar issue: Sklearn error: SVR object has no _impl attribute



+1


source







All Articles