多重插补 均值插补

Understanding the Mean /Median Imputation and Implementation using feature-engine….!

了解使用特征引擎的均值/中位数插补和实现…。!

均值或中位数插补: (Mean or Median Imputation:)

The mean or median value should be calculated only in the train set and used to replace NA in both train and test sets. To avoid over-fitting

平均值或中位数应仅在训练集中进行计算,并用于代替训练和测试集中的NA。 避免过度拟合

均值/中位数插补:定义: (Mean / Median imputation: definition:)

Mean/median imputation consists of replacing all occurrences of missing values (NA) within a variable by the mean or median.

均值/中位数推算包括用均值或中位数替换变量中所有缺失值(NA)的出现。

我可以使用均值/中位数插补估算哪些变量? (Which variables can I impute with Mean / Median Imputation?)

· The mean and median can only be calculated on numerical variables, therefore, these methods are suitable for continuous and discrete numerical variables only.

·平均值和中位数只能通过数值变量来计算,因此,这些方法仅适用于连续和离散数值变量。

Mean/Median Imputation
均值/中位数插补

假设: (Assumptions:)

1. Data is missing completely at random (MCAR)

1.数据完全随机丢失(MCAR)

2. The missing observations, most likely look like the majority of the observations in the variable (aka, the mean/median)

2.缺失的观测值,很可能看起来像变量中的大多数观测值(aka,均值/中位数)

3. If data is missing completely at random, then it is fair to assume that the missing values are most likely very close to the value of the mean or the median of the distribution, as these represent the most frequent/average observation.

3.如果数据完全随机丢失,则可以假设丢失值很可能非常接近均值或分布中值,因为它们代表了最频繁/平均的观察值。

优点: (Advantages:)

  • Easy to implement.易于实现。
  • Fast way of obtaining complete datasets.快速获取完整数据集的方法。
  • Can be integrated into production (during model deployment).可以集成到生产中(在模型部署期间)。

局限性: (Limitations:)

  • Distortion of the original variable distribution.原始变量分布失真。
  • Distortion of the original variance.原始方差的失真。
Distortion of Variance
方差失真
  • Distortion of the covariance with the remaining variables of the dataset数据集其余变量的协方差失真
Distortion of CoVariance
协方差失真

When replacing NA with the mean or median, the variance of the variable will be distorted if the number of NA is big respect to the total number of observations, leading to underestimation of the variance.

当用均值或中位数替换NA时,如果NA的数量相对于观察总数而言很大,则变量的方差将失真,从而导致方差的低估。

Besides, estimates of covariance and correlations with other variables in the dataset may also be affected. Mean / median imputation may alter intrinsic correlations since the mean / median value that now replaces the missing data will not necessarily preserve the relationship with the remaining variables.

此外,数据集中其他变量的协方差和相关性估计也会受到影响。 均值/中位数估算值可能会更改内在相关性,因为现在替换缺失数据的均值/中位数值不一定会保留与其余变量的关系。

Finally, concentrating all missing values at the mean / median value may lead to observations that are common occurrences in the distribution, to be picked up as outliers.

最后,将所有缺失值集中在平均值/中值可能会导致分布中常见的观测值,被当作异常值。

何时使用均值/中位数推算? (When to use mean/median imputation?)

· Data is missing completely at random.

·数据完全随机丢失。

· No more than 5% of the variable contains missing data.

·包含丢失数据的变量不超过5%。

· Although in theory, the above conditions should be met to minimize the impact of this imputation technique, in practice, mean/median imputation is very commonly used, even in those cases when data is not MCAR and there are a lot of missing values. The reason behind this is the simplicity of the technique.

·尽管从理论上讲,应满足上述条件以最大程度地减少这种插补技术的影响,但实际上,即使在数据不是MCAR且存在许多缺失值的情况下,均值插补/中位数插补也是非常常用的。 其背后的原因是该技术的简单性。

Typically, mean/median imputation is done together with adding a binary “missing indicator” variable to capture those observations where the data was missing.

通常,均值/中位数估算与添加二进制“缺失指标”变量一起进行,以捕获数据丢失的那些观测值。

If the data were missing completely at random, this would be captured by the mean /median imputation, and if it wasn’t this would be captured by the additional “missing indicator” variable. Both methods are extremely straight forward to implement, and therefore are a top choice in data science competitions.

