File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ import org.apache.spark.mllib.regression.LabeledPoint
193
193
import org.apache.spark.mllib.util.MLUtils
194
194
import org.apache.spark.rdd.RDD
195
195
196
- val training : RDD[ LabeledPoint] = MLUtils.loadLibSVMFile(sc, "mllib/data/sample_libsvm_data.txt")
196
+ val examples : RDD[ LabeledPoint] = MLUtils.loadLibSVMFile(sc, "mllib/data/sample_libsvm_data.txt")
197
197
{% endhighlight %}
198
198
</div >
199
199
@@ -204,9 +204,21 @@ examples stored in LIBSVM format.
204
204
{% highlight java %}
205
205
import org.apache.spark.mllib.regression.LabeledPoint;
206
206
import org.apache.spark.mllib.util.MLUtils;
207
- import org.apache.spark.rdd.RDDimport;
207
+ import org.apache.spark.api.java.JavaRDD;
208
+
209
+ JavaRDD<LabeledPoint > examples =
210
+ MLUtils.loadLibSVMFile(jsc.sc(), "mllib/data/sample_libsvm_data.txt").toJavaRDD();
211
+ {% endhighlight %}
212
+ </div >
213
+
214
+ <div data-lang =" python " markdown =" 1 " >
215
+ [ ` MLUtils.loadLibSVMFile ` ] ( api/python/pyspark.mllib.util.MLUtils-class.html ) reads training
216
+ examples stored in LIBSVM format.
217
+
218
+ {% highlight python %}
219
+ from pyspark.mllib.util import MLUtils
208
220
209
- RDD< LabeledPoint > training = MLUtils.loadLibSVMFile(jsc , "mllib/data/sample_libsvm_data.txt");
221
+ examples = MLUtils.loadLibSVMFile(sc , "mllib/data/sample_libsvm_data.txt")
210
222
{% endhighlight %}
211
223
</div >
212
224
</div >
You can’t perform that action at this time.
0 commit comments