title: SVM, scikit-learn: Decision values with RBF kernel
body: <p>I have read somewhere that it's not possible interpret SVM decision values on non-linear kernels, so only the sign matters. However, I saw couple of articles putting a threshold on decision values (with SVMlight though) [1] [2]. So i'm not sure whether putting thresholds on decision values logical as well but i'm curious on the results anyways.</p>
  
  <p>So, LibSVM python interface directly returns the decision values with predicted target when you call predict(), is there any way to do it with scikit-learn? I have trained a binary classification SVM model using svm.SVC(), but got stuck there right now.</p>
  
  <p>In source codes i have found svm.libsvm.decision_function() function commented as "(libsvm name for this is predict_values)". Then i have seen the svm.SVC.decision_function() and checked its source code:</p>
  
  <pre><code>    dec_func = libsvm.decision_function(
          X, self.support_, self.support_vectors_, self.n_support_,
          self.dual_coef_, self._intercept_, self._label,
          self.probA_, self.probB_,
          svm_type=LIBSVM_IMPL.index(self._impl),
          kernel=kernel, degree=self.degree, cache_size=self.cache_size,
          coef0=self.coef0, gamma=self._gamma)
  
      # In binary case, we need to flip the sign of coef, intercept and
      # decision function.
      if self._impl in ['c_svc', 'nu_svc'] and len(self.classes_) == 2:
          return -dec_func
  </code></pre>
  
  <p>It seems like it's doing the libsvm's predict equivalent, but why does it changes the sign of decision values, if it's the equivalent of ? </p>
  
  <p>Also, is there any way to calculate confidence value for an SVM decision using this value or any prediction output (except probability estimates and Platt's method, my model is not good when probability estimates are calculated)? Or as it has been argued, the only sign matters for decision value in non-linear kernels?</p>
  
  <p>[1] <a href="http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0039195#pone.0039195-Teng1" rel="nofollow">http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0039195#pone.0039195-Teng1</a></p>
  
  <p>[2] <a href="http://link.springer.com/article/10.1007%2Fs00726-011-1100-2" rel="nofollow">http://link.springer.com/article/10.1007%2Fs00726-011-1100-2</a></p>