I have two data sets - Product to Features and Products to Parts

A = { (P1, F1, F2, F3), (P2, F2, F4, F6), (P3, F1, F6, F8)...}
B = { (P1, M1, M2, M3), (P2, M4, M7), (P3, M1, M5, M7, M9, M10)..}


P1, P2, P3... are products
F1, F2, F3... are features
M1, M2, M3... are parts used in building products.

Is it possible to come up with relationship amongst features and parts?

e.g. (F1, M1, M2), (F2, M1, M4, M6)... and so on?

  • $\begingroup$ Are you looking to join two datasets on one aspect (product id I'm guessing)? $\endgroup$ Commented Apr 1, 2019 at 22:39
  • $\begingroup$ Yes, that is the idea. Is there any data science method that can take such metrics and come up with a possible association/correlation? $\endgroup$ Commented Apr 2, 2019 at 15:23

2 Answers 2


I think you may be able to shed light on relationships between features and parts using association rule learning. You can treat the parts and features similarly to items in a market basket.


A = {('P1', 'F1', 'F2', 'F3'),
     ('P2', 'F2', 'F4', 'F6'),
     ('P3', 'F1', 'F6', 'F8')}

B = {('P1', 'M1', 'M2', 'M3'),
    ('P2', 'M4', 'M7'),
    ('P3', 'M1', 'M5', 'M7', 'M9', 'M10')}

parts = {'P1','P2','P3'}

basket = {}
for k in parts:
    temp = []
    for a in A:
        if k in a:
            temp += list(a)
    for b in B:
        if k in b:
            temp += list(b)
    basket[k] = temp

Then use each value in the basket dictionary as a basket.

  • $\begingroup$ would association rule apply across sets or only within a set (like the example they use - items in a given sales transaction and their relationship) $\endgroup$ Commented Apr 2, 2019 at 15:09
  • $\begingroup$ I would combine the features and parts that correspond to each product, and treat each product's features and parts as one basket. $\endgroup$
    – KT12
    Commented Apr 3, 2019 at 1:47
  • $\begingroup$ Great.. This makes sense. I will give it a try. Thanks @KT12 $\endgroup$ Commented Apr 22, 2019 at 2:19

It totally depends on how the features are related to the parts.

If they related, you can form a bi-partite graph of (features-parts) for every product. Bi-Partitie graph can be formed if there are no relations between Features and Products among themselves.

enter image description here

If the relation for you is not correct, you can always form a tupled relation.

{p1: (f1, m1), (f2, m1)}

this finally depends on your dataset and the relation it has among themselves.

  • $\begingroup$ There is definitely a relationship "HAS" between product and features. There is no explicit relationship between features and corresponding parts to implement the feature. Goal is to derive the same using above 2 sets. $\endgroup$ Commented Apr 2, 2019 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.