viirya commented on a change in pull request #20442: [SPARK-23265][ML]Update 
multi-column error handling logic in QuantileDiscretizer
URL: https://github.com/apache/spark/pull/20442#discussion_r321925219
 
 

 ##########
 File path: 
mllib/src/main/scala/org/apache/spark/ml/feature/QuantileDiscretizer.scala
 ##########
 @@ -171,25 +171,38 @@ final class QuantileDiscretizer @Since("1.6.0") 
(@Since("1.6.0") override val ui
   @Since("2.3.0")
   def setOutputCols(value: Array[String]): this.type = set(outputCols, value)
 
-  private[feature] def getInOutCols: (Array[String], Array[String]) = {
-    require((isSet(inputCol) && isSet(outputCol) && !isSet(inputCols) && 
!isSet(outputCols)) ||
-      (!isSet(inputCol) && !isSet(outputCol) && isSet(inputCols) && 
isSet(outputCols)),
-      "QuantileDiscretizer only supports setting either inputCol/outputCol or" 
+
-        "inputCols/outputCols."
-    )
+  @Since("1.6.0")
+  override def transformSchema(schema: StructType): StructType = {
+    ParamValidators.checkSingleVsMultiColumnParams(this, Seq(outputCol),
 
 Review comment:
   `checkSingleVsMultiColumnParams` can used like 
`ParamValidators.checkSingleVsMultiColumnParams(this, Seq(outputCol, splits), 
Seq(outputCols, splitsArray))`.
   
   If we want `numBuckets ` and `numBucketsArray` to be exclusively set, you 
can use `checkSingleVsMultiColumnParams` like that.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to