0

I have labels that are one-hot encoded. I would like to use them to train and predict with a catboost classifier. However, it is giving me an error when I am fitting, saying that multiple integer values are not allowed per row for the labels. So does catboost not allow one-hot encoding for the labels? If not, how can I get catboost to work?

Bob Dalgleish
  • 8,167
  • 4
  • 32
  • 42
TanMath
  • 598
  • 1
  • 9
  • 27

2 Answers2

0

I have found a workaround to this problem. There might be a better solution to this problem, which I would love to hear about.

The workaround is to convert the one-hot encoding to categorical values. Of course, most of the time, we take our categorical values and convert to one-hot encoding. So just don't do this step.

Then, set the loss function to 'MultiClass'. This is the only loss function that catboost (and I think most gradient boosting packages) will support for multiclassification.

TanMath
  • 598
  • 1
  • 9
  • 27
0

catboost does the factors encoding automatically internally, no need to do it manually

todorp
  • 1
  • 1