You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to export a linear SVM to PMML. The code works, but the model is stored using the support vectors. The outcome of the model when applied returns a 0 or 1. This latter is ofcourse expected behavior from an SVM. However for local explainability I would like to have the coefficients (or weights) of the model as well and also be able to compute the "score" instead of the predicted class.
I can't seem to figure out if it is at all possible to export the Linear SVM using the coefficients representation instead of the support vector representation. Some of my code is shown below to illustrate what I'm doing right now. I have also tried using the svm.LinearSVC but it results in the same PMML format.
I am trying to export a linear SVM to PMML. The code works, but the model is stored using the support vectors. The outcome of the model when applied returns a 0 or 1. This latter is ofcourse expected behavior from an SVM. However for local explainability I would like to have the coefficients (or weights) of the model as well and also be able to compute the "score" instead of the predicted class.
I can't seem to figure out if it is at all possible to export the Linear SVM using the coefficients representation instead of the support vector representation. Some of my code is shown below to illustrate what I'm doing right now. I have also tried using the svm.LinearSVC but it results in the same PMML format.
This then creates multiple estimators, and I can select the best one
And for example get the predicted scores if I want (not probabilities)
I then turn it into a PMML pipeline:
And export it to PMML:
Although the export works and the model can be loaded and used from it. It doesn't contain the coefficients that match the hyperplane.
A small snippet from the PMML to show what I mean:
which goes on for a while with other support vectors.
similar here.
and then we get "coefficients", which seem to be the "scores" of the support vectors.
As you can see, not the coefficients/weights that I am looking for.
The text was updated successfully, but these errors were encountered: