如何计算数据框pandas-python中特征的条件概率?

时间:2020-01-04 13:24:58

标签: python machine-learning

假设我有以下数据集:

              headache    diabetes    pressure      case                       

patient 1        0          1            1           sick
........         .          .            .              .
.........        .          .            .              .
patient n        0          0           0            not sick

如何计算python中三个属性的后验概率和条件概率? 我使用了以下代码:

我有错误:

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
TypeError: '(slice(None, None, None), 0)' is an invalid key

0 个答案:

没有答案