Concepts

The galactic.concepts module contains classes for exploring concept lattices.

  • Concept class is used to represent collections of objects that share a set of predicates;

  • ConceptLattice class is used to represent concept lattices;

  • ConceptClosure class is used to represent closure operators used in ConceptLattice instances.

Two classes allow to visualize concept lattices:

  • ConceptRenderer class is used to draw concept nodes into graphviz graphs.

  • ConceptTable class is used to display concepts into jupyter notebooks;

And two functions:

class Concept(closure: galactic.concepts.ConceptClosure, keys: Optional[Iterable[str]] = None)

The Concept class represents a formal concept.

__and__(other: Any)galactic.concepts.Concept

Return the join of this concept and the other.

Parameters

other (Concept) – the other concept

Returns

  • Concept – the join of this concept and the other

  • NotImplementedTypeNotImplemented if the other concept is either not a concept or either not constructed with the same population.

__eq__(other: Any)bool

Test if this concept is equal to the other.

Parameters

other (Concept) – the other concept

Returns

  • boolTrue if this concept is equal to the other.

  • NotImplementedType – If the comparison is not implemented

__ge__(other: Any)bool

Test if this concept is greater than or equal to the other.

Parameters

other (Concept) – the other concept

Returns

  • boolTrue if this concept is greater than or equal to the other.

  • NotImplementedType – If the comparison is not implemented

__gt__(other: Any)bool

Test if this concept is greater than the other.

Parameters

other (Concept) – the other concept

Returns

  • boolTrue if this concept is greater than the other.

  • NotImplementedType – If the comparison is not implemented

__init__(closure: galactic.concepts.ConceptClosure, keys: Optional[Iterable[str]] = None)

Initialise a Concept instance.

Parameters
__le__(other: Any)bool

Test if this concept is lesser than or equal to the other.

Parameters

other (Concept) – the other concept

Returns

  • boolTrue if this concept is lesser than or equal to the other.

  • NotImplementedType – If the comparison is not implemented

__lt__(other: Any)bool

Test if this concept is lesser than the other.

Parameters

other (Concept) – the other concept

Returns

  • boolTrue if this concept is lesser than the other.

  • NotImplementedType – If the comparison is not implemented

__ne__(other: Any)bool

Test if this concept is not equal to the other.

Parameters

other (Concept) – the other concept

Returns

  • boolTrue if this concept is not equal to the other.

  • NotImplementedType – If the comparison is not implemented

__or__(other: Any)galactic.concepts.Concept

Return the join of this concept and the other.

Parameters

other (Concept) – the other concept

Returns

  • Concept – the join of this concept and the other

  • NotImplementedTypeNotImplemented if the other concept is either not a concept or either not constructed with the same population.

property closure

Get the closure operator.

Returns

The closure operator.

Return type

ConceptClosure

property descriptors

Get the descriptors.

Returns

The descriptors.

Return type

Mapping[Description, AbstractSet[Predicate]]

enlarge(keys: Iterable[str])galactic.concepts.Concept

Enlarge the concept by adding objects.

Parameters

keys (Iterable[Predicate]) – An iterable of identifiers.

Returns

A new concept.

Return type

Concept

equivalence(element: _T)Iterator[_T]

Compute equivalences of the element.

Parameters

element (_T) – The element whose equivalences are requested

Returns

An iterator over the equivalence elements of element

Return type

Iterator[_T]

intersection(*args: Any)galactic.algebras.lattice.Meetable

Return the intersection of this element and the others.

Parameters

*args (object) – the others elements

Returns

the meet of this element and the others

Return type

Meetable

Raises

TypeError – if one of the other elements is not an instance of this element class.

predicates()Iterator[galactic.descriptions.Predicate]

Get an iterator over the predicates.

Returns

Return type

Iterator[Predicate]

restrict(predicates: Iterable[galactic.descriptions.Predicate])galactic.concepts.Concept

Restrict the concept by adding predicates.

Parameters

predicates (Iterable[Predicate]) – An iterable of predicates.

Returns

A new concept.

Return type

Concept

subsumption(element: _T)Iterator[_T]

Compute subsumed elements of the element.

Parameters

element (_T) – The element whose subsumed elements are requested

Returns

An iterator over the subsumed elements of element

Return type

Iterator[_T]

property support

Get the closed set support.

Returns

The closed set support.

Return type

float

supsumption(element: _T)Iterator[_T]

Compute supsumed elements of the element.

Notes

supsumption is a neologism to designate the inverse relation of subsumption.

