spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject spark git commit: [SPARK-9118] [ML] Implement IntArrayParam in mllib
Date Sat, 18 Jul 2015 03:02:09 GMT
Repository: spark
Updated Branches:
  refs/heads/master 34a889db8 -> 101790820


[SPARK-9118] [ML] Implement IntArrayParam in mllib

Implement IntArrayParam in mllib

Author: Rekha Joshi <rekhajoshm@gmail.com>
Author: Joshi <rekhajoshm@gmail.com>

Closes #7481 from rekhajoshm/SPARK-9118 and squashes the following commits:

d3b1766 [Joshi] Implement IntArrayParam
0be142d [Rekha Joshi] Merge pull request #3 from apache/master
106fd8e [Rekha Joshi] Merge pull request #2 from apache/master
e3677c9 [Rekha Joshi] Merge pull request #1 from apache/master


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/10179082
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/10179082
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/10179082

Branch: refs/heads/master
Commit: 1017908205b7690dc0b0ed4753b36fab5641f7ac
Parents: 34a889d
Author: Rekha Joshi <rekhajoshm@gmail.com>
Authored: Fri Jul 17 20:02:05 2015 -0700
Committer: Xiangrui Meng <meng@databricks.com>
Committed: Fri Jul 17 20:02:05 2015 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/ml/param/params.scala    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/10179082/mllib/src/main/scala/org/apache/spark/ml/param/params.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/ml/param/params.scala b/mllib/src/main/scala/org/apache/spark/ml/param/params.scala
index d034d7e..824efa5 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/param/params.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/param/params.scala
@@ -296,6 +296,22 @@ class DoubleArrayParam(parent: Params, name: String, doc: String, isValid:
Array
 }
 
 /**
+ * :: DeveloperApi ::
+ * Specialized version of [[Param[Array[Int]]]] for Java.
+ */
+@DeveloperApi
+class IntArrayParam(parent: Params, name: String, doc: String, isValid: Array[Int] =>
Boolean)
+  extends Param[Array[Int]](parent, name, doc, isValid) {
+
+  def this(parent: Params, name: String, doc: String) =
+    this(parent, name, doc, ParamValidators.alwaysTrue)
+
+  /** Creates a param pair with a [[java.util.List]] of values (for Java and Python). */
+  def w(value: java.util.List[java.lang.Integer]): ParamPair[Array[Int]] =
+    w(value.asScala.map(_.asInstanceOf[Int]).toArray)
+}
+
+/**
  * :: Experimental ::
  * A param and its value.
  */


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message