Skip to content
Snippets Groups Projects
Commit 5e035403 authored by Xiangrui Meng's avatar Xiangrui Meng
Browse files

[SPARK-10957] [ML] setParams changes quantileProbabilities unexpectly in...

[SPARK-10957] [ML] setParams changes quantileProbabilities unexpectly in PySpark's AFTSurvivalRegression

If user doesn't specify `quantileProbs` in `setParams`, it will get reset to the default value. We don't need special handling here. vectorijk yanboliang

Author: Xiangrui Meng <meng@databricks.com>

Closes #9001 from mengxr/SPARK-10957.
parent 5952bdb7
No related branches found
No related tags found
No related merge requests found
...@@ -701,11 +701,7 @@ class AFTSurvivalRegression(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredi ...@@ -701,11 +701,7 @@ class AFTSurvivalRegression(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredi
quantilesCol=None): quantilesCol=None):
""" """
kwargs = self.setParams._input_kwargs kwargs = self.setParams._input_kwargs
if quantileProbabilities is None: return self._set(**kwargs)
return self._set(**kwargs).setQuantileProbabilities([0.01, 0.05, 0.1, 0.25, 0.5,
0.75, 0.9, 0.95, 0.99])
else:
return self._set(**kwargs)
def _create_model(self, java_model): def _create_model(self, java_model):
return AFTSurvivalRegressionModel(java_model) return AFTSurvivalRegressionModel(java_model)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment