Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-29093][PYTHON][ML] Remove automatically generated param setters in _shared_params_code_gen.py #26232

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.apache.spark.sql.types.StructType
* Params for [[QuantileDiscretizer]].
*/
private[feature] trait QuantileDiscretizerBase extends Params
with HasHandleInvalid with HasInputCol with HasOutputCol {
with HasHandleInvalid with HasInputCol with HasOutputCol with HasInputCols with HasOutputCols {

/**
* Number of buckets (quantiles, or categories) into which data points are grouped. Must
Expand Down Expand Up @@ -129,8 +129,7 @@ private[feature] trait QuantileDiscretizerBase extends Params
*/
@Since("1.6.0")
final class QuantileDiscretizer @Since("1.6.0") (@Since("1.6.0") override val uid: String)
extends Estimator[Bucketizer] with QuantileDiscretizerBase with DefaultParamsWritable
with HasInputCols with HasOutputCols {
extends Estimator[Bucketizer] with QuantileDiscretizerBase with DefaultParamsWritable {

@Since("1.6.0")
def this() = this(Identifiable.randomUID("quantileDiscretizer"))
Expand Down
12 changes: 12 additions & 0 deletions python/pyspark/ml/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,18 @@ class UnaryTransformer(HasInputCol, HasOutputCol, Transformer):
.. versionadded:: 2.3.0
"""

def setInputCol(self, value):
"""
Sets the value of :py:attr:`inputCol`.
"""
return self._set(inputCol=value)

def setOutputCol(self, value):
"""
Sets the value of :py:attr:`outputCol`.
"""
return self._set(outputCol=value)

@abstractmethod
def createTransformFunc(self):
"""
Expand Down
Loading