如何将Logistic回归和kmeans pmml文件导入R [英] how to import logistic regression and kmeans pmml files into r

查看:329
本文介绍了如何将Logistic回归和kmeans pmml文件导入R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关将pmml模型文件导入r的指导. PMML是一种预测性模型标记语言,它允许在一个系统中构建的模型部署在另一个系统中.我有几种模型已经在spss上进行了训练,并使用pmml保存为xml格式.它们是Logistic回归和k均值模型.

I am looking for some guidance please on importing pmml model files into r. PMML is a predictive model markup language which allows models built in one system to be deployed in another. I have several models that have been trained on spss and saved to the xml format using pmml. They are Logistic Regression and k-means models.

我已经详尽搜索了导入pmml的r功能,发现在诸如Arules for Association模型之类的软件包中,到处都只有很少的功能. R对于导出而不是导入pmml文件似乎非常有用.作为二等奖,我考虑使用python,但这似乎是相同的情况. (我目前正在探索使用java/weka的选项,但是还有其他一些方面(与问题无关),为什么我不想走这条路).

I have undertaken exhaustive searches for r capabilities to import pmml and am finding that there is only a rare function here and there in packages such as Arules for Association models. R seems to be very useful for exporting, but not importing, pmml files. As a second prize I considered using python, but it seems to be the same situation. (I am currently exploring the option of using java/weka but there are some other aspects (irrelevant to the question) why I do not want to go down this route).

所以我想知道是否有任何文档和指南可以在r中构建模型对象,在其中我可以从pmml中解析信息并创建自己的自定义pmml导入?我需要的所有信息都在pmml文件中–我认为我只需要以正确的方式将其提供给r.

So I am wondering if there is any documentation and guidance anywhere on how to build a model object in r in which I can parse the info from the pmml and create my own custom pmml import? All the info I need is in the pmml file – I just need to provide it to r in the right way, I think.

我还将考虑在python中针对相同问题的选项.您的指导将不胜感激.

I would also consider options for same question in python. Your guidance would be very appreciated.

推荐答案

"partykit"软件包具有用于导入PMML文件的几种实现. 下面的代码段就是这样的一个例子.

"partykit" package of R has couple of implementation for importing the PMML file. Code snippets below is one such example.

require(partykit)
ttnc_pmml <- file.path(system.file("pmml", package = "partykit"),
                   "ttnc.pmml")
(ttnc_quest <- pmmlTreeModel(ttnc_pmml))

这篇关于如何将Logistic回归和kmeans pmml文件导入R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