Skip to content

Commit

Permalink
remove unnecessary doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxr committed May 17, 2015
1 parent 4159f35 commit 413c463
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
22 changes: 3 additions & 19 deletions python/pyspark/ml/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,9 @@ def _fit(self, dataset):
return PipelineModel(transformers)

def copy(self, extra={}):
"""
Creates a copy of this instance with a randomly generated uid
and some extra params. This copies each of the component
stages, creates a deep copy of the embedded paramMap, and
copies the embedded and extra parameters over.
:param extra: Extra parameters to copy to the new instance
:return: Copy of this instance
"""
paramMap = self.extractParamMap(extra)
stages = [stage.copy(extra) for stage in paramMap[self.stages]]
return Pipeline().setStages(stages)
that = Params.copy(self, extra)
stages = [stage.copy(extra) for stage in that.getStages()]
return that.setStages(stages)


@inherit_doc
Expand All @@ -225,14 +217,6 @@ def _transform(self, dataset):
return dataset

def copy(self, extra={}):
"""
Creates a copy of this instance with a randomly generated uid
and some extra params. This copies each of the component
stages, creates a deep copy of the embedded paramMap, and
copies the embedded and extra parameters over.
:param extra: Extra parameters to copy to the new instance
:return: Copy of this instance
"""
stages = [stage.copy(extra) for stage in self.stages]
return PipelineModel(stages)

Expand Down
9 changes: 0 additions & 9 deletions python/pyspark/ml/tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,6 @@ def _fit(self, dataset):
return CrossValidatorModel(bestModel)

def copy(self, extra={}):
"""
Creates a copy of this instance with a randomly generated uid
and some extra params. This copies the underlying estimator,
evaluator, and estimatorParamMap, creates a deep copy of the
embedded paramMap, and copies the embedded and extra parameters
over.
:param extra: Extra parameters to copy to the new instance
:return: Copy of this instance
"""
newCV = Params.copy(self, extra)
if self.isSet(self.estimator):
newCV.setEstimator(self.getEstimator().copy(extra))
Expand Down

0 comments on commit 413c463

Please sign in to comment.