如何在分类数据中填充缺失值?
我有一个由20000名员工组成的数据集,该数据集以下有三列缺少价值的列:
- 通过大学
- 专业
- 的大学名称
,现在我有10000名员工从未上过大学。我的最终目标是预测他们的薪水。
在这种情况下,如何填充缺失值。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我有一个由20000名员工组成的数据集,该数据集以下有三列缺少价值的列:
,现在我有10000名员工从未上过大学。我的最终目标是预测他们的薪水。
在这种情况下,如何填充缺失值。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
这是一个值得考虑的选择(有很多方法可以解决此类问题)。
结果:
结果:
示例数据集:
查看此链接以获取更多信息。
Here's one option to consider (there are many ways to handle this kind of problem).
Result:
Result:
Sample Data Set:
Take a look at this link for more info.
https://www.analyticsvidhya.com/blog/2021/04/how-to-handle-missing-values-of-categorical-variables/
丢失值可以处理多种方式,遵循的方式取决于您拥有的数据。
用缺失值删除行
行具有更多数量的列值,因为可以删除空。 (同样,完全取决于个人用例)
将缺失的vlaues归纳为平均 /中位数< / p>
对于数值列,您可以尝试通过列出列值的平均值 /中位数来替换缺失值。< / p>
最常见的值:适用于您的方案
此方法适用于我认为是您的情况的分类数据。您可以尝试在所有三列中替换所有三列中缺少的Vlaues,并在给定的列中最常发生的值。
Missing values can be dealt with number of ways, which way to follow depends on the kind of data you have.
Deleting the rows with missing values
Rows with more number of column values as null could be dropped. (Again what is exactly more number depends on individual use case)
Imputing the missing vlaues with Mean / Median
For the numerical Columns you can try replacing the missing values by taking Mean / Median of the column values.
Most frequent Values: Applicable to your Scenario
This method is suitable for Categorical data which i assume is your case. You can try replacing missing vlaues in all three Columns with the most frequently occuring value in the given column.