You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by viirya <gi...@git.apache.org> on 2018/01/04 04:23:10 UTC
[GitHub] spark pull request #19993: [SPARK-22799][ML] Bucketizer should throw excepti...
Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/19993#discussion_r159579102
--- Diff: mllib/src/main/scala/org/apache/spark/ml/param/params.scala ---
@@ -249,6 +250,27 @@ object ParamValidators {
def arrayLengthGt[T](lowerBound: Double): Array[T] => Boolean = { (value: Array[T]) =>
value.length > lowerBound
}
+
+ /**
+ * Checks that either inputCols and outputCols are set or inputCol and outputCol are set. If
+ * this is not true, an `IllegalArgumentException` is raised.
+ * @param model
+ */
+ private[spark] def checkMultiColumnParams(model: Params): Unit = {
+ model match {
+ case m: HasInputCols with HasInputCol if m.isSet(m.inputCols) && m.isSet(m.inputCol) =>
+ raiseIncompatibleParamsException("inputCols", "inputCol")
+ case m: HasOutputCols with HasOutputCol if m.isSet(m.outputCols) && m.isSet(m.outputCol) =>
+ raiseIncompatibleParamsException("outputCols", "outputCol")
+ case _ =>
+ }
--- End diff --
I added this method too in #20146.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org