本文整理汇总了Python中pyspark.ml.param.Params.copy方法的典型用法代码示例。如果您正苦于以下问题:Python Params.copy方法的具体用法?Python Params.copy怎么用?Python Params.copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyspark.ml.param.Params
的用法示例。
在下文中一共展示了Params.copy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: copy
# 需要导入模块: from pyspark.ml.param import Params [as 别名]
# 或者: from pyspark.ml.param.Params import copy [as 别名]
def copy(self, extra={}):
newCV = Params.copy(self, extra)
if self.isSet(self.estimator):
newCV.setEstimator(self.getEstimator().copy(extra))
# estimatorParamMaps remain the same
if self.isSet(self.evaluator):
newCV.setEvaluator(self.getEvaluator().copy(extra))
return newCV
示例2: copy
# 需要导入模块: from pyspark.ml.param import Params [as 别名]
# 或者: from pyspark.ml.param.Params import copy [as 别名]
def copy(self, extra=None):
if extra is None:
extra = dict()
newCV = Params.copy(self, extra)
if self.isSet(self.estimator):
newCV.setEstimator(self.getEstimator().copy(extra))
# estimatorParamMaps remain the same
if self.isSet(self.evaluator):
newCV.setEvaluator(self.getEvaluator().copy(extra))
return newCV
示例3: copy
# 需要导入模块: from pyspark.ml.param import Params [as 别名]
# 或者: from pyspark.ml.param.Params import copy [as 别名]
def copy(self, extra=None):
"""
Creates a copy of this instance.
:param extra: extra parameters
:returns: new instance
"""
if extra is None:
extra = dict()
that = Params.copy(self, extra)
stages = [stage.copy(extra) for stage in that.getStages()]
return that.setStages(stages)
示例4: copy
# 需要导入模块: from pyspark.ml.param import Params [as 别名]
# 或者: from pyspark.ml.param.Params import copy [as 别名]
def copy(self, extra=None):
"""
Creates a copy of this instance with a randomly generated uid
and some extra params. This copies 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
"""
if extra is None:
extra = dict()
newCV = Params.copy(self, extra)
if self.isSet(self.estimator):
newCV.setEstimator(self.getEstimator().copy(extra))
# estimatorParamMaps remain the same
if self.isSet(self.evaluator):
newCV.setEvaluator(self.getEvaluator().copy(extra))
return newCV
示例5: copy
# 需要导入模块: from pyspark.ml.param import Params [as 别名]
# 或者: from pyspark.ml.param.Params import copy [as 别名]
def copy(self, extra=None):
if extra is None:
extra = dict()
that = Params.copy(self, extra)
stages = [stage.copy(extra) for stage in that.getStages()]
return that.setStages(stages)
示例6: copy
# 需要导入模块: from pyspark.ml.param import Params [as 别名]
# 或者: from pyspark.ml.param.Params import copy [as 别名]
def copy(self, extra={}):
that = Params.copy(self, extra)
stages = [stage.copy(extra) for stage in that.getStages()]
return that.setStages(stages)