-
Notifications
You must be signed in to change notification settings - Fork 331
Open
Description
Hi
Thx for this great package
It looks like there is an error when you use OneVsRestClassifier with SVCClassifier
I have this error
if clf.kernel != 'linear':
AttributeError: 'OneVsRestClassifier' object has no attribute 'kernel'
Here is the little code snippet to reproduce the issue:
from sklearn.datasets import make_multilabel_classification, fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.multiclass import OneVsRestClassifier
from sklearn.svm import SVC
data_train = fetch_20newsgroups(subset='train', shuffle=True, random_state=42)
vectorizer = TfidfVectorizer(stop_words='english')
X_train = vectorizer.fit_transform(data_train.data[0:100])
y_train = data_train.target[0:100]
classif = OneVsRestClassifier(SVC(kernel='linear'))
classif.fit(X_train, y_train)
expl = eli5.explain_prediction(classif, data_train.data[0], vec=vectorizer)
Thx a lot again
Olivier
Metadata
Metadata
Assignees
Labels
No labels