Remove unused code
This commit is contained in:
parent
602d36681d
commit
5198e126d0
24
src/rules.py
24
src/rules.py
@ -319,30 +319,6 @@ def _get_fuzzy_rule_atom(
|
|||||||
return (fuzzy_variable[best_value[0]], best_value[1])
|
return (fuzzy_variable[best_value[0]], best_value[1])
|
||||||
|
|
||||||
|
|
||||||
def simplify_rules_fuzz(
|
|
||||||
X: pd.DataFrame,
|
|
||||||
rules: List[Rule],
|
|
||||||
fuzzy_variables: Dict[str, FuzzyVariable],
|
|
||||||
) -> List[Rule]:
|
|
||||||
minmax = _get_variables_minmax(X)
|
|
||||||
|
|
||||||
new_rules: List[Rule] = []
|
|
||||||
for rule in rules:
|
|
||||||
intervals = _get_varibles_interval(rule.get_antecedent())
|
|
||||||
new_atoms = []
|
|
||||||
for key, value in intervals.items():
|
|
||||||
val: float = 0
|
|
||||||
if value[0] is None and value[1] is not None:
|
|
||||||
val = minmax[key][0]
|
|
||||||
if value[1] is None and value[0] is not None:
|
|
||||||
val = minmax[key][1]
|
|
||||||
if value[0] is not None and value[1] is not None:
|
|
||||||
val = (value[0] + value[1]) / 2
|
|
||||||
new_atoms.append(RuleAtom(key, ComparisonType.EQUALS, val))
|
|
||||||
new_rules.append(Rule(new_atoms, rule.get_consequent()))
|
|
||||||
return new_rules
|
|
||||||
|
|
||||||
|
|
||||||
def _get_fuzzy_rules(
|
def _get_fuzzy_rules(
|
||||||
rules: List[Rule], fuzzy_variables: Dict[str, FuzzyVariable]
|
rules: List[Rule], fuzzy_variables: Dict[str, FuzzyVariable]
|
||||||
) -> List[Tuple[List[RuleAtom], Term, float]]:
|
) -> List[Tuple[List[RuleAtom], Term, float]]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user