I have a dataset where one of the features is a list. Example:

  ... other features ...
  X: ['joey', 'monica', 'ross']
  ... other features ...
  X: ['chandler', 'rachel', 'joey', 'phoebe']
  ... more records ...

Feature X in the example can be of different lengths(let's say [0,50]). The domain for the values in X is of 200 different values.

How should I handle X?


EDIT: More information about what X is. I'm trying to cluster failed software tests. Each test might fail in a different component. X is a list of failed components. What I'm trying to understand is how to represent this list of failed components in the vector of each data point.

  • 1
    $\begingroup$ What do you mean by "How should I handle X?"? What's your problem? Are you asking how to compare the feature vectors X? Maybe you should describe what X is supposed to represent. It seems to be a list of names, but do they have any meaning. You should probably describe your dataset more in detail and what you're using now to cluster it. Do you want to cluster it based on what? $\endgroup$
    – nbro
    May 4, 2022 at 10:21
  • 1
    $\begingroup$ Hi, I've added more information about what X is. $\endgroup$ May 4, 2022 at 11:26

1 Answer 1


You essentially want to have a numerical value to represent the similarity of the lists of two distinct objects. There are a number of metrics to deal with that, eg the Jaccard Index or Dice's Coefficient.

Which one is the best for you depends on the exact properties and your use case.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .