我有数据如下所示
df.head()
name location duration month status
aim bgy 12 active
terra pm 3 inactive
jerry bgy 23 inactive
finn dm 8 active
pearl bgy 21 active
doe pm 9 inactive
pearl pm 11 inactive
我拥有近 2000 个数据点和大约 6 个唯一的位置名称。我需要构建/训练一个预测模型,在给定任何名称、位置、当前持续时间详细信息的情况下,它应该以概率%预测状态(事件/非事件) 所以如果这个模型的输入是
name location duration month
jim bgy 6
tim pm 9
sara bgy 12
我应该得到类似的结果
name location duration month status active_probability
jim bgy 6 active 0.9
tim pm 9 inactive 0.0
sara bgy 12 active 0.8
最佳答案
您可以尝试使用 LightGBM。它非常易于使用并且运行速度非常快。
关于python - 仅使用一两个特征构建预测模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52947610/