如果数据完全随机丢失,则将通过均值/中位数插值来捕获,如果不是,则将通过附加的“缺失指标”变量来捕获。 两种方法都非常容易实现,因此是数据科学竞赛中的首选。

请注意以下几点: (Note the following:)

1. If a variable is normally distributed, the mean, median, and mode, are approximately the same. Therefore, replacing missing values by the mean and the median are equivalent. Replacing missing data by the mode is not common practice for numerical variables.

1.如果变量为正态分布,则均值,中位数和众数大致相同。 因此,用均值和中位数代替缺失值是等效的。 对于数字变量,用这种模式替换丢失的数据并不常见。

2. If the variable is skewed, the mean is biased by the values at the far end of the distribution. Therefore, the median is a better representation of the majority of the values in the variable.

2.如果变量偏斜,则均值会受到分布远端的值的偏倚。 因此,中位数可以更好地表示变量中的大多数值。

Skewed Distribution
分布偏斜

实作 (Implementation)

Let’s discuss in the comments if you find anything wrong in the post or if you have anything to add:PThanks.

如果您在帖子中发现任何错误或有任何要添加的内容,请在评论中进行讨论:谢谢。

Give a Clap
拍手

翻译自: https://medium.com/analytics-vidhya/feature-engineering-part-1-mean-median-imputation-761043b95379

多重插补 均值插补


http://www.taodudu.cc/news/show-997398.html

相关文章:

  • 客户行为模型 r语言建模_客户行为建模:汇总统计的问题
  • 多维空间可视化_使用GeoPandas进行空间可视化
  • 机器学习 来源框架_机器学习的秘密来源:策展
  • 呼吁开放外网_服装数据集:呼吁采取行动
  • 数据可视化分析票房数据报告_票房收入分析和可视化
  • 先知模型 facebook_Facebook先知
  • 项目案例:qq数据库管理_2小时元项目:项目管理您的数据科学学习
  • 查询数据库中有多少个数据表_您的数据中有多少汁?
  • 数据科学与大数据技术的案例_作为数据科学家解决问题的案例研究
  • 商业数据科学
  • 数据科学家数据分析师_站出来! 分析人员,数据科学家和其他所有人的领导和沟通技巧...
  • 分析工作试用期收获_免费使用零编码技能探索数据分析
  • 残疾科学家_数据科学与残疾:通过创新加强护理
  • spss23出现数据消失_改善23亿人口健康数据的可视化
  • COVID-19研究助理
  • 缺失值和异常值的识别与处理_识别异常值-第一部分
  • 梯度 cv2.sobel_TensorFlow 2.0中连续策略梯度的最小工作示例
  • yolo人脸检测数据集_自定义数据集上的Yolo-V5对象检测
  • 图深度学习-第2部分
  • 量子信息与量子计算_量子计算为23美分。
  • 失物招领php_新奥尔良圣徒队是否增加了失物招领?
  • 客户细分模型_Avarto金融解决方案的客户细分和监督学习模型
  • 梯度反传_反事实政策梯度解释
  • facebook.com_如何降低电子商务的Facebook CPM
  • 西格尔零点猜想_我从埃里克·西格尔学到的东西
  • 深度学习算法和机器学习算法_啊哈! 4种流行的机器学习算法的片刻
  • 统计信息在数据库中的作用_统计在行业中的作用
  • 怎么评价两组数据是否接近_接近组数据(组间)
  • power bi 中计算_Power BI中的期间比较
  • matplotlib布局_Matplotlib多列,行跨度布局

