Open AbeerAldayel opened 6 years ago
This problem is specific to SVC classifier you're using; it is based on libsvm, and it uses OvO approach instead of OvR in multi-class case, which is more tricky to show, so it was not implemented in https://github.com/TeamHG-Memex/eli5/pull/221. You can probably replace SVC(kernel='linear') with sklearn.linear_model.LinearSVC
, which should be supported, and should work much faster.
@AbeerAldayel Can you give me the head of the data ?? This can occur when it takes features one by one and after converting it into Vectorizer it becomes difficult to match with other features.If an entire feature DataFrame is passed, it easily converts into Vector for each feature and fit for SVC
I have the following scikit -learn pipeline using SVCfor multi-classification. When I used
I got an error referring to features numbers. Is there a way to interpret scikit-learn pipeline with multiple features?
Below the way I used to access the features :
The exact error I got is:
Also when I pass union features as list combination and use
display(eli5.show_weights(model.named_steps['clf'], feature_names=features, target_names=ppl.classes_,top=15))
I got this errorError: only binary libsvm-based classifiers are supported