title: Calculate probability MLLIB SVM multi-class
body: <p>I would like to know how to calculate the probability using Spark MLLIB SVM in a multi-class classification problem.
  The documentation shows there is no such function available.
  <a href="https://stackoverflow.com/questions/7802556/regarding-probability-estimates-predicted-by-libsvm">LibSVM</a> uses <a href="http://en.wikipedia.org/wiki/Platt_scaling" rel="nofollow noreferrer">Platt-scaling</a>.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Is there a function to calculate the probability somewhere? </li>
  <li>If not, who can help me implementing such functionality?</li>
  </ol>
  
  <p>I would simply take the average distances from all the support vectors for each category after training and compare the distance from a new data-point to hyperplanes from all the classifiers.
  I think the <a href="https://spark.apache.org/docs/latest/api/java/org/apache/spark/mllib/classification/ClassificationModel.html#predict%28org.apache.spark.api.java.JavaRDD%29" rel="nofollow noreferrer">SVMModel.predict()</a> gives these distances, but I am uncertain.</p>