title: SPARK, ML, Tuning, CrossValidator: access the metrics
body: <p>In order to build a NaiveBayes multiclass classifier, I am using a CrossValidator to select the best parameters in my pipeline:</p>
  
  <pre><code>val cv = new CrossValidator()
          .setEstimator(pipeline)
          .setEstimatorParamMaps(paramGrid)
          .setEvaluator(new MulticlassClassificationEvaluator)
          .setNumFolds(10)
  
  val cvModel = cv.fit(trainingSet)
  </code></pre>
  
  <p>The pipeline contains usual transformers and estimators in the following order: Tokenizer, StopWordsRemover, HashingTF, IDF and finally the NaiveBayes.</p>
  
  <p>Is it possible to access the metrics calculated for best model?</p>
  
  <p>Ideally, I would like to access the metrics of all models to see how changing the parameters is changing the quality of the classification.
  But for the moment, the best model is good enough.</p>
  
  <p>FYI, I am using Spark 1.6.0</p>