mathematics of incidence (part 2): formal concepts and formal concept lattices
DESCRIPTION
Continuing the tale of Abby and doughnuts from part 1, this presentation shifts terminology and notation into formal concept analysis, and introduces lattice ideals and filters that allow us to better describe what's going on with collaborative filtering.TRANSCRIPT
Mathematics of Incidencepart 2: formal concepts and formal concept lattices !Benjamin J. Kellerbjkeller.github.io!v.1, 3 October 2014
Creative Commons Attribution-ShareAlike 4.0 International License
bananas
doughnutsapples
eggscherries
Charles
David
Brian
Abby
Recall: Collaborative Filtering
Abby
Brian
Charles
David
cherries
doughnuts
eggs
apples
bananas
Use likes of users to recommend foods to Abby
Recommend these three foods to Abby because she likes food in common with users who like them
Recall: Likes represented as bipartite graph
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
bipartite graph (U,V,E) has vertices in disjoint sets U and V with edges (u,v) in E from vertex u in U to vertex v in V
Recall: Biclique
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
A biclique (U,V,E) of a bipartite graph G is a subgraph of G such that each u in U has an edge (u,v) with each v in V
Recall: Recommendations via bicliques
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Construct same recommendation by composing bicliques
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby Charles
David
cherries
doughnuts
eggs
apples
bananas
Brian
Shift perspectives: Formal Concept Analysis
• Starts with Formal Context ⟨ G,M,I ⟩
• Set of objects G
• Set of attributes M
• Incidence relation I ⊆GxM
• Derive formal concepts (basically bicliques) from incidence relation
• Constructs Formal Concept Lattice
"Likes" Formal ContextG = { Abby, Brian, Charles, David }
M = { apples, bananas, cherries, doughnuts, eggs }
I = { (Abby, apples), (Abby, bananas), (Brian, apples),(Brian, bananas),(Brian, cherries), (Brian, doughnuts), (Charles, apples), (Charles, bananas), (Charles, cherries), (Charles, doughnuts), (Charles, eggs), (David, bananas), (David, doughnuts), (David, eggs) }
Representing incidence relationAbby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
apples bananas cherries doughnuts eggs
Abby X X
Brian X X X X
Charles X X X X X
David X X X
Can represent incidence relation as a bipartite graph, but commonly represented as a cross table
Definition: Partially ordered set
(P,) is a partially ordered set (poset) when the order satisfies the properties
p q q p p = q 8p, q 2 Pif and then
8p, q, r 2 Pq r p rp qif and then
(reflexivity)
(antisymmetry)
(transitivity)
p p 8p 2 P
Definition: Lattice
(L,) S ✓ LFor a poset andW
S = p
p 2 L 8s 2 S, s p
the least upper bound of is
where and
S
VS = q
q 2 L 8s 2 S, q s
the greatest lower bound of is
where and
S
Lexist for any set S ✓ L
VS
WSIf and
then is a (complete) lattice
(Boolean) Lattice of powerset
• The powerset of G is set of subsets of G
• Ordered by inclusion is a poset
• And, is a lattice:
• Set union as least upper bound
• Set intersection as greatest lower bound
∅
Charles DavidBrianAbby
Abby, Brian
Abby, Charles
Abby, David
Brian, Charles
Brian, David
Charles, David
Abby, Brian,
Charles
Abby, Brian, David
Brian, Charles,
David
Abby, Charles,
David
Abby, Brian,
Charles,David
P(G)
Incidence relates powersets
∅
∅
Charles DavidBrianAbby
Abby, Brian
Abby, Charles
Abby, David
Brian, Charles
Brian, David
Charles, David
Abby, Brian,
Charles
Abby, Brian, David
Brian, Charles,
David
Abby, Charles,
David
Abby, Brian,
Charles,David
eggsdoughnutscherriesbananasapples
apples, bananas
apples, cherries
apples,doughnuts
apples, eggs
bananas, cherries
bananas,doughnuts
bananas, eggs
cherries,doughnuts
cherries, eggs
doughnuts, eggs
apples, bananas, cherries
apples, bananas,
eggs
apples, bananas,
doughnuts
apples, cherries,
doughnuts
apples, cherries,
eggs
apples,doughnuts,
eggs
bananas, cherries,
doughnuts
bananas, cherries,
eggs
bananas,doughnuts,
eggs
cherries,doughnuts,
eggs
apples, bananas, cherries,
doughnuts
apples, bananas, cherries,
eggs
apples, bananas,
doughnuts, eggs
apples, cherries,
doughnuts, eggs
bananas, cherries,
doughnuts, eggs
apples, bananas, cherries,
doughnuts, eggs
the dual lattice (order is flipped), so “upside-down”
(P(G),✓) (P(M),◆)
Deriving functions from incidence
� : P(G) ! P(M)
: P(M) ! P(G)
�(A) = {b 2 M | (a, b) 2 I}
A ✓ Gfor
(B) = {a 2 G | (a, b) 2 I}
B ✓ Mfor
Incidence relates powersets
∅
∅
Charles DavidBrianAbby
Abby, Brian
Abby, Charles
Abby, David
Brian, Charles
Brian, David
Charles, David
Abby, Brian,
Charles
Abby, Brian, David
Brian, Charles,
David
Abby, Charles,
David
Abby, Brian,
Charles,David
eggsdoughnutscherriesbananasapples
apples, bananas
apples, cherries
apples,doughnuts
apples, eggs
bananas, cherries
bananas,doughnuts
bananas, eggs
cherries,doughnuts
cherries, eggs
doughnuts, eggs
apples, bananas, cherries
apples, bananas,
eggs
apples, bananas,
doughnuts
apples, cherries,
doughnuts
apples, cherries,
eggs
apples,doughnuts,
eggs
bananas, cherries,
doughnuts
bananas, cherries,
eggs
bananas,doughnuts,
eggs
cherries,doughnuts,
eggs
apples, bananas, cherries,
doughnuts
apples, bananas, cherries,
eggs
apples, bananas,
doughnuts, eggs
apples, cherries,
doughnuts, eggs
bananas, cherries,
doughnuts, eggs
apples, bananas, cherries,
doughnuts, eggs
Functions relate powersets
Abby
Abby, Brian
Abby, Charles
Abby, Brian,
Charles
apples
apples, bananas
�({Abby}) = {apples, bananas}�({Abby ,Brian}) = {apples, bananas}
�({Abby ,Charles}) = {apples, bananas}�({Abby ,Brian,Charles}) = {apples, bananas}
({apples}) = {Abby ,Brian,Charles} ({apples, bananas}) = {Abby ,Brian,Charles}
Functions converge on largest set in each class of sets
Incidence relates power sets through functions
∅
∅
Charles DavidBrianAbby
Abby, Brian
Abby, Charles
Abby, David
Brian, Charles
Brian, David
Charles, David
Abby, Brian,
Charles
Abby, Brian, David
Brian, Charles,
David
Abby, Charles,
David
Abby, Brian,
Charles,David
eggsdoughnutscherriesbananasapples
apples, bananas
apples, cherries
apples,doughnuts
apples, eggs
bananas, cherries
bananas,doughnuts
bananas, eggs
cherries,doughnuts
cherries, eggs
doughnuts, eggs
apples, bananas, cherries
apples, bananas,
eggs
apples, bananas,
doughnuts
apples, cherries,
doughnuts
apples, cherries,
eggs
apples,doughnuts,
eggs
bananas, cherries,
doughnuts
bananas, cherries,
eggs
bananas,doughnuts,
eggs
cherries,doughnuts,
eggs
apples, bananas, cherries,
doughnuts
apples, bananas, cherries,
eggs
apples, bananas,
doughnuts, eggs
apples, cherries,
doughnuts, eggs
bananas, cherries,
doughnuts, eggs
apples, bananas, cherries,
doughnuts, eggs
Functions give us closure operators
�( ({apples})) = {apples, bananas}�( ({apples, bananas})) = {apples, bananas}
(�({Abby})) = {Abby ,Brian,Charles} (�({Abby ,Brian,Charles})) = {Abby ,Brian,Charles}
Functions converge on largest set in each class of sets
Formal concept
(A,B)
�(A) = B
(B) = A
A ✓ G B ✓ Mwhere andsatisfying
(A,B)For formal concept
A = ↵(A,B)
B = �(A,B)
is the extent of the conceptis the intent of the concept
Formal concept construction
(I will just drop set notation for singleton sets)
�A = ( (�(A)),�(A))
µB = ( (B), (�(B)))
For arbitrary A ✓ G B ✓ Mand define
Like for biclique construction use closure
Subconcepts
Subconcept order defined as for bicliques:
(A1, B1) � (A2, B2)
A1 ✓ A2
B1 ◆ B2
whenever
or, equivalently,
Concept Lattice
({Abby,Brian,Charles,David},{bananas})
({Abby,Brian,Charles},{apples,bananas}) ({Brian, Charles, David},{bananas,doughnuts})
({Charles},{apples,bananas,cherries,doughnuts,eggs})
({Brian,Charles},{apples,bananas,cherries,doughnuts}) ({Charles, David},{bananas,doughnuts,eggs})
concept lattice is complete
Lattice of bicliques/Concept lattice
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
({Abby,Brian,Charles,David},{bananas})
({Abby,Brian,Charles},{apples,bananas}) ({Brian, Charles, David},{bananas,doughnuts})
({Charles},{apples,bananas,cherries,doughnuts,eggs})
({Brian,Charles},{apples,bananas,cherries,doughnuts}) ({Charles, David},{bananas,doughnuts,eggs})
Simplifying concept lattice
({Abby,Brian,Charles,David},{bananas})
({Abby,Brian,Charles},{apples,bananas}) ({Brian, Charles, David},{bananas,doughnuts})
({Charles},{apples,bananas,cherries,doughnuts,eggs})
({Brian,Charles},{apples,bananas,cherries,doughnuts}) ({Charles, David},{bananas,doughnuts,eggs})
label elements with µmm 2 M
�gg 2 G
if is conceptif is concept
µm
�g
everything aboveeverything below
includesg
m
includes
Simplifying concept lattice
({Abby,Brian,Charles,David},{bananas})
({Abby,Brian,Charles},{apples,bananas}) ({Brian, Charles, David},{bananas,doughnuts})
({Charles},{apples,bananas,cherries,doughnuts,eggs})
({Brian,Charles},{apples,bananas,cherries,doughnuts}) ({Charles, David},{bananas,doughnuts,eggs})
label elements with µmm 2 M
�gg 2 G
if is conceptif is concept
Simplified concept lattice
bananas
doughnutsapples
eggscherries
Charles
DavidBrian
Abby
Definition: Lattice filters
A filter is an upward closed set for a set of elements
A principal filter is filter for a single element
Corresponds directly to simplified lattice labeling
"S = {p 2 L | s � p, 8s 2 S}
"s = {p 2 L | s � p}
"g = {p 2 L | �g � p}
Principal Filters
bananas
doughnutsapples
eggscherries
Charles
DavidBrian
Abby
bananas
doughnutsapples
eggscherries
Charles
DavidBrian
Abby
bananas
doughnutsapples
eggscherries
Charles
DavidBrian
Abby
"Abby "Brian "Charles
Defintion: Lattice ideals
A filter is an downward closed set for a set of elements
A principal ideal is ideal for a single element
Corresponds directly to simplified lattice labeling
#S = {p 2 L | p � s, 8s 2 S}
#s = {p 2 L | p � s}
#m = {p 2 L | p � µm}
Principal Ideals
bananas
doughnutsapples
eggscherries
Charles
DavidBrian
Abby
bananas
doughnutsapples
eggscherries
Charles
DavidBrian
Abby
bananas
doughnutsapples
eggscherries
Charles
DavidBrian
Abby
#eggs #doughnuts #bananas
Recall: recommendations
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
Abby
Brian
Charles
David
apples
bananas
cherries
doughnuts
eggs
every biclique
above has Abby
every biclique below has doughnuts
Recommendations, filters and ideals
• Can recommend to Abby by composing concepts from principal filter of Abby with concepts from principal ideal of doughnuts
• Principal ideal for doughnuts is maximal for foods (e.g., attributes) outside of Abby's filter
bananas
doughnutsapples
eggscherries
Charles
DavidBrian
Abby
"Abby
#doughnuts
Questions linger:
• What is a "good" recommendation?
• Serendipity, who?
• And, what does the principal ideal for doughnuts have to do with the principal ideal for Abby? (Or, what is the deal with Abby and doughnuts?)
ReadingB.A. Davey and H.A. Priestley, Introduction to Lattices and Order, Cambridge University Press, 2002
Covers posets and lattices in first two chapters, Formal Concept Analysis in the third chapter
B.Ganter and R.Wille, Formal Concept Analysis: Mathematical Foundations, Springer-Verlag, 1999
Harder to find mathematical reference on Formal Concept Analysis. Related material in Chapters 0 and 1
I skipped Galois connections, relates to the formal concept construction, both books cover those details
About me and these slides
I am Ben(jamin) Keller. I learn and, sometimes, create through explaining. I had been involved in a big (US) federally funded project that had the goal of helping biomedical scientists tell stories about their experimental observations. The project is long gone, but I’m still trying to grok how such a thing would work. Much of biological data comes in the form of observations that are distilled to something that looks like an incidence relation, which brings us to this series of presentations. My goal for the slides is to deal with the mathematics and analysis of incidence in an approachable way, but the intuitive beginnings will eventually allow us to embrace the more complex later.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
International License.