zero323 commented on a change in pull request #26247: [SPARK-29566][ML] Imputer
should support single-column input/output
URL: https://github.com/apache/spark/pull/26247#discussion_r366085496
##########
File path: mllib/src/main/scala/org/apache/spark/ml/feature/Imputer.scala
##########
@@ -205,6 +227,14 @@ class ImputerModel private[ml] (
import ImputerModel._
+ /** @group setParam */
+ @Since("3.0.0")
+ def setInputCol(value: String): this.type = set(inputCol, value)
Review comment:
What is the intended purpose of this method?
As it is implemented right now, it doesn't seem to have any practical
applications:
- If model has been created with single col, surrogate will contain only a
single column, so there is nothing to set here.
- If model has been created with multiple cols, `setInputCol` /
`setOutputCol` should clear `setInputCols` and `setOutputCols`, otherwise it
will fail to validate. I guess something like this:
@Since("3.0.0")
def setInputCol(value: String): this.type = {
clear(inputCols)
clear(outputCols)
set(inputCol, value)
}
@Since("3.0.0")
def setOutputCol(value: String): this.type = {
clear(inputCols)
clear(outputCols)
set(outputCol, value)
}
I am asking, because these two are missing in Python
(https://github.com/apache/spark/pull/27195).
----------------------------------------------------------------
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]