pythonsvmpyml

Setting the SVM discriminant value in PyML


I'm using PyML's SVM to classify reads, but would like to set the discriminant to a higher value than the default (which I assume is 0). How do I do it?

Ps. I'm using a linear kernel with the liblinear-optimizer if that matters.


Solution

  • Roundabout way of doing it below:

    Use the result.getDecisionFunction() method and choose according to your own preference.

    Returns a list of values like:

    [-1.0000000000000213, -1.0000000000000053, -0.9999999999999893]

    Better answers still appreciated.