soft.fuzzy.information package
Submodules
soft.fuzzy.information.granulation module
Implements the methods required to work with fuzzy theory.
- class soft.fuzzy.information.granulation.FuzzyGraph
Bases:
Core
This class implements several methods that are relevant to KnowledgeBase objects working with fuzzy logic.
- add_fuzzy_granules(granules: List[Type[ContinuousFuzzySet]], is_input: None | bool = None, variable_offset: int = 0)
Given a list of granules, ‘anchor’ them into the KnowledgeBase’s graph by adding the necessary vertices for easy lookup later.
- Parameters:
granules – A list of granules, where each granule is a ContinuousFuzzySet object.
is_input – Whether this vertex should be considered ‘input’ (e.g., input granules or
None (output granules). If)
True (then the 'input' attribute is not set. If)
the (then)
False ('input' attribute is set to True. If)
False. (then the 'input' attribute is set to)
None. (Default is)
variable_offset – Begin counting from a different variable index other than zero.
zero. (Default is)
- Returns:
None
- add_fuzzy_logic_rules(rules: Set[Rule], rough_compatibility: bool = True) None
Add fuzzy logic rules to the KnowledgeBase’s graph.
- Parameters:
rules – A set of Rule objects, where the premise and consequence members are frozensets, and each item within the frozenset is a 2-tuple in the form (input variable index, input linguistic term index)
rough_compatibility – Whether to create the necessary data for rough set compatibility within PySoft.
which (Disabling this feature with False may improve the speed in) – rules are added to the KnowledgeBase.
- Returns:
None
- get_fuzzy_logic_rules() set
Get a list of fuzzy logic rules, where each element in the list is a Rule object.
- Returns:
A set of frozensets, where each frozenset contains the ‘type’ of vertices that are neighbors which interact with .