fcapy.lattice.pattern_concept
This module provides a class PatternConcept which represents the Pattern Concept object from FCA theory
Classes
|
A class used to represent Pattern Concept object from FCA theory |
- class fcapy.lattice.pattern_concept.PatternConcept(extent_i, extent, intent_i, intent, pattern_types: Tuple[AbstractPS], attribute_names: Tuple[str], measures=None, context_hash=None)
A class used to represent Pattern Concept object from FCA theory
Notes
A Pattern Concept (A, d) denotes the pair of subset of objects A and a (complex) description d, s.t. objects A are all the objects described by description d
and description d is the most accurate description of objects A
The set A is called extent, the description d is called intent
The only restriction to a type description d is that should encoded by Pattern Structures from the module fcapy.mvcontext.pattern_structure
- property context_hash
Hash value of a MVContext the PatternConcept is based on.
Only the concepts from the same MVContext can be compared
- property extent
The set of names of objects described by intent of the PatternConcept
- property extent_i
The set of indexes of objects described by intent of the PatternConcept
- classmethod from_dict(data, json_ready: bool = False, pattern_types: Optional[Tuple[AbstractPS]] = None)
Construct a FormalConcept from a dictionary
data- Parameters
data (dict) – Data to load concept from
json_ready (bool) – A flag whether to load the json compatible dictionary
pattern_types (tuple of pattern structure types) – A tuple of pattern structure classes that encounter in the dictionary
data
- Return type
Pattern Concept
- property intent
A dict of the most specific descriptions of extent by each of pattern structure from
pattern_typesindexed by the name of pattern structure in
pattern_types
- property intent_i
A dict of the most specific descriptions of extent by each of pattern structure from
pattern_typesindexed by the index of pattern structure in
pattern_types
- property pattern_types
A set of subtypes of PatternStructures used to encode the descriptions from
intent
- classmethod read_json(path: Optional[str] = None, json_data: Optional[str] = None, pattern_types: Optional[Tuple[AbstractPS]] = None)
Load PatternConcept from .json file or from .json encoded string
json_data- Parameters
path (str) – Path to the .json file to read from (optional)
json_data (str) – Json data to read from (optional)
pattern_types (tuple[AbstractPS]) – Tuple of additional Pattern Structures not defined in fcapy.mvcontext.pattern_structure that may encounter in the read data
- Returns
c
- Return type
PatternConcept
- property support
The number of objects described by the intent of the PatternConcept
- to_dict(json_ready: bool = False)
Convert FormalConcept into a dictionary
- write_json(path=None)
Save PatternConcept to .json file of return the .json encoded data if
pathis None