1

如果这是我的数据集的快照。

Row   Group   x      y      z        Survive
  1   1      0.0680 0.8701 0.0619    78.43507
  2   1      0.9984 0.0016 0.0000    89.55533
  3   1      0.4146 0.5787 0.0068    85.35468
  4   2      0.3910 0.6016 0.0074    67.49987
  5   2      0.3902 0.6023 0.0075    81.87669   
  6   2      0.0621 0.8701 0.0678    27.26777

如何计算 Group1 中每行/观察值与 Group 2 中每个观察值之间的马氏距离?

Row1-Group1 { Row4-Group2 , Row5-Group2 , Row6-Group2 }

Row2-Group1 { Row4-Group2 , Row5-Group2 , Row6-Group2 }

Row3-Group1 { Row4-Group2 , Row5-Group2 , Row6-Group2 }

像这样的东西

         r4g2    r5g2    r6g2
r1g1    0.4235  0.4225  0.0083
r2g1    0.8538  0.8549  1.2789
r3g1    0.0329  0.0340  0.4614
4

0 回答 0