如何将LightGBM转换为PMML?
我想知道是否有一种方法可以将LightGBM型号转换为PMML。从lightgbm.basic.booster对象开始,我想知道如何将其转换为PMML或Mojo/Pojo对象。如果不可能,我想知道是否可以将LGBM模型保存为泡菜,而不是将其转换为PMML(或Mojo/Pojo)对象。
I would like to know if there exist a way to convert a LightGBM model to a PMML. Starting from the lightgbm.basic.Booster object I would like to know how to convert it to a PMML or MOJO/POJO object. If is not possible, i would like to know if it is possible to save the LGBM model as Pickle and than convert it to a PMML (or MOJO/POJO) object.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前,至少有两种方法可以从LightGBM创建PMML,例如 sklearn2pmml =“ https://github.com/softwareag/nyoka” rel =“ nofollow noreferrer”> nyoka ,但两者都无法从学习的助推器中创建PMML。
要创建PMML,我们需要使用Scikit-Learn API,例如
LGBMClassifier
和Pipeline。这两个软件包都可以以几乎相同的方式创建PMML。详细用法在 Sklearn2pmml and 在这里对于nyoka,这两个都很简单。Nyoka只是使用普通的Scikit-Learn API进行培训,但是Sklearn2pmml需要安装Java,并且在培训期间使用
pmmlpipeline
,因此,如果您使用Python和Sklearn,Nyoka,Nyoka可能是一个更好的选择。如果有一种方法可以直接从训练有素的助推器创建PMML或一种将
Booster
转换为LGBMClassifier
然后创建PMML的方法,但是没有其他软件包,但是没有其他软件包从booster
直接和根据 this ,没有官方方法将Booster
转换为lgbmclassifier
。For now, there are at least two ways to create PMML from lightGBM, such as sklearn2pmml and Nyoka, but both cannot create PMML from a learned Booster.
To create PMML, we need to use a Scikit-learn API such as
LGBMClassifier
and Pipeline. Both packages can create PMML in almost the same way. The detailed usage is described in here for sklearn2pmml and here for Nyoka, and both are pretty simple.Nyoka just uses the normal Scikit-learn API for training, but sklearn2pmml requires Java to be installed and
PMMLPipeline
to be used during training, so if you are using python and sklearn, Nyoka may be a better choice.It would be nice if there was a way to create PMML directly from a trained Booster or a way to convert
Booster
toLGBMClassifier
and then create PMML, but there are no other packages to create PMML fromBooster
directly and according to this, there is no official way to convertBooster
toLGBMClassifier
.