title: Example of fuzzy logic in classification
body: <p>I need to classify objects using fuzzy logic. Each object is characterized by 4 features - {size, shape, color, texture}. Each feature is fuzzified by linguistic terms and some membership function. The problem is I am unable to understand how to defuzzify such that I may know which class an unknown object belongs to. Using the Mamdani Max-Min inference, can somebody help in solving this issue? </p>
  
  <p>Objects = {Dustbin, Can, Bottle, Cup} or denoted as {1,2,3,4} respectively. The fuzzy sets for each feature is :</p>
  
  <p>Feature : Size </p>
  
  <pre><code>$\tilde{Size_{Large}}$ = {1//1,1/2,0/3,0.6/4}  for crisp values in range 10cm - 20 cm
  
  $\tilde{Size_{Small}}$ = {0/1,0/2,1/3,0.4/4}  (4cm - 10cm)
  </code></pre>
  
  <p>Shape: </p>
  
  <pre><code>$\tilde{Shape_{Square}}$ = {0.9/1, 0/2,0/3,0/4}  for crisp values in range 50-100
  
  $\tilde{Shape_{Cylindrical}}$ = {0.1/1, 1/2,1/3,1/4}  (10-40)
  </code></pre>
  
  <p>Feature : Color</p>
  
  <pre><code>$\tilde{Color_{Reddish}}$ = {0/1, 0.8/2, 0.6/3,0.3/4}  say red values in between 10-50 (not sure, assuming)
  
  $\tilde{Color_{Greenish}}$ = {1/1, 0.2/2, 0.4/3, 0.7/4}  say color values in 100-200
  </code></pre>
  
  <p>Feature : Texture</p>
  
  <pre><code>$\tilde{Tex_{Coarse}}$ = {0.2/1, 0.2/2,0/3,0.5/4}  if texture crisp values 10-20
  
  $\tilde{Tex_{Shiny}}$ = {0.8/1, 0.8/2, 1/3, 0.5/4}  30-40
  </code></pre>
  
  <p>The If then else rules for classification are</p>
  
  <blockquote>
    <p>R1: IF object is large in size AND cylindrical shape AND greenish in color AND coarse in texture THEN object is Dustbin</p>
  </blockquote>
  
  <p>or in tabular form just to save space</p>
  
  <pre><code>Object type  Size   Shape          Color        Texture
  Dustbin :   Large  cylindrical       greenish   coarse
  Can :       small  cylindrical       reddish    shiny
  Bottle:     small  cylindrical        reddish    shiny
  Cup :       small  cylindrical       greenish   shiny
  </code></pre>
  
  <p>Then, there is an unknown feature with crisp values X = {12cm, 52,120,11}. How do I classify it? Or is my understanding incorrect, that I need to reformulate the entire thing?</p>