soft.fuzzy.logic.rules.reduction.frequent_yet_discernible package
Submodules
soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.heuristic module
Implements the Frequent-Yet-Discernible Method. More specifically, this script contains the primary function, as well as its supporting helper methods that assist in calculating the heuristic.
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.heuristic.calc_fyd_heuristic(fuzzy_anchors_vertices, input_data, knowledge_base, subgraph, subgraph_fuzzy_anchors_vertices)
Calculates the heuristic for the Frequent-Yet-Discernible Method.
- Parameters:
fuzzy_anchors_vertices
input_data
knowledge_base
subgraph
subgraph_fuzzy_anchors_vertices
Returns:
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.heuristic.calc_normalized_scalar_cardinalities(fuzzy_anchors_vertices, input_data, knowledge_base, vertices_usage_closeness)
Part of the Frequent-Yet-Discernible heuristic. Calculates the normalized scalar cardinalities and the vertices heuristics. The vertices heuristics are calculated as 1 - normalized usage closeness. The normalized scalar cardinalities are calculated as the scalar cardinalities divided by the maximum scalar cardinality.
- Parameters:
fuzzy_anchors_vertices – The vertices of the fuzzy anchors.
input_data – The input data.
knowledge_base – The knowledge base.
vertices_usage_closeness – The vertices’ usage & closeness.
- Returns:
The normalized scalar cardinalities and the vertices heuristics.
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.heuristic.calc_scalar_cardinality(knowledge_base, fuzzy_anchors_vertices, input_data)
Calculate the ‘scalar cardinality’, which is summation of the input granulation membership across the input data.
- Parameters:
knowledge_base – soft.computing.knowledge.KnowledgeBase
fuzzy_anchors_vertices
input_data – The input data
Returns:
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.heuristic.find_heuristic_cutoff(vertices_heuristics)
Given the valid heuristics (i.e., not Numpy ‘nan’), find the cutoff value using the ‘Kneedle’ algorithm.
- Parameters:
vertices_heuristics – The heuristic value of each vertex.
- Returns:
The heuristic cutoff
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.heuristic.frequent_discernible(input_data, knowledge_base: KnowledgeBase, config: Config)
The fuzzy logic rule generation method called the Frequent But Discernible Method.
- Parameters:
input_data
knowledge_base
config – A configuration file.
Returns:
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.heuristic.induce_subgraph(fuzzy_anchors_vertices, knowledge_base)
Find the subgraph with the vertices of interest, which are the vertices called rule_vertices (i.e., the vertices that reference the fuzzy logic rule relationships) and the vertices that reference the fuzzy sets (i.e., fuzzy_anchors_vertices).
- Parameters:
fuzzy_anchors_vertices
knowledge_base
Returns:
soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.visualize module
Functions for plotting the intermediate results of the Frequent-Yet-Discernible (FYD) Method.
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.visualize.plot_after_fyd_rule_deletion(subgraph, visual_style, config: Config)
Plots the subgraph after the deletion of the rules.
- Parameters:
subgraph
visual_style
config – The configuration settings.
Returns:
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.visualize.plot_after_fyd_terms_deletion(subgraph, subgraph_layout, visual_style, config: Config)
Plots the subgraph after the deletion of the fuzzy linguistic terms.
- Parameters:
subgraph
subgraph_layout
visual_style
config – The configuration settings.
Returns:
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.visualize.plot_before_fyd(subgraph, config: Config)
Plots the subgraph before the Frequent-Yet-Discernible algorithm.
- Parameters:
subgraph
config – The configuration settings.
Returns:
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.visualize.plot_before_fyd_rule_deletion(subgraph, subgraph_layout, visual_style, config: Config)
Plots the subgraph before the deletion of the rules.
- Parameters:
subgraph
subgraph_layout
visual_style
config – The configuration settings.
Returns:
- soft.fuzzy.logic.rules.reduction.frequent_yet_discernible.visualize.plot_before_fyd_terms_deletion(subgraph, subgraph_fuzzy_anchors_vertices_to_delete, subgraph_layout, visual_style, config: Config)
Plots the subgraph before the deletion of the fuzzy linguistic terms.
- Parameters:
subgraph – The subgraph.
subgraph_fuzzy_anchors_vertices_to_delete – The fuzzy anchors vertices to delete.
subgraph_layout – The subgraph layout.
visual_style – The visual style.
config – The configuration settings.
- Returns:
The subgraph layout.
Module contents
Various code related to the reduction of fuzzy logic rules using the Frequent-Yet-Discernible Method.