Fuzzy Logic
Fuzzy logic is infinite value logic, like this thing is 20% yellow. (NOT PROBABILITY)

Fuzzy inference
KB: “if (things temp is high) then do this”
Observation: “things temp is 39”
Ok so does this if statement evaluate to true? what is a high temp? (this is the point of fuzzy sets)
Note that the rules are fuzzy.
Fuzzy set
Objects can either be a member or not a member of a set.
Not fuzzy set example.
Fuzzy set example.


Not that fuzzy set is a range.
Membership function
Defines what classifies as being in what group.
These can be set by using expert views or trained on data.

Fuzzy operators
Operators allow you to define certain groups based on memberships.

Operator definitions

Hedge operators

General fuzzy logic architecture

Okay I think its better if you watch the lecture for the next bit.
- But what it seems like is you get multiple member ship functions, and see where the thing ens up on it

- From that because it uses an AND operator, you have to pick the min of the two in the correct membership group. NOTE that this is based on the set of rules that is set out at the start, aka if the bottom one cared about the top half and not the bottom half you would make a triangle selecting the top half of medium.

- You then merge the sets together.

- Finally you pick a number based on the set, a common strat is to pick the centroid (similar to a weighted avg), or the max or the min ect...

Inference methods
Mamdani
- Basic: Takes in and outputs fuzzy sets.
- Output Representation: In the Mamdani method, both the input and the output variables are represented by fuzzy sets. The output fuzzy sets are defined similarly to the input fuzzy sets, typically with linguistic terms like "low", "medium", "high".
- Rule Consequence: The consequence of each rule is a fuzzy set. For example, a rule might be "If temperature is high, then cooling is high", where both 'temperature' and 'cooling' are represented by fuzzy sets.
- Aggregation and Defuzzification: The results of the rules are aggregated into a combined fuzzy set. This set is then converted into a crisp (non-fuzzy) output through a process called defuzzification, often using methods like the centroid or mean of maximum.
TSK
- Basic: Takes in a fuzzy set but will return a number not a fuzzy set.
- Output Representation: In the TSK method, the output of each rule is a function of the input variables, often a linear function, rather than a fuzzy set. This makes the TSK model more systematic and analytically tractable.
- Rule Consequence: A typical TSK rule might be "If temperature is high, then cooling = 0.8*temperature + 2". The consequence of the rule is a specific mathematical function, not a fuzzy set.
- Aggregation: The outputs of the rules are typically weighted and summed up, and there is no need for defuzzification since the output is already a crisp value.

