The following is the code to solve fuzzy logic, I tried to make from fuzzy control system (scikit fuzzy liberary) but I am facing error ValueError: Unexpected input: temprature
import numpy as np
import skfuzzy as fuzz
from skfuzzy import control as ctrl
temprature = ctrl.Antecedent(np.arange(0, 15, 1), 'temperature')
moisture = ctrl.Antecedent(np.arange(0, 11, 1), 'moisture')
humidity = ctrl.Antecedent(np.arange(0, 11, 1), 'humidity')
minutes = ctrl.Consequent(np.arange(0,26, 1), 'minutes')
temprature.automf(3)
moisture.automf(3)
humidity.automf(3)
minutes['low'] = fuzz.trimf(minutes.universe, [0, 0, 13])
minutes['medium'] = fuzz.trimf(minutes.universe, [0, 13, 25])
minutes['high'] = fuzz.trimf(minutes.universe, [13, 25, 25])
rule1 = ctrl.Rule(temprature['poor'] | moisture['poor'] | humidity['poor'], minutes['low'])
rule2 = ctrl.Rule(temprature['average'] | moisture['average'] | humidity['average'], minutes['medium'])
rule3 = ctrl.Rule(temprature['good'] | moisture['good'] | humidity['good'], minutes['high'])
tap_ctrl = ctrl.ControlSystem([rule1, rule2, rule3])
tap_control_system = ctrl.ControlSystemSimulation(tap_ctrl)
tap_control_system.input['temprature'] = 1
tap_control_system.input['moisture'] = 1
tap_control_system.input['humidity'] = 1
tap_control_system.compute()
print(tap_control_system.output['minutes'])
Error:
Traceback (most recent call last):
File "engine.py", line 30, in <module>
tap_control_system.input['temprature'] = 1
File "C:\Users\Toshiba\anaconda3\envs\Fuzzy-System-Project\lib\site-packages\skfuzzy\control\controlsystem.py", line 168, in __setitem__
raise ValueError("Unexpected input: " + key)
ValueError: Unexpected input: temprature