多重插补 均值插补_Feature Engineering Part-1均值/中位数插补。相关推荐

  1. 【Android 逆向】函数拦截实例 ( ② 插桩操作 | 保存实际函数入口 6 字节数据 | 在插桩的函数入口写入跳转指令 | 构造拼接桩函数 )

    文章目录 前言 一.函数拦截需要的几个参数 二.插桩前先保存实际函数入口 6 字节数据 三.在插桩的函数入口写入跳转指令 | 构造拼接桩函数 前言 [Android 逆向]函数拦截实例 ( 函数拦截流 ...

  2. linux补齐命令,Linux中10个有用的命令行补齐命令

    在Linux系统中,输入一个命令,再按两次TAB键,就会列出所有以输入字符开头的可用命令.这并不新鲜,很可能你已经知道了这个.这个功能被称作命令补全.默认情况下,bash命令行可以自动补全文件或目录名 ...

  3. shell 补齐路径_Linux中10个有用的命令行补全例子

    在 Linux 系统中,当你输入一个命令,再按两次TAB 键,就会列出所有以你输入字符开头的可用命令.这并不新鲜,可能你已经知道了.这个功能被称作命令行补全bash completion.默认情况下, ...

  4. 广东专插本有计算机专业的学校,2021年广东专插本有哪些学校 哪几所通过率更高...

    每年的专插本招生学校都不会有太大的变动,准备参加2021年专插本考试的学生,可以参考一下今年的招生学校以及招生专业来寻找自己的报考学校以及专业的方向. 广东2021年专插本招生院校有哪些 在2020年 ...

  5. seaborn可视化displot绘制直方图(histogram)并通过axvline函数在直方图中添加均值(mean)竖线(自定义均值竖线色彩)

    seaborn可视化displot绘制直方图(histogram)并通过axvline函数在直方图中添加均值(mean)竖线(自定义均值竖线色彩) 目录

  6. em模型补缺失值_GitHub - iiphenoix/PPCA-EM-BPCA-Mean: 均值-EM-BPCA-PPCA算法的缺失值(4种)插补...

    1.实验(first模块) ①删除特殊字符:代码在first包里的Prepare.py. ②EM算法插值:代码操作如first包里的em.py所示,并且调用了toencoding.py代码 ③多重插值 ...

  7. 树上动态插点 ---- F. Imbalance Value of a Tree(树上动态插点 + 并查集)

    题目链接 题目大意: 定义I(x,y)为x到y路径上最大值和最小值之差I(x,y)为x到y路径上最大值和最小值之差I(x,y)为x到y路径上最大值和最小值之差 现在叫你求∑i=1n∑j=inI(x,y ...

  8. vs代码补全的快捷键_一款Python编程的自动补全插件神器——kite

    最近发现了一款Python编程的插件神器--kite,相见恨晚啊,它是一款基于AI技术的自动补全功能插件,可用于大部分的Python编程环境,如PyCharm.VSCode.Vim.Sublime T ...

  9. java前补零工具类_java生成编码工具类,不足补0

    ~~~~~ 小小工具类!你值得拥有 简单粗暴,直接上代码 import java.text.NumberFormat; /** * @author: Abner * @description: 编码工 ...

最新文章

  1. 14、Docker监控方案(Prometheus+cAdvisor+Grafana)
  2. 通俗易懂解释一下C++的构造函数是怎样的呢?
  3. python弹球小游戏程序_Python基于Tkinter模块实现的弹球小游戏
  4. android 屏幕旋转不重新加载,Android webview旋转屏幕导致页面重新加载问题解决办法...
  5. 《C专家编程》第二章——这不是Bug,而是语言特性
  6. s8050三极管经典电路_曝光一个产品级的红外发射电路
  7. Fish Redux 使用指南
  8. docker部署ubuntu并连接ssh远程调试代码
  9. aop 获取方法入参出参_Spring AOP 如何将参数传递给需要织入的方法
  10. Theano 中文文档 0.9 - 5.3 Windows安装说明
  11. 堆中的路径(MOOC)
  12. BXP无盘Windows XP网吧系统好处(转)
  13. 【Tableau Desktop 企业日常问题20】Tableau怎么折线变虚线?
  14. vagex挂机php,免费Docker容器来挂机Vagex赚美刀
  15. 代码 todo 忘记_永远不要忘记您的仓库项目经理tickgit的TODO评论
  16. 阿里云镜像站repo文件
  17. funcode实验--海底世界(c++实现)
  18. linux服务器集群群发邮件,爱博邮件群发服务器(Linux版本)
  19. Roson的Qt之旅 #114 QML Repeater(重复器)
  20. js中的debugger调试

热门文章

  1. 海龟绘图小动物_震惊!被塑料绳勒成两半的海龟
  2. 华为照片在哪个文件夹_原来华为手机还能这样清理垃圾,怪不得你的手机可以多用5年...
  3. NuGet 无法连接到远程服务器-解决方法(转)
  4. CODE[VS] 1621 混合牛奶 USACO
  5. 关于Tensorflow安装opencv和pygame
  6. weblogic启动失败案例(root启动引起的权限问题)
  7. 408. Valid Word Abbreviation
  8. PHP 小数点保留两位【转】
  9. jQuery datepicker和jQuery validator 共用时bug
  10. Algorithm I assignment Collinear