我有一个不同类型的容器表(df_1)。我有另一张表,上面列出了它们所包含的内容(df_2)。我想评估df_1的哪些行更有可能被归类为其真实类型,这取决于它们所包含的内容是否是该类型容器的典型内容
df_1 = pd.DataFrame({'Container' : [1,2,3,4,5,6,7,8],
'Type' : ['Box','Bag','Bin','Bag','Bin','Box','Bag','Bin']})
df_2 = pd.DataFrame({'Container' : [1,1,1,1,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8],
'Item' : ['Ball','Ball','Brain','Ball','Ball','Baloon','Brain','Ball','Ball','Baloon','Brain','Ball','Ball','Baloon','Brain','Ball','Ball','Baloon','Bomb','Ball','Ball','Baloon','Brain','Ball','Ball','Bomb']})
以下方法考虑每个容器的内容是否为该类型的典型内容。它对在其他容器中发现的物品(阳性)和在其他容器中未发现的物品(阴性)给予同等的重量。它忽略在其他容器中找到项目的频率。它还忽略了内容物是否是另一种容器的典型。 我认为这种方法会扩大规模
相关问题 更多 >
编程相关推荐