knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(fcaR)
Beyond the standard support (frequency), fcaR provides advanced metrics to analyze the quality and robustness of formal concepts, especially in fuzzy settings.
Intensional stability is defined as the probability that the intent of a concept is preserved when a random subset of its extent is removed.
$$ \sigma(C) = \frac{|{ A \subseteq \text{Ext}(C) \mid A' = \text{Int}(C) }|}{2^{|\text{Ext}(C)|}} $$
Let's compute it for the planets dataset:
fc <- FormalContext$new(planets) fc$find_concepts() stab <- fc$concepts$stability() head(stab)
Concepts with stability close to 1 are very robust (likely real patterns), while those near 0 are unstable (likely artifacts).
Separation measures how many objects are "unique" to a concept $C$, i.e., they are covered by $C$ but not by any of its direct subconcepts (descendants).
$$ \text{Sep}(C) = |\text{Ext}(C)| - |\bigcup_{K \prec C} \text{Ext}(K)| $$
sep <- fc$concepts$separation() head(sep)
A high separation indicates that the concept introduces a significant set of new objects into the hierarchy.
In Fuzzy FCA, concepts are "rectangles" of high values in the matrix, but not necessarily all 1s. Density measures the average value of the relation $I$ within the concept.
$$ \rho(C) = \frac{\sum_{g \in \text{Ext}(C), m \in \text{Int}(C)} I(g, m)}{|\text{Ext}(C)| \cdot |\text{Int}(C)|} $$
# For binary data, density is always 1 (or 0 for empty concepts) # We need to pass the original matrix I dens <- fc$concepts$density(I = fc$incidence()) head(dens)
We can combine these metrics to filter and analyze the lattice.
df <- data.frame( Concept = 1:fc$concepts$size(), Support = fc$concepts$support(), Stability = stab, Separation = sep, Density = dens ) # Concepts with high stability and separation subset(df, Stability > 0.8 & Separation > 0)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.