fcapy.lattice.formal_concept

This module provides a class FormalConcept which represents the Formal Concept object from FCA theory

Classes

AbstractConcept(extent_i, extent, intent_i, ...)

FormalConcept(extent_i, extent, intent_i, intent)

A class used to represent Formal Concept object from FCA theory

Exceptions

UnmatchedContextError

UnmatchedMonotonicityError

class fcapy.lattice.formal_concept.AbstractConcept(extent_i: Tuple[int, ...], extent: Tuple[str, ...], intent_i: Tuple[int, ...], intent: Tuple[str, ...], measures: Dict[str, float] = frozendict.frozendict({}), context_hash: int = None, is_monotone: bool = False)
classmethod read_json(path: Optional[str] = None, json_data: Optional[str] = None) AbstractConcept

Load FormalConcept from .json file or from .json encoded string json_data

write_json(objs_order: List[str], attrs_order: List[str], path: Optional[str] = None)

Save FormalConcept to .json file of return the .json encoded data if path is None

class fcapy.lattice.formal_concept.FormalConcept(extent_i: Tuple[int, ...], extent: Tuple[str, ...], intent_i: Tuple[int, ...], intent: Tuple[str, ...], measures: Dict[str, float] = frozendict.frozendict({}), context_hash: int = None, is_monotone: bool = False)

A class used to represent Formal Concept object from FCA theory

Notes

A Formal Concept (A,B) denotes the pair of subset of objects A and subset of attributes B, s.t. objects A are all the objects described by attributes B

and attributes B are all the attributes which describe objects A.

The set A is called extent, the set B is called intent

classmethod from_dict(data)

Construct a FormalConcept from a dictionary data

classmethod read_json(path: Optional[str] = None, json_data: Optional[str] = None) AbstractConcept

Load FormalConcept from .json file or from .json encoded string json_data

to_dict(objs_order: List[str], attrs_order: List[str]) Dict[str, Any]

Convert FormalConcept into a dictionary

write_json(objs_order: List[str], attrs_order: List[str], path: Optional[str] = None)

Save FormalConcept to .json file of return the .json encoded data if path is None

exception fcapy.lattice.formal_concept.UnmatchedContextError
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception fcapy.lattice.formal_concept.UnmatchedMonotonicityError
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.