允许概率作为黄金标准的逻辑回归

Logistic regression that allows a probability as gold standard

是否有任何 python 逻辑回归的实现,它允许将概率作为目标(即黄金标准)。

我的数据如下(第一到三列:特征,第四列:黄金标准):

32 453 65 0.55
15 34 222 0.88
33 66 161 0.76

scikit-learn and graphlab 似乎只允许 0 或 1 作为目标。

特别是如果您对最后一列中的概率是如何估计的有直觉,您可以尝试在其 sample_weight 参数中使用 weighted logistic regression. In scikit-learn, you would calculate the sample weights as detailed in that stats answer and pass it to the LogisticRegression.fit method

在没有关于概率代表什么的任何进一步信息的情况下,您可以将数据集转换为如下所示:

32 453 65 0, sample_weight = 45
32 453 65 1, sample_weight = 55
15 34 222 0, sample_weight = 12
15 34 222 1, sample_weight = 88
33 66 161 0, sample_weight = 24
33 66 161 1, sample_weight = 76