What would be the best machine learning approach for sets of varying sizes?
This could be modeled as multi-label classification.  The features are nominal values, and the targets are the presence or absence of nominal values.
There are wide variety of algorithms that can learn multi-label classification. The &quot;best&quot; one is empirical question that depends on the specific dataset. One popular option is random forest classifier.
There is also a &quot;strict&quot; version of problem where each combination is considered a unique label. Then it would be multi-class classification. But the targets might be too sparse to learn.