Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19993#discussion_r161699705
--- 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 --
@MLnick @viirya in order to address
https://github.com/apache/spark/pull/19993/files#r161682506, I was thinking to
let this method as it is (just renaming it as per @viirya suggestion) and only
adding an `additionalExclusiveParams: (String, String)*` argument to the
function. WDYT?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]