Planet
#https://cran.r-project.org/web/packages/fcaR/vignettes/concept_lattice.html
planets
## small medium large near far moon no_moon
## Mercury 1 0 0 1 0 0 1
## Venus 1 0 0 1 0 0 1
## Earth 1 0 0 1 0 1 0
## Mars 1 0 0 1 0 1 0
## Jupiter 0 0 1 0 1 1 0
## Saturn 0 0 1 0 1 1 0
## Uranus 0 1 0 0 1 1 0
## Neptune 0 1 0 0 1 1 0
## Pluto 1 0 0 0 1 1 0
fc_planets <- FormalContext$new(planets)
fc_planets$to_transactions()
## transactions in sparse format with
## 9 transactions (rows) and
## 7 items (columns)
fc_planets$find_implications()
fc_planets$implications$to_arules(quality = TRUE)
## set of 10 rules
## A set of 12 concepts:
## 1: ({Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto}, {})
## 2: ({Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto}, {moon})
## 3: ({Jupiter, Saturn, Uranus, Neptune, Pluto}, {far, moon})
## 4: ({Jupiter, Saturn}, {large, far, moon})
## 5: ({Uranus, Neptune}, {medium, far, moon})
## 6: ({Mercury, Venus, Earth, Mars, Pluto}, {small})
## 7: ({Earth, Mars, Pluto}, {small, moon})
## 8: ({Pluto}, {small, far, moon})
## 9: ({Mercury, Venus, Earth, Mars}, {small, near})
## 10: ({Mercury, Venus}, {small, near, no_moon})
## 11: ({Earth, Mars}, {small, near, moon})
## 12: ({}, {small, medium, large, near, far, moon, no_moon})
## Implication set with 10 implications.
## Rule 1: {no_moon} -> {small, near}
## Rule 2: {far} -> {moon}
## Rule 3: {near} -> {small}
## Rule 4: {large} -> {far, moon}
## Rule 5: {medium} -> {far, moon}
## Rule 6: {medium, large, far, moon} -> {small, near, no_moon}
## Rule 7: {small, near, moon, no_moon} -> {medium, large, far}
## Rule 8: {small, near, far, moon} -> {medium, large, no_moon}
## Rule 9: {small, large, far, moon} -> {medium, near, no_moon}
## Rule 10: {small, medium, far, moon} -> {large, near, no_moon}
fc_planets$concepts$plot()

fc_planets <- FormalContext$new(planets)
print(fc_planets)
## Warning: Too many attributes, output will be truncated.
## FormalContext with 9 objects and 7 attributes.
## Attributes' names are: small, medium, large, near, far, moon, ...
## Matrix:
## small medium large near far moon no_moon
## Mercury 1 0 0 1 0 0 1
## Venus 1 0 0 1 0 0 1
## Earth 1 0 0 1 0 1 0
## Mars 1 0 0 1 0 1 0
## Jupiter 0 0 1 0 1 1 0
## Saturn 0 0 1 0 1 1 0
