Convert group of categorial variables and continuous variable into one continuous variable

14 Views Asked by At

I have some objects with three properties (a, b, c):

  • a = 1 or 2
  • b = 1 or 2
  • c = 1..n

I need a function (example: score(a, b, c)) to generate score (integer value) for each object with a rule (priority descending):

  1. if a1 > a2 => score(a1, b1, c1) > score(a2, b2, c2): don't care about b1, b2, c1, c2
  2. if b1 > b2 => score(a, b1, c1) > score(a, b2, c2): don't care about c1, c2
  3. if c1 > c2 => score(a, b, c1) > score(a, b, c2): just compare c1, c2

Thank in advance for any idea.