title: SparkMLlib MultiClassMetrics.confusionMatrix() and precision() seems giving contradictory results
body: <p>I am new to machine learning and Spark MLlib. I have created RandomForest classifier model using <code>RandomForest.trainClassifier()</code> My training data set is mostly categorical in nature and have response/target variables as Actionable/NoActionable.</p>
  <p>I have created <code>predictionAndLables</code> <code>RDD</code> using test data and <code>model.predict()</code> Now I am trying the following to validate my model accuracy.</p>
  <pre><code>MultiClassMetrics metrics = new MultiClassMetrics(predictionAndLables.rdd())
  System.out.println(metrics.precision()); //prints 0.94334140435
  System.out.println(metrics.confusionMatrix()); //prints like the following
  
  1948.0     0.0
  117.0      0.0
  </code></pre>
  <p>Now if you see model accuracy printed using <code>precision()</code> method seems really good around <code>94%</code> but if you see above confusion matrix something seems wrong I have <code>1948</code> NonActionable target variables and <code>117</code> Actionable target variable in test data set.</p>
  <p>So according to confusion matrix it could predict NonActionable correctly and could not predict at all Actionable variables. I am trying to understand the confusion matrix and why precision is <code>94%</code>. So results look contradicting.</p>