[SPARK-29565][FOLLOWUP] add setInputCol/setOutputCol in OHEModel

### What changes were proposed in this pull request?
add setInputCol/setOutputCol in OHEModel

### Why are the changes needed?
setInputCol/setOutputCol should be in OHEModel too.

### Does this PR introduce any user-facing change?
Yes.
```OHEModel.setInputCol```
```OHEModel.setOutputCol```

### How was this patch tested?
Manually tested.

Closes #27228 from huaxingao/spark-29565.

Authored-by: Huaxin Gao <huaxing@us.ibm.com>
Signed-off-by: zhengruifeng <ruifengz@foxmail.com>
This commit is contained in:
Huaxin Gao 2020-01-16 19:23:10 +08:00 committed by zhengruifeng
parent 018bdcc53c
commit 1ef1d6caf2
2 changed files with 22 additions and 0 deletions

View file

@ -287,6 +287,14 @@ class OneHotEncoderModel private[ml] (
}
}
/** @group setParam */
@Since("3.0.0")
def setInputCol(value: String): this.type = set(inputCol, value)
/** @group setParam */
@Since("3.0.0")
def setOutputCol(value: String): this.type = set(outputCol, value)
/** @group setParam */
@Since("3.0.0")
def setInputCols(values: Array[String]): this.type = set(inputCols, values)

View file

@ -2541,6 +2541,20 @@ class OneHotEncoderModel(JavaModel, _OneHotEncoderParams, JavaMLReadable, JavaML
"""
return self._set(outputCols=value)
@since("3.0.0")
def setInputCol(self, value):
"""
Sets the value of :py:attr:`inputCol`.
"""
return self._set(inputCol=value)
@since("3.0.0")
def setOutputCol(self, value):
"""
Sets the value of :py:attr:`outputCol`.
"""
return self._set(outputCol=value)
@since("3.0.0")
def setHandleInvalid(self, value):
"""