Home ยป sklearn

sklearn

Solving “Found unknown categories […] in column” with sklearn OneHotEncoder

  • by
  • 1 min read

In this short blog post, I tackle an error related to a classic problem within machine learning: how to treat unseen categorical values and solve the “found unknown categories” error. Imagine you have a train and a test data set with the following values in a column: Train: [‘green’, ‘red’,…