<pre><code>What is the best way to handle missing values in data set?
</code></pre>
<p>没有最好的方法,每个解决方案/算法都有各自的优缺点(您甚至可以将其中的一些组合在一起,以创建自己的策略,并调整相关参数,得出一个最能满足您的数据的结果,有很多关于此主题的研究/论文)。</p>
<p>例如,<strong>平均插补</strong>快速而简单,但它会低估方差,并且用平均值替换NaN会扭曲分布形状,而<strong>KNN插补</strong>在时间复杂度方面,在大型数据集中可能不是理想的,因为它迭代所有数据点并执行计算每个NaN值,假设NaN属性与其他属性相关。</p>
<pre><code>How to handle missing values in datasets before applying machine learning algorithm??
</code></pre>
<p>除了您提到的<em>平均插补</em>之外,您还可以查看<em>K-最近邻插补</em>和<em>回归插补</em>,并参考<a href="http://scikit-learn.org/stable/" rel="noreferrer">scikit-learn</a>中强大的<a href="http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.Imputer.html" rel="noreferrer">Imputer</a>类来检查要使用的现有api。</p>
<p><strong>KNN插补</strong></p>
<p>计算该NaN点最近邻k的平均值。</p>
<p><strong>回归插补</strong></p>
<p>一个回归模型被估计为基于其他变量预测一个变量的观测值,然后该模型被用于在该变量缺失的情况下估算值。</p>
<p><a href="http://scikit-learn.org/stable/modules/preprocessing.html#imputation-of-missing-values" rel="noreferrer">Here</a>链接到scikit的“<em>缺失值的估算”</em>部分。
我也听说过<a href="http://orange.biolab.si/docs/latest/reference/rst/Orange.feature.imputation.html" rel="noreferrer">Orange</a>图书馆,但还没有机会使用它。</p>