title: Save ML model for future usage
body: <p>I was applying some Machine Learning algorithms like Linear Regression, Logistic Regression, and Naive Bayes to some data, but I was trying to avoid using RDDs and start using DataFrames because the <a href="https://ogirardot.wordpress.com/2015/05/29/rdds-are-the-new-bytecode-of-apache-spark/">RDDs are slower</a> than Dataframes under pyspark  (see pic 1).</p>
  
  <p><img src="https://ogirardot.files.wordpress.com/2015/05/unified-physical-execution.png"></p>
  
  <p>The other reason why I am using DataFrames is because the ml library has a class very useful to tune models which is <a href="http://spark.apache.org/docs/latest/api/python/pyspark.ml.html?highlight=crossvalidator#pyspark.ml.tuning.CrossValidator">CrossValidator</a> this class returns a model after fitting it, obviously this method has to test several scenarios, and after that returns a <a href="http://spark.apache.org/docs/latest/api/python/pyspark.ml.html?highlight=model#pyspark.ml.Model">fitted model</a> (with the best combinations of parameters).</p>
  
  <p>The cluster I use isn't so large and the data is pretty big and some fitting take hours so I want to save this models to reuse them later, but I haven't realized how, is there something I am ignoring?</p>
  
  <p>Notes:</p>
  
  <ul>
  <li>The mllib's model classes have a save method (i.e. <a href="http://spark.apache.org/docs/latest/api/python/pyspark.mllib.html?highlight=mllib#pyspark.mllib.classification.NaiveBayesModel.save">NaiveBayes</a>), but mllib does not have CrossValidator and use RDDs so I am avoiding it premeditatedly.</li>
  <li>The current version is spark 1.5.1. </li>
  </ul>