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

标签 python machine-learning logistic-regression

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

我的数据如下(第一到三列:features,第四列:gold standard):

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

scikit-learngraphlab似乎只允许 0 或 1 作为目标。

最佳答案

特别是如果您对最后一列中的概率是如何估计的有直觉,您可以尝试使用 weighted logistic regression .在 scikit-learn 中,您将计算该统计答案中详述的样本权重并将其传递给 LogisticRegression.fit method在其 sample_weight 参数中。

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

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

关于python - 允许概率作为黄金标准的逻辑回归,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41955713/

相关文章:

python - 具有神经网络思维模式的简单逻辑回归

python - Sklearn 和 StatsModels 给出了截然不同的逻辑回归答案

python - 无法在 Google Datalab Jupyter 笔记本中安装 pyproj 模块

python - 如何解析多个xml文件并将属性传递给csv?

python - 为什么 BeautifulSoup (在 Python 脚本中)只返回 HTML 中的一些数字

algorithm - 传感器数据的二元分类

r - 如何使用 spread() reshape 数据框时解决错误

python - Scikit-learn 的特征选择回归

python - 管道在 sklearn python 中给出不同的答案

python - python 3.5 中的回溯