利用一个或两个特征建立预测模型

2024-04-26 23:07:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我有如下数据

你知道吗测向头()

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

Tags: 数据name模型statuslocationactivedurationtim