Closed ghost closed 4 years ago
Looks like you've got Joblib dump working now - what was the issue about?
Anyway, this particular exception is thrown, because you're training OneVsRestClassifier
with a non-probabilistic elementary classifier (LinearSVC
). If you switch to a probabilistic classifier (eg. DecisionTreeClassifier
, LogisticRegression
), then everything will work fine.
The fix here is to provide a more informative exception message.
Hi @vruusmann
OneVsRestClassifier
with LinearSVC
is the simplest example provided in scikit-learn. https://scikit-learn.org/stable/modules/multiclass.html#one-vs-the-rest Please check 1.12.2.1. Multiclass learning.
Btw, DecisionTreeClassifier
is not working on my end due to #146. If I can't successfully complete the simplest exercise like DecisionTreeClassifier
, training a decision tree classifier for the iris dataset. Then there's no point in trying OneVsRestClassifier
with DecisionTreeClassifier
.
OneVsRestClassifier with LinearSVC is the simplest example provided in scikit-learn.
Unfortunately, one cannot support everything. Aggregating over probabilistic classifiers is more relevant and interesting for real-life applications than aggregating over non-probabilistic ones.
Btw, DecisionTreeClassifier is not working on my end due to #146.
Interesting note. It suggests that perhaps the pickling error is related to CPython classes - DecisionTreeClassifier
contains CPython tree objects, whereas the OneVsRestClassifier + LinearSVC
doesn't contain any.
Anyway, given that SkLearn2PMML is not working for you, please consider switching to Nyoka.
@vruusmann Thank you for the help.
Hi @vruusmann ,
Thanks for your reminder of trying OneVsRestClassifier(DecisionTreeClassifier())
instead of OneVsRestClassifier(LinearSVC(random_state=0))
. In #146, my anaconda environment can do pmml export from DecisionTreeClassifier, so the OneVsRestClassifier pmml could be exported correctly.
Thank you.
Not sure if it's a non-fixable issue again.