设置opName时,Transformer的Op名称不可用

时间:2018-04-09 19:27:42

标签: scala apache-spark mleap

我创建了自定义转换器(将一个字符串添加到列值的简单模型)来测试Mleap序列化,但在编写我的Op文件以进行Mleap和Spark序列化时,我无法获得变换器的名称

我的reference.conf文件看起来像这样

my.domain.mleap.spark.ops = ["spark_side.CustomTransformerOp"]

// include the custom transformers ops we have defined to the default Spark registries
ml.combust.mleap.spark.registry.v20.ops += my.domain.mleap.spark.ops
ml.combust.mleap.spark.registry.v21.ops += my.domain.mleap.spark.ops
ml.combust.mleap.spark.registry.v22.ops += my.domain.mleap.spark.ops
ml.combust.mleap.spark.registry.v23.ops += my.domain.mleap.spark.ops

my.domain.mleap.ops = ["mleap_side.CustomTransformerOp"]

// include the custom transformers we have defined to the default MLeap registry
ml.combust.mleap.registry.default.ops += my.domain.mleap.ops

当我在我的数据集上仅使用该阶段运行管道时,它工作正常,如果我将opName设置为某个字符串或其中一个Bundle.BuiltinOps成员,我甚至可以保存管道。

如果我输入了一些字符串,会弹出错误提示:"无法找到密钥:thatString",如果我使用其他成员,则错误表明它无法找到密钥来自那个成员(这是完全合理的,我理解为什么会这样)。

我的问题是在我的Op文件中声明opName时如何使变换器的名称可用。

(如果有人能够击中Hollin Wilkins,这将是惊人的:D)

1 个答案:

答案 0 :(得分:0)

我有同样的问题。根据此链接

https://github.com/combust/mleap/wiki/Adding-an-MLeap-Spark-Transformer

您需要将其自己添加到ml.combust.bundle.dsl.Bundle.BuiltinOps

第3部分中,为MLeap实现Bundle.ML序列化

注意:如果实现香草Spark变压器,请确保将opName添加到ml.combust.bundle.dsl.Bundle.BuiltinOps。