pmml | R Documentation |
This function reads and writes PMML representations (version 4.1) of associations (itemsets and rules). Write delegates to package pmml.
write.PMML(x, file)
read.PMML(file)
x |
a rules or itemsets object. |
file |
name of the PMML file (for |
Michael Hahsler
PMML 4.4 - Association Rules. https://dmg.org/pmml/v4-4/AssociationRules.html
pmml::pmml()
.
Other import/export:
DATAFRAME()
,
LIST()
,
read
,
write()
data("Groceries")
rules <- apriori(Groceries, parameter = list(support = 0.001))
rules <- head(rules, by = "lift")
rules
### save rules as PMML
write.PMML(rules, file = "rules.xml")
### read rules back
rules2 <- read.PMML("rules.xml")
rules2
### compare rules
inspect(rules[1])
inspect(rules2[1])
### clean up
unlink("rules.xml")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.