Parameters

element (_T) – The element whose supsumed elements are requested

Returns

An iterator over the supsumed elements of element

Return type

Iterator[_T]

union(*args: Any)galactic.algebras.lattice.Joinable

Return the union of this element and the others.

Parameters

*args (object) – the others elements

Returns

the join of this element and the others

Return type

Joinable

Raises

TypeError – if one of the other elements is not an instance of this element class.

class ConceptClosure(population: galactic.population.Population, descriptions: Iterable[galactic.descriptions.Description])

The ConceptClosure class.

It allows to compute concepts using a closure operator.

__call__(keys: Optional[Iterable[str]] = None)galactic.concepts.Concept

Initialise a concept using an iterable of identifiers.

Parameters

keys (Iterable[str]) – An iterable of identifiers.

Returns

A new concept equal to the closure of the keys.

Return type

Concept

__init__(population: galactic.population.Population, descriptions: Iterable[galactic.descriptions.Description])

Initialise a ConceptClosure instance.

Parameters
property descriptions

Get the descriptions.

Returns

The descriptions.

Return type

Sequence[Description]

property population

Get the population.

Returns

The population of individuals.

Return type

Population

class ConceptLattice(population: galactic.population.Population, descriptions: Iterable[galactic.descriptions.Description])

The ConceptLattice class represents concept lattices.

__contains__(item: Any)bool

Get the membership of an element.

Parameters

item – The element whose membership is requested.

Returns

True if the item belongs to the partially ordered set.

Return type

bool

__copy__()galactic.algebras.lattice.Lattice[_E]

Get a copy of the lattice.

The operation is in \(O(j+m)\).

Returns

The copy of this lattice.

Return type

Lattice[_E]

__init__(population: galactic.population.Population, descriptions: Iterable[galactic.descriptions.Description])None

Initialise a ConceptLattice instance.

Parameters
__iter__()Iterator[Tuple[_P, _P]]

Get an iterator over the elements.

Returns

An iterator over the elements

Return type

Iterator[Tuple[_P, _P]]

apply(strategies: Iterable[galactic.strategies.Strategy])None

Apply an iterable of strategies on a concept lattice.

Parameters
property atoms

Get the atoms of this lattice.

Returns

The atoms

Return type

AbstractSet[_E]

property bottom

Get the bottom elements.

The collection contains only one element, the minimum element.

Returns

The bottom elements.

Return type

AbstractSet[_E]

property closure

Get the underlying closure operator.

Returns

The closure operator.

Return type

ConceptClosure

property co_atoms

Get the co-atoms of this lattice.

Returns

The co-atoms.

Return type

AbstractSet[_E]

property co_domain

Get the co-domain of this lattice.

Returns

The co-domain of this lattice.

Return type

AbstractSet[_E]

property cover

Get the covering relation of this lattice.

Returns

The covering relation.

Return type

AbstractReversibleCoveringRelation[_E]

classmethod create(population: galactic.population.Population, descriptions: Iterable[galactic.descriptions.Description], strategies: Iterable[galactic.strategies.Strategy])galactic.concepts.ConceptLattice

Create a ConceptLattice instance.

Parameters
Returns

A concept lattice.

Return type

ConceptLattice

property descriptions

Get the underlying descriptions.

Returns

The descriptions. It’s a proxy to self.closure.descriptions.

Return type

Sequence[Description]

property domain

Get the domain of this lattice.

Returns

The domain of this lattice.

Return type

AbstractSet[_E]

extend(iterable: Iterable[_E])None

In-place enlarge the lattice with an iterable of elements.

Parameters

iterable (Iterable[_E]) – An iterable of elements

filter(element: _E)galactic.algebras.lattice.AbstractLattice[_E]

Get a filter of a lattice.

Parameters

element (_E) – The lower limit

Returns

The lower bounded lattice.

Return type

AbstractLattice[_E]

Raises

ValueError – If the element does not belong to the poset.

property global_entropy

Compute the global entropy of the Moore family.

\[H(L)=\sum_{A\in L}p(A)I(A)=n-\frac{\sum_{A\in L}\kappa(( A,B))\log_2(\kappa(A))}{2^n}\]

Notes

See Information .

Returns

The global entropy.

Return type

float

Examples

>>> from galactic.algebras.closure import MooreFamily
>>> from galactic.examples.closure import NumericalClosure, NumericalClosed
>>> elements = {0, 1, 2, 3, 4, 5}
>>> closure = NumericalClosure(elements)
>>> family = MooreFamily[NumericalClosed, int](closure)
>>> family.extend([closure([1, 2, 3]), closure([2, 3, 4])])
>>> round(family.global_entropy, 3)
1.311
property global_information

