嗨,我在R中使用Apriori模型来找到关联规则。 模型输出如下:
id lhs rhr support confidence lift
1 {BENEFIT SERVICE,ERBORIAN} {BENEFIT} 0.001362644 0.6163793 2.557921
2 {BENEFIT SERVICE,MAKE UP FOR EVER} {BENEFIT} 0.002982571 0.6113281 2.536959
3 {BENEFIT SERVICE,CLARINS} {BENEFIT} 0.002649057 0.5914894 2.454629
我的目标是拆分lhs列,并实际一致地复制另一列。
如下:
id lhs rhr support confidence lift
1 BENEFIT SERVICE BENEFIT 0.001362644 0.6163793 2.557921
1 ERBORIAN BENEFIT 0.001362644 0.6163793 2.557921
2 BENEFIT SERVICE BENEFIT 0.002982571 0.6113281 2.536959
2 MAKE UP FOR EVER BENEFIT 0.002982571 0.6113281 2.536959
3 BENEFIT SERVICE BENEFIT 0.002649057 0.5914894 2.454629
3 CLARINS BENEFIT 0.002649057 0.5914894 2.454629
知道如何进行这种数据处理吗? 预先感谢