Fuzzy Logic
Assuming the the task to do is following:
Write 3-5 fuzzy rules that determine heart attack risk, using:
Three ‘universes of discourse’ (UoD): diet, exercise, and risk
2 or 3 fuzzy classes per UoD, and their membership functions (represent graphically)
Show fuzzy inference for one set of sample data
Using the following proposed resolution – I want You to implement it using Libre Office (Calc) to answer to the given question.
Fuzzy Rules
1. Diet is low AND Exercise is high → Balanced 2. Diet is high OR Exercise is low → Unbalanced 3. Balanced → Risk is low
4. Unbalanced → Risk is high
Membership Functions
Diet is high:
Diet is low:
Exercise is high:
Exercise is low:
Balanced:
Unbalanced:
Risk is high:
Risk is low:
Sample Data
Diet: consume 3000 calories per day.
Exercise: burn 1000 calories per day.
What is the risk of heart disease?
Fuzzification
Membership for Diet High:
Membership for Diet Low:
Membership for Exercise High:
Membership for Exercise Low:
Rule Evaluation
1. Diet is low AND Exercise is high → Balanced Membership for Balanced:
2. Diet is high OR Exercise is low → Unbalanced Membership for Unbalanced:
3. Balanced → Risk is low Membership for Risk Low:
Likelihood of heart disease cut off:
Membership function for Risk Low:
4. Unbalanced → Risk is high Membership for Risk High:
Likelihood of heart disease cut off:
Membership function for Risk High:
Aggregation
The aggregated membership for Risk High and Risk Low:
The aggregated Risk function:
Defuzzification
The Center of Gravity (COG) method is used for the defuzzification.
The integration of the aggregated Risk membership function returns a likelihood of 47.5% of heart disease.