0

I have an attribute that can have 3 values. Should my line be as

+1 1:(0,0,1) 2:90
-1 1:(1,0,0) 2:67
.....
KKa
  • 408
  • 4
  • 19

1 Answers1

1

If you have a feature with more than one dimension you must split it to multiple one dimensional features.

+1 1:0 2:0 3:1 4:90
-1 1:1 2:0 3:0 4:67
.....

If you have a feature with categorical values (0=Mercedes, 1=Ferrari, 2=Williams) you should split this feature of n values into n boolean features. e.g. feature 1 (F1 team)

+1 1:0 2:...
-1 1:1 2:...
-1 1:2 2:...
...

should be split into 3 features (1 is_Mercedes, 2 is_Ferrari, 3 is_Williams)

+1 1:1 2:0 3:0 4:...
-1 1:0 2:1 3:0 4:...
-1 1:0 2:0 3:1 4:...
...
stefan
  • 3,681
  • 15
  • 25