# Establish relationship between two sets of data

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)..}


where:

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?

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

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.

Updated:

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'}

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)
temp.remove(k)


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

• 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) Commented Apr 2, 2019 at 15:09
• I would combine the features and parts that correspond to each product, and treat each product's features and parts as one basket.
– KT12
Commented Apr 3, 2019 at 1:47
• Great.. This makes sense. I will give it a try. Thanks @KT12 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.

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.

• 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. Commented Apr 2, 2019 at 15:07