如何将LightGBM转换为PMML?

发布于 2025-02-03 07:51:13 字数 149 浏览 5 评论 0原文

我想知道是否有一种方法可以将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜灵血窟げ 2025-02-10 07:51:13

目前,至少有两种方法可以从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 LGBMClassifierand 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 to LGBMClassifier and then create PMML, but there are no other packages to create PMML from Booster directly and according to this, there is no official way to convert Booster to LGBMClassifier.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文