Skip to content

Commit

Permalink
Minor doc example fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
staple committed Sep 25, 2014
1 parent c3f2a85 commit 3b6c511
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/mllib-linear-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ public class LinearRegression {
}
}
);
JavaRDD<Object> MSE = new JavaDoubleRDD(valuesAndPreds.map(
double MSE = new JavaDoubleRDD(valuesAndPreds.map(
new Function<Tuple2<Double, Double>, Object>() {
public Object call(Tuple2<Double, Double> pair) {
return Math.pow(pair._1() - pair._2(), 2.0);
Expand Down Expand Up @@ -553,8 +553,8 @@ but in practice you will likely want to use unlabeled vectors for test data.

{% highlight scala %}

val trainingData = ssc.textFileStream('/training/data/dir').map(LabeledPoint.parse)
val testData = ssc.textFileStream('/testing/data/dir').map(LabeledPoint.parse)
val trainingData = ssc.textFileStream("/training/data/dir").map(LabeledPoint.parse)
val testData = ssc.textFileStream("/testing/data/dir").map(LabeledPoint.parse)

{% endhighlight %}

Expand Down
1 change: 1 addition & 0 deletions docs/mllib-optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ import org.apache.spark.mllib.evaluation.BinaryClassificationMetrics
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.util.MLUtils
import org.apache.spark.mllib.classification.LogisticRegressionModel
import org.apache.spark.mllib.optimization.{LBFGS, LogisticGradient, SquaredL2Updater}

val data = MLUtils.loadLibSVMFile(sc, "data/mllib/sample_libsvm_data.txt")
val numFeatures = data.take(1)(0).features.size
Expand Down

0 comments on commit 3b6c511

Please sign in to comment.