将调查答案(字符串)转换为数值,以便在python中进行逻辑回归算法

时间:2019-09-16 20:36:51

标签: python algorithm data-science prediction

我正在尝试建立客户流失预测算法。我正在使用包含人口统计数据和家庭数据的数据集。一些数据包含我想用作算法一部分的字符串。如何将字符串转换为数值以提供算法?注意-这些不是简单的“男性/女性”选择,但有许多不同的答案

例如:

schooling               marital status              mosaic segment
Bach Degree - Likely    Married - Extremely Likely  Generational Soup
Bach Degree - Likely    Married - Extremely Likely  Sports Utility Families
Some College - Likely   Single - Likely             Urban Edge
Grad Degree - Likely    Single - Likely             Urban Survivors

0 个答案:

没有答案