aboutsummaryrefslogtreecommitdiff
path: root/mllib/src/test
diff options
context:
space:
mode:
authorJoseph K. Bradley <joseph@databricks.com>2015-05-12 16:42:30 -0700
committerXiangrui Meng <meng@databricks.com>2015-05-12 16:42:30 -0700
commit96c4846db89802f5a81dca5dcfa3f2a0f72b5cb8 (patch)
tree498bb4bda7cb35ecf99e5a81da52f32952af732a /mllib/src/test
parentf0c1bc3472a7422ae5649634f29c88e161f5ecaf (diff)
downloadspark-96c4846db89802f5a81dca5dcfa3f2a0f72b5cb8.tar.gz
spark-96c4846db89802f5a81dca5dcfa3f2a0f72b5cb8.tar.bz2
spark-96c4846db89802f5a81dca5dcfa3f2a0f72b5cb8.zip
[SPARK-7573] [ML] OneVsRest cleanups
Minor cleanups discussed with [~mengxr]: * move OneVsRest from reduction to classification sub-package * make model constructor private Some doc cleanups too CC: harsha2010 Could you please verify this looks OK? Thanks! Author: Joseph K. Bradley <joseph@databricks.com> Closes #6097 from jkbradley/onevsrest-cleanup and squashes the following commits: 4ecd48d [Joseph K. Bradley] org imports 430b065 [Joseph K. Bradley] moved OneVsRest from reduction subpackage to classification. small java doc style fixes 9f8b9b9 [Joseph K. Bradley] Small cleanups to OneVsRest. Made model constructor private to ml package.
Diffstat (limited to 'mllib/src/test')
-rw-r--r--mllib/src/test/java/org/apache/spark/ml/classification/JavaOneVsRestSuite.java (renamed from mllib/src/test/java/org/apache/spark/ml/reduction/JavaOneVsRestSuite.java)13
-rw-r--r--mllib/src/test/scala/org/apache/spark/ml/classification/OneVsRestSuite.scala (renamed from mllib/src/test/scala/org/apache/spark/ml/reduction/OneVsRestSuite.scala)9
2 files changed, 8 insertions, 14 deletions
diff --git a/mllib/src/test/java/org/apache/spark/ml/reduction/JavaOneVsRestSuite.java b/mllib/src/test/java/org/apache/spark/ml/classification/JavaOneVsRestSuite.java
index 40a90ae9de..a1ee554152 100644
--- a/mllib/src/test/java/org/apache/spark/ml/reduction/JavaOneVsRestSuite.java
+++ b/mllib/src/test/java/org/apache/spark/ml/classification/JavaOneVsRestSuite.java
@@ -15,21 +15,20 @@
* limitations under the License.
*/
-package org.apache.spark.ml.reduction;
+package org.apache.spark.ml.classification;
import java.io.Serializable;
import java.util.List;
+import static scala.collection.JavaConversions.seqAsJavaList;
+
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import static scala.collection.JavaConversions.seqAsJavaList;
-
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
-import org.apache.spark.ml.classification.LogisticRegression;
import static org.apache.spark.mllib.classification.LogisticRegressionSuite.generateMultinomialLogisticInput;
import org.apache.spark.mllib.regression.LabeledPoint;
import org.apache.spark.sql.DataFrame;
@@ -48,10 +47,8 @@ public class JavaOneVsRestSuite implements Serializable {
jsql = new SQLContext(jsc);
int nPoints = 3;
- /**
- * The following weights and xMean/xVariance are computed from iris dataset with lambda = 0.2.
- * As a result, we are actually drawing samples from probability distribution of built model.
- */
+ // The following weights and xMean/xVariance are computed from iris dataset with lambda=0.2.
+ // As a result, we are drawing samples from probability distribution of an actual model.
double[] weights = {
-0.57997, 0.912083, -0.371077, -0.819866, 2.688191,
-0.16624, -0.84355, -0.048509, -0.301789, 4.170682 };
diff --git a/mllib/src/test/scala/org/apache/spark/ml/reduction/OneVsRestSuite.scala b/mllib/src/test/scala/org/apache/spark/ml/classification/OneVsRestSuite.scala
index ebec7c68e8..e65ffae918 100644
--- a/mllib/src/test/scala/org/apache/spark/ml/reduction/OneVsRestSuite.scala
+++ b/mllib/src/test/scala/org/apache/spark/ml/classification/OneVsRestSuite.scala
@@ -15,12 +15,11 @@
* limitations under the License.
*/
-package org.apache.spark.ml.reduction
+package org.apache.spark.ml.classification
import org.scalatest.FunSuite
import org.apache.spark.ml.attribute.NominalAttribute
-import org.apache.spark.ml.classification.{LogisticRegressionModel, LogisticRegression}
import org.apache.spark.ml.util.MetadataUtils
import org.apache.spark.mllib.classification.LogisticRegressionSuite._
import org.apache.spark.mllib.classification.LogisticRegressionWithLBFGS
@@ -42,10 +41,8 @@ class OneVsRestSuite extends FunSuite with MLlibTestSparkContext {
sqlContext = new SQLContext(sc)
val nPoints = 1000
- /**
- * The following weights and xMean/xVariance are computed from iris dataset with lambda = 0.2.
- * As a result, we are actually drawing samples from probability distribution of built model.
- */
+ // The following weights and xMean/xVariance are computed from iris dataset with lambda=0.2.
+ // As a result, we are drawing samples from probability distribution of an actual model.
val weights = Array(
-0.57997, 0.912083, -0.371077, -0.819866, 2.688191,
-0.16624, -0.84355, -0.048509, -0.301789, 4.170682)