Compute the global information of the Moore family.

It is equal to the global entropy multiplied by the number of element defined by the closure operator.

\[I(L)=n H(L)\]
Returns

The global information.

Return type

float

Examples

>>> from galactic.algebras.closure import MooreFamily
>>> from galactic.examples.closure import NumericalClosure, NumericalClosed
>>> elements = {0, 1, 2, 3, 4, 5}
>>> closure = NumericalClosure(elements)
>>> family = MooreFamily[NumericalClosed, int](closure)
>>> family.extend([closure([1, 2, 3]), closure([2, 3, 4])])
>>> round(family.global_information, 3)
7.868
property global_logarithmic_stability

Compute the global normalized logarithmic stability of the Moore family.

\[\lambda(L)=\sum_{A\in L}p(A)\lambda(A)\]
Returns

The global normalized logarithmic stability.

Return type

float

Examples

>>> from galactic.algebras.closure import MooreFamily
>>> from galactic.examples.closure import NumericalClosure, NumericalClosed
>>> elements = {0, 1, 2, 3, 4, 5}
>>> closure = NumericalClosure(elements)
>>> family = MooreFamily[NumericalClosed, int](closure)
>>> family.extend([closure([1, 2, 3]), closure([2, 3, 4])])
>>> round(family.global_logarithmic_stability, 3)
0.335
property global_stability

Compute the global stability of the Moore family.

\[\sigma(L)=\sum_{A\in L}p(A)\sigma(A) =\sum_{A\in L}\frac{\kappa(A)^2}{2^{|A|+n}}\]
Returns

The global stability.

Return type

float

Examples

>>> from galactic.algebras.closure import MooreFamily
>>> from galactic.examples.closure import NumericalClosure, NumericalClosed
>>> elements = {0, 1, 2, 3, 4, 5}
>>> closure = NumericalClosure(elements)
>>> family = MooreFamily[NumericalClosed, int](closure)
>>> family.extend([closure([1, 2, 3]), closure([2, 3, 4])])
>>> round(family.global_stability, 3)
0.703
greatest_join_irreducible(element: _E)AbstractSet[_E]

Get the greatest join irreducible smaller than an element.

Parameters

element (_E) – The element whose greatest join irreducible are requested

Returns

The greatest join irreducible smaller than the element.

Return type

AbstractSet[_E]

Raises

ValueError – If the element does not belong to the lattice.

ideal(element: _E)galactic.algebras.lattice.AbstractLattice[_E]

Get an ideal of a lattice.

Parameters

element (_E) – The upper limit

Returns

The upper bounded lattice.

Return type

AbstractLattice[_E]

Raises

ValueError – If the element does not belong to the poset.

information()Iterator[Tuple[_E, float]]

Get an iterator on elements (\(A\), \(I(A)\)).

\(I(A)\) is the information of \(A\).

