{"id":180904,"date":"2024-05-08T20:44:58","date_gmt":"2024-05-08T12:44:58","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/180904.html"},"modified":"2024-05-08T20:45:04","modified_gmt":"2024-05-08T12:45:04","slug":"%e6%83%b3%e7%9f%a5%e9%81%93%e9%a9%ac%e6%b0%8f%e8%b7%9d%e7%a6%bb%e7%9a%84r%e8%af%ad%e8%a8%80%e4%bb%a3%e7%a0%81%e6%80%8e%e4%b9%88%e5%86%99","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/180904.html","title":{"rendered":"\u60f3\u77e5\u9053\u9a6c\u6c0f\u8ddd\u79bb\u7684R\u8bed\u8a00\u4ee3\u7801\u600e\u4e48\u5199"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27070300\/57f90832-f6fd-4517-b539-af51fe822520.webp\" alt=\"\u60f3\u77e5\u9053\u9a6c\u6c0f\u8ddd\u79bb\u7684R\u8bed\u8a00\u4ee3\u7801\u600e\u4e48\u5199\" \/><\/p>\n<p><p>\u9a6c\u6c0f\u8ddd\u79bb\uff08Mahalanobis Distance\uff09\u901a\u5e38\u7528\u4e8e\u8861\u91cf\u4e00\u4e2a\u70b9\u4e0e\u4e00\u4e2a\u5206\u5e03\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5b83\u8003\u8651\u4e86\u6570\u636e\u7279\u5f81\u4e4b\u95f4\u7684\u76f8\u5173\u6027\u3001\u662f\u4e00\u79cd\u6709\u6548\u7684\u591a\u7ef4\u7a7a\u95f4\u5185\u5ea6\u91cf\u65b9\u5f0f\u3002\u5728R\u8bed\u8a00\u4e2d\uff0c\u9a6c\u6c0f\u8ddd\u79bb\u53ef\u4ee5\u901a\u8fc7\u51e0\u4e2a\u4e0d\u540c\u7684\u51fd\u6570\u6765\u8ba1\u7b97\uff0c<strong>\u5982<code>mahalanobis()<\/code>\u51fd\u6570\u3001<code>covMcd()<\/code>\u51fd\u6570\uff08robust\u5305\u4e2d\uff09\u7b49<\/strong>\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528<code>mahalanobis<\/code>\u51fd\u6570\u8ba1\u7b97\u7684\u4e00\u4e2a\u793a\u4f8b\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-R\"># \u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb\u7684\u793a\u4f8bR\u4ee3\u7801<\/p>\n<h2><strong>\u9996\u5148\uff0c\u9700\u8981\u4e00\u4e2a\u6570\u636e\u96c6matrix\u6216data.frame\u683c\u5f0f\u4ee5\u53ca\u4e00\u4e2a\u4e2d\u5fc3\u5411\u91cf\u3002<\/strong><\/h2>\n<h2><strong>\u7136\u540e\uff0c\u8fd8\u9700\u8981\u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635\u3002<\/strong><\/h2>\n<h2><strong>\u793a\u4f8b\u6570\u636e<\/strong><\/h2>\n<p>data &lt;- matrix(c(2, 2, 4, 7, 1, 11, 5, 5, 3, 10), ncol = 2)<\/p>\n<h2><strong>\u8ba1\u7b97\u5747\u503c\u5411\u91cf(\u4e2d\u5fc3)<\/strong><\/h2>\n<p>mean_vector &lt;- colMeans(data)<\/p>\n<h2><strong>\u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635<\/strong><\/h2>\n<p>cov_matrix &lt;- cov(data)<\/p>\n<h2><strong>\u4f7f\u7528mahalanobis\u51fd\u6570\u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb<\/strong><\/h2>\n<p>distance &lt;- mahalanobis(data, center = mean_vector, cov = cov_matrix)<\/p>\n<p>print(distance)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u9996\u5148\u521b\u5efa\u4e86\u4e00\u4e2a\u6570\u636e\u96c6\uff08data\uff09\uff0c\u7136\u540e\u8ba1\u7b97\u8fd9\u4e9b\u6570\u636e\u7684\u5747\u503c\u5411\u91cf\uff08mean_vector\uff09\u548c\u534f\u65b9\u5dee\u77e9\u9635\uff08cov_matrix\uff09\u3002\u6700\u7ec8\uff0c\u5229\u7528<code>mahalanobis()<\/code>\u51fd\u6570\u548c\u8fd9\u4e9b\u4fe1\u606f\u6765\u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u6982\u8ff0\u8fd9\u4e2a\u8ba1\u7b97\u8fc7\u7a0b\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u548c\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u9a6c\u6c0f\u8ddd\u79bb\u57fa\u672c\u6982\u5ff5<\/h3>\n<\/p>\n<p><p>\u9a6c\u6c0f\u8ddd\u79bb\u7684\u6838\u5fc3\u601d\u60f3\u662f\u901a\u8fc7\u6570\u636e\u96c6\u7684\u534f\u65b9\u5dee\u7ed3\u6784\u6765\u8c03\u6574\u8ddd\u79bb\u5ea6\u91cf\uff0c\u4ece\u800c\u62b5\u6d88\u5404\u4e2a\u7279\u5f81\u4e4b\u95f4\u7684\u5c3a\u5ea6\u5dee\u5f02\u548c\u76f8\u5173\u6027\u7684\u5f71\u54cd\u3002\u76f8\u6bd4\u4e8e\u6b27\u51e0\u91cc\u5f97\u8ddd\u79bb\uff0c\u5b83\u66f4\u52a0\u9002\u7528\u4e8e\u5904\u7406\u53d8\u91cf\u4e4b\u95f4\u5177\u6709\u76f8\u5173\u6027\u7684\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><p><strong>\u901a\u8fc7\u62b5\u6d88\u5c3a\u5ea6\u5dee\u5f02\u548c\u76f8\u5173\u6027\u5f71\u54cd<\/strong>\uff0c\u9a6c\u6c0f\u8ddd\u79bb\u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u4e3a\u771f\u5b9e\u5730\u53cd\u6620\u6570\u636e\u70b9\u95f4\u5dee\u5f02\u7684\u65b9\u6cd5\u3002\u7279\u522b\u662f\u5728\u591a\u53d8\u91cf\u7edf\u8ba1\u5206\u6790\u4e2d\uff0c\u5e38\u5e38\u7528\u4e8e\u5f02\u5e38\u503c\u68c0\u6d4b\u3001\u5206\u7c7b\u7b49\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001R\u8bed\u8a00\u4e2d\u7684\u9a6c\u6c0f\u8ddd\u79bb\u8ba1\u7b97<\/h3>\n<\/p>\n<p><p>\u5728R\u8bed\u8a00\u4e2d\u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb\uff0c\u6211\u4eec\u4e3b\u8981\u901a\u8fc7<code>mahalanobis()<\/code>\u51fd\u6570\u6765\u5b9e\u73b0\u3002\u8fd9\u4e2a\u51fd\u6570\u63a5\u53d7\u4e09\u4e2a\u4e3b\u8981\u53c2\u6570\uff1a\u6570\u636e\u70b9\u96c6\u3001\u5747\u503c\u5411\u91cf\u548c\u534f\u65b9\u5dee\u77e9\u9635\u3002\u5728\u5e94\u7528\u6b64\u51fd\u6570\u524d\uff0c\u6211\u4eec\u9700\u8981\u51c6\u5907\u8fd9\u4e9b\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><p><strong>\u8ba1\u7b97\u5747\u503c\u5411\u91cf\u548c\u534f\u65b9\u5dee\u77e9\u9635<\/strong> \u662fmahalanobis\u51fd\u6570\u4f7f\u7528\u524d\u7684\u91cd\u8981\u51c6\u5907\u6b65\u9aa4\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u534f\u65b9\u5dee\u77e9\u9635\u53cd\u6620\u4e86\u6570\u636e\u7279\u5f81\u95f4\u7684\u53d8\u5f02\u548c\u5173\u8054\uff0c\u800c\u5747\u503c\u5411\u91cf\u4f5c\u4e3a\u53c2\u8003\u70b9\u53cd\u6620\u4e86\u6570\u636e\u96c6\u7684\u4e2d\u5fc3\u4f4d\u7f6e\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u9a6c\u6c0f\u8ddd\u79bb\u7684\u5b9e\u9645\u5e94\u7528<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u9a6c\u6c0f\u8ddd\u79bb\u5e7f\u6cdb\u7528\u4e8e\u591a\u79cd\u7edf\u8ba1\u5206\u6790\u573a\u666f\u3002\u7279\u522b\u662f\u5728\u5bf9\u6570\u636e\u5206\u5e03\u7684\u5f02\u5e38\u503c\u68c0\u6d4b\u4e0a\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u786e\u5b9a\u54ea\u4e9b\u6570\u636e\u70b9\u4e0e\u5206\u5e03\u7684\u4e2d\u5fc3\u5b58\u5728\u663e\u8457\u504f\u5dee\u3002<\/p>\n<\/p>\n<p><p><strong>\u5f02\u5e38\u503c\u68c0\u6d4b\u548c\u5206\u7c7b\u95ee\u9898\u4e2d\u7684\u5e94\u7528<\/strong> \u662f\u9a6c\u6c0f\u8ddd\u79bb\u6700\u5e38\u89c1\u7684\u4e24\u79cd\u7528\u9014\u3002\u901a\u8fc7\u8ba1\u7b97\u6570\u636e\u70b9\u5230\u5206\u5e03\u4e2d\u5fc3\u7684\u9a6c\u6c0f\u8ddd\u79bb\uff0c\u53ef\u4ee5\u786e\u5b9a\u5176\u4e0e\u6574\u4f53\u5206\u5e03\u7684\u4e00\u81f4\u6027\uff0c\u5bf9\u4e8e\u63a2\u6d4b\u591a\u53d8\u91cf\u5f02\u5e38\u503c\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u9a6c\u6c0f\u8ddd\u79bb\u5728<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u4e2d\u7684\u610f\u4e49<\/h3>\n<\/p>\n<p><p>\u9a6c\u6c0f\u8ddd\u79bb\u4e0d\u4ec5\u5728\u7edf\u8ba1\u5206\u6790\u4e2d\u6709\u91cd\u8981\u4f5c\u7528\uff0c\u5728\u673a\u5668\u5b66\u4e60\u9886\u57df\uff0c\u5c24\u5176\u662f\u5728\u65e0\u76d1\u7763\u5b66\u4e60\u7b97\u6cd5\u4e2d\u4e5f\u7ecf\u5e38\u4f7f\u7528\u3002\u5b83\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u6709\u6548\u7684\u76f8\u4f3c\u6027\u5ea6\u91cf\u6807\u51c6\uff0c\u4ee5\u6b64\u6765\u589e\u5f3a\u7b97\u6cd5\u5bf9\u6570\u636e\u7ed3\u6784\u7684\u7406\u89e3\u3002<\/p>\n<\/p>\n<p><p><strong>\u63d0\u5347\u6570\u636e\u70b9\u76f8\u4f3c\u6027\u5ea6\u91cf\u7684\u7cbe\u786e\u6027\u548c\u9c81\u68d2\u6027<\/strong> \u662f\u9a6c\u6c0f\u8ddd\u79bb\u5728\u673a\u5668\u5b66\u4e60\u4e2d\u7684\u5173\u952e\u4ef7\u503c\u6240\u5728\u3002\u5b83\u6709\u52a9\u4e8e\u5728\u5904\u7406\u590d\u6742\u6570\u636e\u65f6\uff0c\u5f97\u5230\u66f4\u4e3a\u51c6\u786e\u548c\u7a33\u5b9a\u7684\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001R\u8bed\u8a00\u4e2d\u76f8\u5173\u5305\u7684\u4f7f\u7528<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u57fa\u7840\u7684<code>mahalanobis()<\/code>\u51fd\u6570\u5916\uff0c\u8fd8\u6709\u591a\u4e2aR\u5305\u63d0\u4f9b\u4e86\u8fdb\u9636\u7684\u529f\u80fd\uff0c\u5982<code>robust<\/code>\u5305\u4e2d\u7684<code>covMcd()<\/code>\u51fd\u6570\u53ef\u4ee5\u8ba1\u7b97\u7a33\u5065\u7684\u534f\u65b9\u5dee\u77e9\u9635\uff0c\u8fd9\u5728\u5f02\u5e38\u503c\u8f83\u591a\u7684\u60c5\u51b5\u4e0b\u5c24\u5176\u6709\u7528\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528<code>robust<\/code>\u7b49\u5305\u6765\u5904\u7406\u5f02\u5e38\u503c\u591a\u7684\u6570\u636e\u96c6<\/strong> \uff0c\u53ef\u4ee5\u63d0\u9ad8\u9a6c\u6c0f\u8ddd\u79bb\u8ba1\u7b97\u7684\u7a33\u5b9a\u6027\u3002\u5f53\u6807\u51c6\u534f\u65b9\u5dee\u77e9\u9635\u53d7\u5230\u5f02\u5e38\u503c\u5f71\u54cd\u8f83\u5927\u65f6\uff0c\u7a33\u5065\u534f\u65b9\u5dee\u77e9\u9635\u53ef\u4ee5\u63d0\u4f9b\u66f4\u53ef\u9760\u7684\u8ddd\u79bb\u4f30\u8ba1\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u4f18\u5316\u9a6c\u6c0f\u8ddd\u79bb\u8ba1\u7b97<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u96c6\u65f6\uff0c\u76f4\u63a5\u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb\u53ef\u80fd\u4f1a\u975e\u5e38\u8017\u65f6\u3002\u4e3a\u6b64\uff0c\u53ef\u4ee5\u91c7\u53d6\u591a\u79cd\u4f18\u5316\u7b56\u7565\uff0c\u5982\u4f7f\u7528PCA\uff08\u4e3b\u6210\u5206\u5206\u6790\uff09\u964d\u7ef4\u3001\u5e76\u884c\u8ba1\u7b97\u7b49\u3002<\/p>\n<\/p>\n<p><p><strong>\u901a\u8fc7PCA\u964d\u7ef4\u3001\u5e76\u884c\u8ba1\u7b97\u7b49\u7b56\u7565\u6765\u52a0\u901f\u8ba1\u7b97<\/strong> \uff0c\u53ef\u4ee5\u5728\u4e0d\u635f\u5931\u592a\u591a\u51c6\u786e\u6027\u7684\u524d\u63d0\u4e0b\uff0c\u9ad8\u6548\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u96c6\u3002\u8fd9\u5bf9\u4e8e\u5b9e\u65f6\u7cfb\u7edf\u4e2d\u7684\u5f02\u5e38\u68c0\u6d4b\u5c24\u4e3a\u91cd\u8981\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3\u6765\u8bf4\uff0c\u9a6c\u6c0f\u8ddd\u79bb\u662f\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u591a\u7ef4\u7a7a\u95f4\u8ddd\u79bb\u5ea6\u91cf\u6307\u6807\uff0c\u5c24\u5176\u5728\u8003\u8651\u5230\u6570\u636e\u7279\u5f81\u95f4\u76f8\u5173\u6027\u53ca\u5c3a\u5ea6\u5dee\u5f02\u7684\u60c5\u5883\u4e0b\u3002\u5728R\u8bed\u8a00\u4e2d\uff0c\u901a\u8fc7<code>mahalanobis()<\/code>\u51fd\u6570\u53ef\u4ee5\u65b9\u4fbf\u5730\u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb\uff0c\u540c\u65f6\u5176\u4ed6\u9ad8\u7ea7\u5305\u4e5f\u63d0\u4f9b\u4e86\u66f4\u7a33\u5065\u6216\u4f18\u5316\u7684\u8ba1\u7b97\u65b9\u6cd5\u3002\u8fd9\u4e00\u5ea6\u91cf\u624b\u6bb5\u5728\u7edf\u8ba1\u5206\u6790\u3001\u673a\u5668\u5b66\u4e60\u548c\u6570\u636e\u6316\u6398\u7b49\u591a\u4e2a\u9886\u57df\u4e2d\u5747\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>Q1\uff1a\u6211\u8be5\u5982\u4f55\u5728R\u8bed\u8a00\u4e2d\u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb\uff1f<\/strong><\/p>\n<p>\u9a6c\u6c0f\u8ddd\u79bb\u662f\u4e00\u79cd\u5e38\u7528\u7684\u5ea6\u91cf\u4e24\u4e2a\u6837\u672c\u4e4b\u95f4\u76f8\u4f3c\u5ea6\u7684\u65b9\u6cd5\u3002\u5728R\u8bed\u8a00\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>mahalanobis()<\/code>\u51fd\u6570\u6765\u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb\u3002\u9996\u5148\uff0c\u4f60\u9700\u8981\u6307\u5b9a\u4e24\u4e2a\u6837\u672c\u7684\u6570\u636e\u77e9\u9635\u6216\u6570\u636e\u6846\u4f5c\u4e3a\u8f93\u5165\u3002\u7136\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>cov()<\/code>\u51fd\u6570\u8ba1\u7b97\u4e24\u4e2a\u6837\u672c\u7684\u534f\u65b9\u5dee\u77e9\u9635\uff0c\u5e76\u5c06\u5176\u4f5c\u4e3a<code>mahalanobis()<\/code>\u51fd\u6570\u7684\u8f93\u5165\u3002\u6700\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>mahalanobis()<\/code>\u51fd\u6570\u8ba1\u7b97\u51fa\u9a6c\u6c0f\u8ddd\u79bb\u7684\u503c\u3002<\/p>\n<p><strong>Q2\uff1a\u5982\u4f55\u4f7f\u7528R\u8bed\u8a00\u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb\u6765\u8bc4\u4f30\u6837\u672c\u76f8\u4f3c\u6027\uff1f<\/strong><\/p>\n<p>\u9a6c\u6c0f\u8ddd\u79bb\u662f\u4e00\u79cd\u5e38\u7528\u7684\u7528\u4e8e\u8bc4\u4f30\u6837\u672c\u76f8\u4f3c\u6027\u7684\u6307\u6807\uff0c\u53ef\u4ee5\u7528\u6765\u6bd4\u8f83\u4e24\u4e2a\u6837\u672c\u4e4b\u95f4\u7684\u76f8\u4f3c\u7a0b\u5ea6\u3002\u5728R\u8bed\u8a00\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>mahalanobis()<\/code>\u51fd\u6570\u6765\u8ba1\u7b97\u9a6c\u6c0f\u8ddd\u79bb\u3002\u9996\u5148\uff0c\u4f60\u9700\u8981\u51c6\u5907\u597d\u4e24\u4e2a\u6837\u672c\u7684\u6570\u636e\uff0c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u6570\u636e\u77e9\u9635\u6216\u6570\u636e\u6846\u7684\u5f62\u5f0f\u3002\u7136\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>cov()<\/code>\u51fd\u6570\u8ba1\u7b97\u4e24\u4e2a\u6837\u672c\u7684\u534f\u65b9\u5dee\u77e9\u9635\uff0c\u5e76\u5c06\u5176\u4f5c\u4e3a<code>mahalanobis()<\/code>\u51fd\u6570\u7684\u8f93\u5165\u3002\u6700\u540e\uff0c\u4f60\u53ef\u4ee5\u5f97\u5230\u4e24\u4e2a\u6837\u672c\u4e4b\u95f4\u7684\u9a6c\u6c0f\u8ddd\u79bb\u503c\uff0c\u8fdb\u800c\u8bc4\u4f30\u5b83\u4eec\u7684\u76f8\u4f3c\u6027\u3002<\/p>\n<p><strong>Q3\uff1a\u5982\u4f55\u4f7f\u7528R\u8bed\u8a00\u8ba1\u7b97\u591a\u4e2a\u6837\u672c\u4e4b\u95f4\u7684\u5e73\u5747\u9a6c\u6c0f\u8ddd\u79bb\uff1f<\/strong><\/p>\n<p>\u5e73\u5747\u9a6c\u6c0f\u8ddd\u79bb\u662f\u4e00\u79cd\u5e38\u7528\u7684\u5ea6\u91cf\u591a\u4e2a\u6837\u672c\u4e4b\u95f4\u7684\u76f8\u4f3c\u6027\u7684\u65b9\u6cd5\u3002\u5728R\u8bed\u8a00\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>mahalanobis()<\/code>\u51fd\u6570\u8ba1\u7b97\u6bcf\u4e2a\u6837\u672c\u4e0e\u5176\u4ed6\u6837\u672c\u4e4b\u95f4\u7684\u9a6c\u6c0f\u8ddd\u79bb\u3002\u7136\u540e\uff0c\u4f60\u53ef\u4ee5\u5c06\u6240\u6709\u7684\u9a6c\u6c0f\u8ddd\u79bb\u503c\u6c42\u548c\uff0c\u5e76\u9664\u4ee5\u6837\u672c\u6570\u91cf\u51cf\u4e00\uff0c\u5f97\u5230\u591a\u4e2a\u6837\u672c\u4e4b\u95f4\u7684\u5e73\u5747\u9a6c\u6c0f\u8ddd\u79bb\u3002\u5177\u4f53\u7684\u5b9e\u73b0\u6b65\u9aa4\u662f\uff1a\u9996\u5148\uff0c\u51c6\u5907\u597d\u591a\u4e2a\u6837\u672c\u7684\u6570\u636e\uff0c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u6570\u636e\u77e9\u9635\u6216\u6570\u636e\u6846\u7684\u5f62\u5f0f\u3002\u7136\u540e\uff0c\u4f7f\u7528<code>cov()<\/code>\u51fd\u6570\u8ba1\u7b97\u6837\u672c\u7684\u534f\u65b9\u5dee\u77e9\u9635\u3002\u63a5\u4e0b\u6765\uff0c\u4f7f\u7528<code>mahalanobis()<\/code>\u51fd\u6570\u8ba1\u7b97\u6bcf\u4e2a\u6837\u672c\u4e0e\u5176\u4ed6\u6837\u672c\u4e4b\u95f4\u7684\u9a6c\u6c0f\u8ddd\u79bb\uff0c\u5e76\u5c06\u5176\u5b58\u50a8\u4e3a\u4e00\u4e2a\u77e9\u9635\u3002\u6700\u540e\uff0c\u6c42\u51fa\u6240\u6709\u7684\u9a6c\u6c0f\u8ddd\u79bb\u503c\u7684\u5e73\u5747\u503c\uff0c\u5373\u53ef\u5f97\u5230\u591a\u4e2a\u6837\u672c\u4e4b\u95f4\u7684\u5e73\u5747\u9a6c\u6c0f\u8ddd\u79bb\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u9a6c\u6c0f\u8ddd\u79bb\uff08Mahalanobis Distance\uff09\u901a\u5e38\u7528\u4e8e\u8861\u91cf\u4e00\u4e2a\u70b9\u4e0e\u4e00\u4e2a\u5206\u5e03\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5b83\u8003\u8651\u4e86\u6570\u636e\u7279\u5f81\u4e4b [&hellip;]","protected":false},"author":3,"featured_media":180920,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/180904"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=180904"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/180904\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/180920"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=180904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=180904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=180904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}