title: 'PipelinedRDD' object has no attribute 'toDF' in PySpark
body: <p>I'm trying to load an SVM file and convert it to a <code>DataFrame</code> so I can use the ML module (<code>Pipeline</code> ML) from Spark.
  I've just installed a fresh Spark 1.5.0 on an Ubuntu 14.04 (no <code>spark-env.sh</code> configured).</p>
  
  <p>My <code>my_script.py</code> is:</p>
  
  <pre><code>from pyspark.mllib.util import MLUtils
  from pyspark import SparkContext
  
  sc = SparkContext("local", "Teste Original")
  data = MLUtils.loadLibSVMFile(sc, "/home/svm_capture").toDF()
  </code></pre>
  
  <p>and I'm running using:  <code>./spark-submit my_script.py</code></p>
  
  <p>And I get the error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/home/fred-spark/spark-1.5.0-bin-hadoop2.6/pipeline_teste_original.py", line 34, in &lt;module&gt;
  data = MLUtils.loadLibSVMFile(sc, "/home/fred-spark/svm_capture").toDF()
  AttributeError: 'PipelinedRDD' object has no attribute 'toDF'
  </code></pre>
  
  <p>What I can't understand is that if I run:</p>
  
  <pre><code>data = MLUtils.loadLibSVMFile(sc, "/home/svm_capture").toDF()
  </code></pre>
  
  <p>directly inside PySpark shell, it works.</p>