ex_fuzzy.rules.RuleBaseT1#
- class ex_fuzzy.rules.RuleBaseT1(antecedents, rules, consequent=None, tnorm=<function prod>)[source]#
Bases:
RuleBase
Class optimized to work with multiple rules at the same time. Supports only one consequent. (Use one rulebase per consequent to study classification problems. Check MasterRuleBase class for more documentation)
This class supports t1 fs.
- __init__(antecedents, rules, consequent=None, tnorm=<function prod>)[source]#
Constructor of the RuleBaseT1 class.
- Parameters:
antecedents (list[fuzzyVariable]) – list of fuzzy variables that are the antecedents of the rules.
rules (list[RuleSimple]) – list of rules.
consequent (fuzzyVariable) – fuzzy variable that is the consequent of the rules. ONLY on regression problems.
tnorm – t-norm used to compute the fuzzy output.
- inference(x)[source]#
Computes the output of the t1 inference system.
Return an array in shape samples.
- Parameters:
x (array) – array with the values of the inputs.
- Returns:
array with the output of the inference system for each sample.
- Return type:
array
- forward(x)[source]#
Same as inference() in the t1 case.
Return a vector of size (samples, )
- Parameters:
x (array) – array with the values of the inputs.
- Returns:
array with the deffuzified output for each sample.
- Return type:
array