huaxingao commented on issue #25859: [SPARK-29142][PYTHON][ML] Pyspark clustering models support column setters/getters/predict URL: https://github.com/apache/spark/pull/25859#issuecomment-535135250 @srowen This PR also adds the setters. Use ```GaussianMixtureModel``` as an example: before the PR: ``` class GaussianMixtureModel(JavaModel, JavaMLWritable, JavaMLReadable, HasTrainingSummary): ``` after the PR: ``` class GaussianMixtureParams(HasMaxIter, HasFeaturesCol, HasSeed, HasPredictionCol, HasProbabilityCol, HasTol): class GaussianMixtureModel(JavaModel, GaussianMixtureParams, JavaMLWritable, JavaMLReadable, HasTrainingSummary): ``` Since currently, ```HasXXX``` has both setters and getters, so this PR adds both the setters and getters to ```GaussianMixtureModel```. After next refactor jira https://issues.apache.org/jira/browse/SPARK-29093 (remove automatically generated param setters in _shared_params_code_gen.py), setters will be removed from ```HasXXX```, I will need to explicitly add ```setFeaturesCol```, ```setPredictionCol``` and ```setProbabilityCol``` to ```GaussianMixtureModel```, then the code will be as following ``` class GaussianMixtureModel(JavaModel, GaussianMixtureParams, JavaMLWritable, JavaMLReadable, HasTrainingSummary): def setFeaturesCol def setPredictionCol def setProbabilityCol ``` It will be exactly the same as the currently scala code below: ``` class GaussianMixtureModel extends Model with GaussianMixtureParams with MLWritable with HasTrainingSummary def setFeaturesCol def setPredictionCol def setProbabilityCol ``` I agree with you that we should retain ```@since``` annotations with the highest version of any of the removed methods.
---------------------------------------------------------------- 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]