\[I(A)=-\log_2(p(A)\]
Returns

An iterator on elements and their information.

Return type

Iterator[Tuple[_E, float]]

Notes

See Information .

Examples

>>> from galactic.algebras.closure import MooreFamily
>>> from galactic.examples.closure import NumericalClosure, NumericalClosed
>>> elements = {0, 1, 2, 3, 4, 5}
>>> closure = NumericalClosure(elements)
>>> family = MooreFamily[NumericalClosed, int](closure)
>>> family.extend([closure([1, 2, 3]), closure([2, 3, 4])])
>>> for element, information in family.information():
...     print(list(element), information)
[2, 3] 4.0
[2, 3, 4] 4.0
[1, 2, 3] 4.0
[1, 2, 3, 4] 4.0
[0, 1, 2, 3, 4, 5] 0.4150374992788439
isdisjoint(other)

Return True if two sets have a null intersection.

property join_irreducible

Get the join irreducible elements.

Returns

The join irreducible elements

Return type

AbstractSet[_E]

logarithmic_stabilities()Iterator[Tuple[_E, float]]

Get an iterator on (\(A\), \(\lambda(A)\)).

\(\lambda(A)\) is the normalized logarithmic stabilities of \(A\) (the normalized logarithmic stability is always between 0 and 1).

  • if \(\kappa(A)\) is equal to \(2^{|A|}\), the normalized logarithmic stability is equal to 1.

  • if \(\kappa(A)\) is equal to \(1\), the normalized logarithmic stability is equal to 0

  • the special case \(A=\emptyset\) (\(2^{|A|}=\kappa(A)=1\)) gives \(\lambda(\emptyset)=1\) by convention.

\[\begin{split}\begin{eqnarray} \lambda(A) &=&\frac{-\log_2\left(1-\sigma(A)+\frac{1}{2^{|A|}}\right)}{|A|}\\ &=&\frac{-\log_2\left(\frac{2^{|A|}-\kappa(A)+1}{2^{|A|}}\right)}{|A|}\\ &=&\frac{|A|-\log_2\left(2^{|A|}-\kappa(A)+1\right)}{|A|}\\ &=&1-\frac{\log_2\left(2^{|A|}-\kappa(A)+1\right)}{|A|}\\ \lambda(\emptyset) &=&1\\ \end{eqnarray}\end{split}\]

See also

parts()

Notes

Originally, the logarithmic stability was defined using

\[\begin{split}\begin{eqnarray} -\log_2\left(1-\sigma(A)\right) &=&-\log_2\left(1-\frac{\kappa(A)}{2^{|A|}}\right)\\ &=&|A|-\log_2\left(2^{|A|}-\kappa(A)\right)\\ \end{eqnarray}\end{split}\]

but this formulae can give an infinity value and it is not normalized between elements.

Returns

An iterator on elements and their normalized logarithmic stability.

Return type

Iterator[Tuple[_E, float]]

Examples

>>> from galactic.algebras.closure import MooreFamily
>>> from galactic.examples.closure import NumericalClosure, NumericalClosed
>>> elements = {0, 1, 2, 3, 4, 5}
>>> closure = NumericalClosure(elements)
>>> family = MooreFamily[NumericalClosed, int](closure)
>>> family.extend([closure([1, 2, 3]), closure([2, 3, 4])])
>>> for element, stability in family.logarithmic_stabilities():
...     print(list(element), round(stability, 3))
[2, 3] 1.0
[2, 3, 4] 0.226
[1, 2, 3] 0.226
[1, 2, 3, 4] 0.075
[0, 1, 2, 3, 4, 5] 0.319
lower_limit(limit: _E, strict: bool = Ellipsis)AbstractSet[_E]

Get the elements greater than a limit.

Parameters
  • limit (_E) – The lower limit

  • strict (bool) – Is the comparison strict?

Returns

The selected elements.

Return type

AbstractSet[_E]

property maximum

Get the maximum element of this lattice.

Returns

the maximum element

Return type

_E

property meet_irreducible

Get the meet irreducible elements.

Returns

The meet irreducible elements

Return type

AbstractSet[_E]

property minimum

Get the minimum element of this lattice.

Returns

The minimum element

Return type

_E

parts()Iterator[Tuple[_E, int]]

Get an iterator on (\(A\), \(\kappa(A)\)).

\(\kappa(A)\) is the number of parts of \(A\) whose closure \(\phi\) equal to \(A\).

\[\kappa(A)= \left|\left\{ \tilde A\subseteq A: \phi\left(\tilde A\right)=A \right\}\right|\]
Returns

An iterator on elements and the number of parts \(\tilde A\subseteq A\subseteq X\) whose closure is equal to the element.

Return type

Iterator[Tuple[_E, int]]

Examples

>>> from galactic.algebras.closure import MooreFamily
>>> from galactic.examples.closure import NumericalClosure, NumericalClosed
>>> elements = {0, 1, 2, 3, 4, 5}
>>> closure = NumericalClosure(elements)
>>> family = MooreFamily[NumericalClosed, int](closure)
>>> family.extend([closure([1, 2, 3]), closure([2, 3, 4])])
>>> for element, count in family.parts():
...     print(list(element), count)
[2, 3] 4
[2, 3, 4] 4
[1, 2, 3] 4
[1, 2, 3, 4] 4
[0, 1, 2, 3, 4, 5] 48
property population

Get the underlying population.

Returns

The population. It’s a proxy to self.closure.population.

Return type

Population

predecessors(element: _E)AbstractSet[_E]

Get the predecessors of an element.

Parameters

element (_E) – The element whose predecessors are requested

Returns

The predecessors.

Return type

AbstractSet[_E]

Raises

ValueError – If the element does not belong to the poset.

probabilities()Iterator[Tuple[_E, float]]

Get an iterator on (\(A\), \(p(A)\)).

\(p(A)\) is the probability of \(A\).

\[p(A)=\frac{\kappa(A)}{2^n}\]

See also

parts()

Returns

An iterator on elements and their probability.

Return type

Iterator[Tuple[_E, float]]

Examples

>>> from galactic.algebras.closure import MooreFamily
>>> from galactic.examples.closure import NumericalClosure, NumericalClosed
>>> elements = {0, 1, 2, 3, 4, 5}
>>> closure = NumericalClosure(elements)
>>> family = MooreFamily[NumericalClosed, int](closure)
>>> family.extend([closure([1, 2, 3]), closure([2, 3, 4])])
>>> for element, probability in family.probabilities():
...     print(list(element), probability)
[2, 3] 0.0625
[2, 3, 4] 0.0625
[1, 2, 3] 0.0625
[1, 2, 3, 4] 0.0625
[0, 1, 2, 3, 4, 5] 0.75
property reduced_context

Get the reduced context from this lattice.

Returns

The reduced context.

Return type

AbstractBinaryRelation[_E, _E]

property sinks

Get the sink elements.

The collection contains only one element, the maximum element.

Returns

The sink elements.

Return type

AbstractSet[_E]

smallest_meet_irreducible(element: _E)AbstractSet[_E]

Get the smallest meet irreducible greater than an element.

Parameters

element (_E) – The element whose greatest join irreducible are requested

Returns

The smallest meet irreducible smaller than the element.

Return type

AbstractSet[_E]

Raises

ValueError – If the element does not belong to the lattice.

property sources

Get the source elements.

The collection contains only one element, the minimum element.

Returns

The source elements.

Return type

AbstractSet[_E]

stabilities()Iterator[Tuple[_E, float]]

Get an iterator on (\(A\), \(\sigma(A)\)).

\(\sigma(A)\) is the stability of \(A\).

\[\sigma(A)=\frac{\kappa(A)}{2^{|A|}}\]

See also

parts()

Returns

An iterator on elements and their stability.

Return type

Iterator[Tuple[_E, float]]

Examples

>>> from galactic.algebras.closure import MooreFamily
>>> from galactic.examples.closure import NumericalClosure, NumericalClosed
>>> elements = {0, 1, 2, 3, 4, 5}
>>> closure = NumericalClosure(elements)
>>> family = MooreFamily[NumericalClosed, int](closure)
>>> family.extend([closure([1, 2, 3]), closure([2, 3, 4])])
>>> for element, stability in family.stabilities():
...     print(list(element), round(stability, 3))
[2, 3] 1.0
[2, 3, 4] 0.5
[1, 2, 3] 0.5
[1, 2, 3, 4] 0.25
[0, 1, 2, 3, 4, 5] 0.75
successors(element: _E)AbstractSet[_E]

Get the successors of an element.

Parameters

element (_E) – The element whose successors are requested

Returns

The successors.

Return type

AbstractSet[_E]

Raises

ValueError – If the element does not belong to the poset.

property top

Get the top elements.

The collection contains only one element, the maximum element.

Returns

The top elements.

Return type

AbstractSet[_E]

property universes

Get the universes of this lattice.

Returns

The universes.

Return type

Tuple[AbstractSet[_E], AbstractSet[_E]]

upper_limit(limit: _E, strict: bool = False)AbstractSet[_E]

Get the elements lesser than a limit.

Parameters
  • limit (_E) – The upper limit

  • strict (bool) – Is the comparison strict?

Returns

The selected elements.

Return type

AbstractSet[_E]

class ConceptRenderer(fill_color: str = '#ffffff', current_color: str = '#ad7fa8', anonymous_color: str = '#d3d3d3', generator_color: str = '#fcaf3e', pseudo_color: str = '#729fcf', prototype_color: str = '#8ae234', show_predicates: bool = False, show_individuals: bool = False, compact: bool = True, join_irreducible: bool = False, meet_irreducible: bool = False, width: int = 40)

The ConceptRenderer class renders graphviz node and edge attributes.

It is used for rendering Concept instances.

__init__(fill_color: str = '#ffffff', current_color: str = '#ad7fa8', anonymous_color: str = '#d3d3d3', generator_color: str = '#fcaf3e', pseudo_color: str = '#729fcf', prototype_color: str = '#8ae234', show_predicates: bool = False, show_individuals: bool = False, compact: bool = True, join_irreducible: bool = False, meet_irreducible: bool = False, width: int = 40)

Initialise a ConceptRenderer instance.

Keyword Arguments
  • fill_color (str) – The fill color.

  • anonymous_color (str) – The anonymous color.

  • generator_color (str) – The generator color.

  • pseudo_color (str) – The pseudo-generator color.

  • prototype_color (str) – The prototype color.

  • show_predicates (bool) – Display predicates.

  • show_individuals (bool) – Display individuals.

  • compact (bool) – Compact mode.

  • join_irreducible (bool) – Display elements as join irreducible.

  • meet_irreducible (bool) – Display elements as meet irreducible.

  • width (int) – The node width.

property anonymous_color

Get the anonymous color.

Returns

The anonymous color.

Return type

str

attributes(element: galactic.concepts.Concept, index: Optional[int] = None, current: bool = False, successors: Optional[AbstractSet[galactic.concepts.Concept]] = None, predecessors: Optional[AbstractSet[galactic.concepts.Concept]] = None)Dict[str, str]

Produce a dictionary of graphviz attributes for a node.

Parameters
Returns

A dictionary of graphviz attributes.

Return type

Dict[str, str]

property compact

Get the compact mode.

Returns

True

If the display is in compact mode.

Return type

bool

property current_color

Get the current color.

Returns

The current color.

Return type

str

property fill_color

Get the fill color.

Returns

The fill color.

Return type

str

property generator_color

Get the generator color.

Returns

The generator color.

Return type

str

property join_irreducible

Get the join irreducible mode.

Returns

True

If the display is in join irreducible mode.

Return type

bool

property meet_irreducible

Get the meet irreducible mode.

Returns

True

If the display is in meet irreducible mode.

Return type

bool

property prototype_color

Get the prototype color.

Returns

The prototype color.

Return type

str

property pseudo_color

Get the pseudo color.

Returns

The pseudo color.

Return type

str

render(element: galactic.concepts.Concept, index: int)str

Render a concept for a cell element.

Parameters
  • element (Concept) – The concept to render.

  • index (int) – The element index.

Returns

The markdown representation of a Concept.

Return type

str

property show_individuals

Get the show individuals mode.

Returns

True

If the display is in show individuals mode.

Return type

bool

property show_predicates

Get the show predicates mode.

Returns

True

If the display is in show predicates mode.

Return type

bool

property width

Get the width.

Returns

The current width.

Return type

int

class ConceptTable(lattice: galactic.concepts.ConceptLattice, all_individuals: bool = False, all_predicates: bool = False, concept_width: int = 1, individual_width: int = 1, predicate_width: int = 1)

The Table class is used to represent lattice in jupyter notebooks.

__init__(lattice: galactic.concepts.ConceptLattice, all_individuals: bool = False, all_predicates: bool = False, concept_width: int = 1, individual_width: int = 1, predicate_width: int = 1)

Initialise a Table class.

Parameters

lattice (ConceptLattice) – The lattice whose table representation is requested

Keyword Arguments
  • all_individuals (bool) – A boolean flag for displaying all individuals for each concept

  • all_predicates (bool) – A boolean flag for displaying all predicates for each concept

  • concept_width (int) – The concept width

  • individual_width (int) – The individual width.

  • predicate_width (int) – The predicate width.

By default only new predicates and new individuals are displayed. The values of the given widths are compared with each other to allocate relative column sizes.

property all_individuals

Get the all individuals flag.

Returns

The all individuals flag.

Return type

bool

property all_predicates

Get the all predicates flag.

Returns

The all predicates flag.

Return type

bool

property concept_width

Get the concept width.

Returns

The concept width.

Return type

int

property individual_width

Get the individual width.

Returns

The individual width.

Return type

int

property lattice

Get the underlying lattice.

Returns

The concept lattice.

Return type

ConceptLattice

property predicate_width

Get the predicate width.

Returns

The predicate width.

Return type

int

new_predicates(concept: galactic.concepts.Concept, successors: AbstractSet[galactic.concepts.Concept])Iterator[galactic.descriptions.Predicate]

Get the new predicates given by the concept.

Parameters
  • concept (Concept) – The concept whose new predicates are requested.

  • successors (AbstractSet[Concept]) – The successors of the concept.

Returns

An iterator over the new predicates.

Return type

Iterator[Predicate]

new_individuals(concept: galactic.concepts.Concept, predecessors: AbstractSet[galactic.concepts.Concept])Iterator[str]

Get the new individuals given by the concept.

Parameters
  • concept (Concept) – The concept whose new individuals are requested.

  • predecessors (AbstractSet[Concept]) – The predecessors of the concept.

Returns

An iterator over the individual keys.

Return type

Iterator[str]