{"id":9,"date":"2024-03-20T01:32:00","date_gmt":"2024-03-20T01:32:00","guid":{"rendered":"https:\/\/hhyblog.top\/?p=4"},"modified":"2024-09-13T18:16:12","modified_gmt":"2024-09-13T10:16:12","slug":"4","status":"publish","type":"post","link":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/","title":{"rendered":"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52"},"content":{"rendered":"<blockquote><p>\u5076\u7136\u89c1\u5230\u77e5\u4e4e\u91cc\u9762\u4e00\u7bc7\u5173\u4e8e\u673a\u5668\u5b66\u4e60\u4e2d\u7684\u4e09\u79cd\u56de\u5f52\u7b97\u6cd5\u7684\u6587\u7ae0\uff0c\u89c9\u5f97\u633a\u4e0d\u9519\u7684\uff0c\u7801\u8d77\u6765\u3002<\/p><\/blockquote>\n<p>\u5728\u5904\u7406\u8f83\u4e3a\u590d\u6742\u7684\u6570\u636e\u7684\u56de\u5f52\u95ee\u9898\u65f6\uff0c\u666e\u901a\u7684\u7ebf\u6027\u56de\u5f52\u7b97\u6cd5\u901a\u5e38\u4f1a\u51fa\u73b0\u9884\u6d4b\u7cbe\u5ea6\u4e0d\u591f\uff0c\u5982\u679c\u6a21\u578b\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u76f8\u5173\u5173\u7cfb\uff0c\u5c31\u4f1a\u589e\u52a0\u6a21\u578b\u7684\u590d\u6742\u7a0b\u5ea6\u3002\u5f53\u6570\u636e\u96c6\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u8f83\u5f3a\u7684\u7ebf\u6027\u76f8\u5173\u6027\u65f6\uff0c\u5373\u7279\u5f81\u4e4b\u95f4\u51fa\u73b0\u4e25\u91cd\u7684\u591a\u91cd\u5171\u7ebf\u6027\u65f6\uff0c\u7528\u666e\u901a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u4f30\u8ba1\u6a21\u578b\u53c2\u6570\uff0c\u5f80\u5f80\u53c2\u6570\u4f30\u8ba1\u7684\u65b9\u5dee\u592a\u5927\uff0c\u6b64\u65f6\uff0c\u6c42\u89e3\u51fa\u6765\u7684\u6a21\u578b\u5c31\u5f88\u4e0d\u7a33\u5b9a\u3002\u5728\u5177\u4f53\u53d6\u503c\u4e0a\u4e0e\u771f\u503c\u6709\u8f83\u5927\u7684\u504f\u5dee\uff0c\u6709\u65f6\u4f1a\u51fa\u73b0\u4e0e\u5b9e\u9645\u610f\u4e49\u4e0d\u7b26\u7684\u6b63\u8d1f\u53f7\u3002<\/p>\n<p>\u5728\u7ebf\u6027\u56de\u5f52\u4e2d\u5982\u679c\u53c2\u6570\u03b8\u8fc7\u5927\u3001\u7279\u5f81\u8fc7\u591a\u5c31\u4f1a\u5f88\u5bb9\u6613\u9020\u6210\u8fc7\u62df\u5408\uff0c\u5982\u4e0b\u5982\u6240\u793a\uff1a<\/p>\n<p><!--more--><\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" title=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" src=\"https:\/\/www.biaodianfu.com\/wp-content\/uploads\/2020\/09\/overfitting.png\" alt=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><strong>\u6b63\u5219\u5316<\/strong><br \/>\n\u5cad\u56de\u5f52\u4e0eLasso\u56de\u5f52\u7684\u51fa\u73b0\u662f\u4e3a\u4e86\u89e3\u51b3\u7ebf\u6027\u56de\u5f52\u51fa\u73b0\u7684\u8fc7\u62df\u5408\u4ee5\u53ca\u5728\u901a\u8fc7\u6b63\u89c4\u65b9\u7a0b\u65b9\u6cd5\u6c42\u89e3\u03b8\u7684\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u7684(XTX)\u4e0d\u53ef\u9006\u8fd9\u4e24\u7c7b\u95ee\u9898\u7684\uff0c\u8fd9\u4e24\u79cd\u56de\u5f52\u5747\u901a\u8fc7\u5728\u635f\u5931\u51fd\u6570\u4e2d\u5f15\u5165\u6b63\u5219\u5316\u9879\u6765\u8fbe\u5230\u76ee\u7684\u3002<\/p>\n<p>\u5728\u65e5\u5e38\u673a\u5668\u5b66\u4e60\u4efb\u52a1\u4e2d\uff0c\u5982\u679c\u6570\u636e\u96c6\u7684\u7279\u5f81\u6bd4\u6837\u672c\u70b9\u8fd8\u591a\uff0c (XTX)\u22121\u7684\u65f6\u5019\u4f1a\u51fa\u9519\u3002\u5cad\u56de\u5f52\u6700\u5148\u7528\u6765\u5904\u7406\u7279\u5f81\u6570\u591a\u4e8e\u6837\u672c\u6570\u7684\u60c5\u51b5\uff0c\u73b0\u5728\u4e5f\u7528\u4e8e\u5728\u4f30\u8ba1\u4e2d\u52a0\u5165\u504f\u5dee\uff0c\u4ece\u800c\u5f97\u5230\u66f4\u597d\u7684\u4f30\u8ba1\u3002\u8fd9\u91cc\u901a\u8fc7\u5f15\u5165\u03bb\u9650\u5236\u4e86\u6240\u6709\u03b82\u4e4b\u548c\uff0c\u901a\u8fc7\u5f15\u5165\u8be5\u60e9\u7f5a\u9879\uff0c\u80fd\u591f\u51cf\u5c11\u4e0d\u91cd\u8981\u7684\u53c2\u6570\uff0c\u8fd9\u4e2a\u6280\u672f\u5728\u7edf\u8ba1\u5b66\u4e0a\u4e5f\u53eb\u4f5c\u7f29\u51cf\uff08shrinkage\uff09\u3002\u548c\u5cad\u56de\u5f52\u7c7b\u4f3c\uff0c\u53e6\u4e00\u4e2a\u7f29\u51cfLASSO \u4e5f\u52a0\u5165\u4e86\u6b63\u5219\u9879\u5bf9\u56de\u5f52\u7cfb\u6570\u505a\u4e86\u9650\u5b9a\u3002<\/p>\n<p>\u4e3a\u4e86\u9632\u6b62\u8fc7\u62df\u5408(\u03b8\u8fc7\u5927)\uff0c\u5728\u76ee\u6807\u51fd\u6570J(\\theta)\u540e\u6dfb\u52a0\u590d\u6742\u5ea6\u60e9\u7f5a\u56e0\u5b50\uff0c\u5373\u6b63\u5219\u9879\u6765\u9632\u6b62\u8fc7\u62df\u5408\u3002\u6b63\u5219\u9879\u53ef\u4ee5\u4f7f\u7528L1-norm(Lasso)\u3001L2-norm(Ridge)\uff0c\u6216\u7ed3\u5408L1-norm\u3001L2-norm(Elastic Net)\u3002<br \/>\nLasso\uff1a\u4f7f\u7528L1-norm\u6b63\u5219<br \/>\nRidge\uff1a\u4f7f\u7528L2-norm\u6b63\u5219<br \/>\nElasticNet\uff1a\u7ed3\u5408l1-norm\u3001l2-norm\u8fdb\u884c\u6b63\u5219<br \/>\n\u7b80\u5355\u7684\u7406\u89e3\u6b63\u5219\u5316\uff1a<\/p>\n<p>\u6b63\u5219\u5316\u7684\u76ee\u7684\uff1a\u9632\u6b62\u8fc7\u62df\u5408<br \/>\n\u6b63\u5219\u5316\u7684\u672c\u8d28\uff1a\u7ea6\u675f\uff08\u9650\u5236\uff09\u8981\u4f18\u5316\u7684\u53c2\u6570<br \/>\n\u5173\u4e8e\u7b2c1\u70b9\uff0c\u8fc7\u62df\u5408\u6307\u7684\u662f\u7ed9\u5b9a\u4e00\u5806\u6570\u636e\uff0c\u8fd9\u5806\u6570\u636e\u5e26\u6709\u566a\u58f0\uff0c\u5229\u7528\u6a21\u578b\u53bb\u62df\u5408\u8fd9\u5806\u6570\u636e\uff0c\u53ef\u80fd\u4f1a\u628a\u566a\u58f0\u6570\u636e\u4e5f\u7ed9\u62df\u5408\u4e86\uff0c\u8fd9\u70b9\u5f88\u81f4\u547d\uff0c\u4e00\u65b9\u9762\u4f1a\u9020\u6210\u6a21\u578b\u6bd4\u8f83\u590d\u6742\uff0c\u53e6\u4e00\u65b9\u9762\uff0c\u6a21\u578b\u7684\u6cdb\u5316\u6027\u80fd\u592a\u5dee\u4e86\uff0c\u9047\u5230\u4e86\u65b0\u7684\u6570\u636e\u8ba9\u4f60\u6d4b\u8bd5\uff0c\u4f60\u6240\u5f97\u5230\u7684\u8fc7\u62df\u5408\u7684\u6a21\u578b\uff0c\u6b63\u786e\u7387\u662f\u5f88\u5dee\u7684\u3002<\/p>\n<p>\u5173\u4e8e\u7b2c2\u70b9\uff0c\u672c\u6765\u89e3\u7a7a\u95f4\u662f\u5168\u90e8\u533a\u57df\uff0c\u4f46\u901a\u8fc7\u6b63\u5219\u5316\u6dfb\u52a0\u4e86\u4e00\u4e9b\u7ea6\u675f\uff0c\u4f7f\u5f97\u89e3\u7a7a\u95f4\u53d8\u5c0f\u4e86\uff0c\u751a\u81f3\u5728\u4e2a\u522b\u6b63\u5219\u5316\u65b9\u5f0f\u4e0b\uff0c\u89e3\u53d8\u5f97\u7a00\u758f\u4e86\u3002\u8fd9\u4e00\u70b9\u4e0d\u5f97\u4e0d\u63d0\u5230\u4e00\u4e2a\u56fe\uff0c\u76f8\u4fe1\u6211\u4eec\u90fd\u7ecf\u5e38\u770b\u5230\u8fd9\u4e2a\u56fe\uff0c\u4f46\u8c8c\u4f3c\u8fd8\u6ca1\u6709\u4e00\u4e2a\u7279\u522b\u6e05\u6670\u7684\u89e3\u91ca\uff0c\u8fd9\u91cc\u6211\u5c1d\u8bd5\u89e3\u91ca\u4e00\u4e0b\uff0c\u56fe\u5982\u4e0b\uff1a<br \/>\n<img decoding=\"async\" class=\"aligncenter\" title=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" src=\"https:\/\/www.biaodianfu.com\/wp-content\/uploads\/2020\/09\/ridge-lasso.png\" alt=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n\u4e0a\u56fe\u4e2d\u5de6\u8fb9\u4e3aLasso\u56de\u5f52\uff0c\u53f3\u8fb9\u4e3a\u5cad\u56de\u5f52\u3002\u7ea2\u8272\u7684\u692d\u5706\u548c\u84dd\u8272\u7684\u533a\u57df\u7684\u5207\u70b9\u5c31\u662f\u76ee\u6807\u51fd\u6570\u7684\u6700\u4f18\u89e3\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u5982\u679c\u662f\u5706\uff0c\u5219\u5f88\u5bb9\u6613\u5207\u5230\u5706\u5468\u7684\u4efb\u610f\u4e00\u70b9\uff0c\u4f46\u662f\u5f88\u96be\u5207\u5230\u5750\u6807\u8f74\u4e0a\uff0c\u56e0\u6b64\u6ca1\u6709\u7a00\u758f\uff1b\u4f46\u662f\u5982\u679c\u662f\u83f1\u5f62\u6216\u8005\u591a\u8fb9\u5f62\uff0c\u5219\u5f88\u5bb9\u6613\u5207\u5230\u5750\u6807\u8f74\u4e0a\uff0c\u56e0\u6b64\u5f88\u5bb9\u6613\u4ea7\u751f\u7a00\u758f\u7684\u7ed3\u679c\u3002\u8fd9\u4e5f\u8bf4\u660e\u4e86\u4e3a\u4ec0\u4e48L1\u8303\u5f0f\u4f1a\u662f\u7a00\u758f\u7684\u3002\u8fd9\u6837\u5c31\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48lasso\u53ef\u4ee5\u8fdb\u884c\u7279\u5f81\u9009\u62e9\u3002\u5cad\u56de\u5f52\u867d\u7136\u4e0d\u80fd\u8fdb\u884c\u7279\u5f81\u7b5b\u9009\uff0c\u4f46\u662f\u5bf9\u03b8\u7684\u6a21\u505a\u7ea6\u675f\uff0c\u4f7f\u5f97\u5b83\u7684\u6570\u503c\u4f1a\u6bd4\u8f83\u5c0f\uff0c\u5f88\u5927\u7a0b\u5ea6\u4e0a\u51cf\u8f7b\u4e86overfitting\u7684\u95ee\u9898\u3002<\/p>\n<p>\u8fd9\u91cc\u7684\u03b21\uff0c\u03b22\u90fd\u662f\u6a21\u578b\u7684\u53c2\u6570\uff0c\u8981\u4f18\u5316\u7684\u76ee\u6807\u53c2\u6570\uff0c\u84dd\u8272\u90e8\u5206\u533a\u57df\uff0c\u5176\u5b9e\u5c31\u662f\u89e3\u7a7a\u95f4\uff0c\u6b63\u5982\u4e0a\u9762\u6240\u8bf4\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u89e3\u7a7a\u95f4\u201c\u7f29\u5c0f\u4e86\u201d\uff0c\u4f60\u53ea\u80fd\u5728\u8fd9\u4e2a\u7f29\u5c0f\u4e86\u7684\u7a7a\u95f4\u4e2d\uff0c\u5bfb\u627e\u4f7f\u5f97\u76ee\u6807\u51fd\u6570\u6700\u5c0f\u7684\u03b21\uff0c\u03b22\u3002\u518d\u770b\u770b\u90a3\u7ea2\u8272\u7684\u5706\u5708\uff0c\u518d\u6b21\u63d0\u9192\u5927\u5bb6\uff0c\u8fd9\u4e2a\u5750\u6807\u8f74\u548c\u7279\u5f81\uff08\u6570\u636e\uff09\u6ca1\u5173\u7cfb\uff0c\u5b83\u5b8c\u5168\u662f\u53c2\u6570\u7684\u5750\u6807\u7cfb\uff0c\u6bcf\u4e00\u4e2a\u5706\u5708\u4e0a\uff0c\u53ef\u4ee5\u53d6\u65e0\u6570\u4e2a\u03b21\uff0c\u03b22\uff0c\u8fd9\u4e9b\u03b21\uff0c\u03b22\u6709\u4e2a\u5171\u540c\u7684\u7279\u70b9\uff0c\u7528\u5b83\u4eec\u8ba1\u7b97\u7684\u76ee\u6807\u51fd\u6570\u503c\u662f\u76f8\u7b49\u7684\u3002\u90a3\u4e2a\u7ea2\u8272\u7684\u5706\u5fc3\uff0c\u5c31\u662f\u5b9e\u9645\u6700\u4f18\u53c2\u6570\uff0c\u4f46\u662f\u7531\u4e8e\u6211\u4eec\u5bf9\u89e3\u7a7a\u95f4\u505a\u4e86\u9650\u5236\uff0c\u6240\u4ee5\u6700\u4f18\u89e3\u53ea\u80fd\u5728\u201c\u7f29\u5c0f\u7684\u201d\u89e3\u7a7a\u95f4\u4e2d\u4ea7\u751f\u3002<\/p>\n<p>\u4ee5\u4e24\u4e2a\u53d8\u91cf\u4e3a\u4f8b\uff0c\u89e3\u91ca\u5cad\u56de\u5f52\u7684\u51e0\u4f55\u610f\u4e49:<\/p>\n<p>1\u3001\u6ca1\u6709\u7ea6\u675f\u9879\u65f6\u3002\u6a21\u578b\u53c2\u6570\u03b21\uff0c\u03b22\u5df2\u7ecf\u7ecf\u8fc7\u6807\u51c6\u5316\u3002\u6b8b\u5dee\u5e73\u65b9\u548cRSS\u53ef\u4ee5\u8868\u793a\u4e3a\u03b21\uff0c\u03b22\u7684\u4e00\u4e2a\u4e8c\u6b21\u51fd\u6570\uff0c\u6570\u5b66\u4e0a\u53ef\u4ee5\u7528\u4e00\u4e2a\u629b\u7269\u9762\u8868\u793a\u3002<br \/>\n<img decoding=\"async\" class=\"aligncenter\" title=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" src=\"https:\/\/www.biaodianfu.com\/wp-content\/uploads\/2020\/09\/ridge-1.jpg\" alt=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n2\u3001\u5cad\u56de\u5f52\u65f6\u3002\u7ea6\u675f\u9879\u4e3a\u03b221+\u03b222\u2264t\uff0c\u5bf9\u5e94\u7740\u6295\u5f71\u4e3a\u03b21\uff0c\u03b22\u5e73\u9762\u4e0a\u7684\u4e00\u4e2a\u5706\uff0c\u5373\u4e0b\u56fe\u4e2d\u7684\u5706\u67f1\u3002<br \/>\n<img decoding=\"async\" class=\"aligncenter\" title=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" src=\"https:\/\/www.biaodianfu.com\/wp-content\/uploads\/2020\/09\/ridge-2.jpg\" alt=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n\u53ef\u89c1\u5cad\u56de\u5f52\u89e3\u4e0e\u539f\u5148\u7684\u6700\u5c0f\u4e8c\u4e58\u89e3\u662f\u6709\u4e00\u5b9a\u8ddd\u79bb\u7684\u3002<\/p>\n<p>\u4f7f\u7528Scikit-Learn\u8fdb\u884c\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52<br \/>\n<strong>\u5cad\u56de\u5f52<\/strong><br \/>\n\u5cad\uff08Ridge\uff09\u56de\u5f52\u518d\u666e\u901a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u7684\u635f\u5931\u51fd\u6570\u4e2d\u589e\u52a0\u4e86\u989d\u5916\u7684\u7f29\u51cf\u60e9\u7f5a\u9879\uff0c\u4ee5\u9650\u5236L2\u8303\u6570\u7684\u5e73\u65b9\u9879\u3002<br \/>\n\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cX\u662f\u5c06\u6240\u6709\u6837\u672c\u4f5c\u4e3a\u5217\u5411\u91cf\u7684\u77e9\u9635\uff0cw\u8868\u793a\u6743\u91cd\u5411\u91cf\u3002\u7cfb\u6570\u03b1\u8868\u793a\u6b63\u5219\u5316\u7684\u5f3a\u5f31\u6b63\u5219\u5316\u3002<br \/>\n<img decoding=\"async\" class=\"aligncenter\" title=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" src=\"https:\/\/www.biaodianfu.com\/wp-content\/uploads\/2020\/09\/ridge.png\" alt=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<pre><code>from sklearn.linear_model import Ridge\nfrom sklearn.datasets import load_boston\nfrom sklearn.model_selection import train_test_split\n\nboston = load_boston()\nX = boston.data\ny = boston.target\n\n# \u628a\u6570\u636e\u5206\u4e3a\u8bad\u7ec3\u6570\u636e\u96c6\u548c\u6d4b\u8bd5\u6570\u636e\u96c6(20%\u6570\u636e\u4f5c\u4e3a\u6d4b\u8bd5\u6570\u636e\u96c6\uff09\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=3)\n\nmodel = Ridge(alpha=0.01, normalize=True)\nmodel.fit(X_train, y_train)\n\ntrain_score = model.score(X_train, y_train)  # \u6a21\u578b\u5bf9\u8bad\u7ec3\u6837\u672c\u5f97\u51c6\u786e\u6027\ntest_score = model.score(X_test, y_test)  # \u6a21\u578b\u5bf9\u6d4b\u8bd5\u96c6\u7684\u51c6\u786e\u6027\nprint(train_score)\nprint(test_score)<\/code><\/pre>\n<p>\u5176\u4e2dalpha\u7684\u503c\u4e3a\u5cad\u7cfb\u6570\uff0cscikit-learn\u63d0\u4f9b\u4e86\u7c7bRidgeCV\uff0c\u5b83\u53ef\u4ee5\u81ea\u52a8\u6267\u884c\u7f51\u683c\u641c\u7d22\uff0c\u6765\u5bfb\u627e\u6700\u4f73\u503c\uff1a<\/p>\n<pre><code>from sklearn.linear_model import RidgeCV\nfrom sklearn.datasets import load_boston\nfrom sklearn.model_selection import train_test_split\n\nboston = load_boston()\nX = boston.data\ny = boston.target\n\n# \u628a\u6570\u636e\u5206\u4e3a\u8bad\u7ec3\u6570\u636e\u96c6\u548c\u6d4b\u8bd5\u6570\u636e\u96c6(20%\u6570\u636e\u4f5c\u4e3a\u6d4b\u8bd5\u6570\u636e\u96c6\uff09\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=3)\n\nmodel = RidgeCV(alphas=[1.0, 0.5, 0.1, 0.05, 0.01, 0.005, 0.001, 0.0005, 0.0001], normalize=True)\nmodel.fit(X_train, y_train)\n\nprint(model.alpha_)<\/code><\/pre>\n<p><strong>Lasso\u56de\u5f52<\/strong><br \/>\nLasso\u56de\u5f52\u52a0\u5165w\u7684L1\u8303\u6570\u4f5c\u4e3a\u60e9\u7f5a\u9879\uff0c\u4ee5\u786e\u5b9a\u7cfb\u6570\u4e2d\u7684\u6570\u76ee\u8f83\u591a\u7684\u65e0\u7528\u9879\uff08\u96f6\u503c\uff09\uff1a<br \/>\n<img decoding=\"async\" class=\"aligncenter\" title=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" src=\"https:\/\/www.biaodianfu.com\/wp-content\/uploads\/2020\/09\/lasso.png\" alt=\"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n\u5177\u4f53\u4ee3\u7801\u4e0eRidge\u56de\u5f52\u7c7b\u4f3c\uff0c\u8fd9\u91cc\u4e0d\u518d\u590d\u8ff0\u3002<\/p>\n<p><strong>ElasticNet\u56de\u5f52<\/strong><br \/>\nElasticNet\u5c06Lasso\u548cRidge\u7ec4\u6210\u4e00\u4e2a\u5177\u6709\u4e24\u79cd\u60e9\u7f5a\u56e0\u7d20\u7684\u5355\u4e00\u6a21\u578b\uff1a\u4e00\u4e2a\u4e0eL1\u8303\u6570\u6210\u6bd4\u4f8b\uff0c\u53e6\u5916\u4e00\u4e2a\u4e0eL2\u8303\u6570\u6210\u6bd4\u4f8b\u3002\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\u65b9\u6cd5\u6240\u5f97\u5230\u7684\u6a21\u578b\u5c31\u50cf\u7eaf\u7cb9\u7684Lasso\u56de\u5f52\u4e00\u6837\u7a00\u758f\uff0c\u4f46\u540c\u65f6\u5177\u6709\u4e0e\u5cad\u56de\u5f52\u63d0\u4f9b\u7684\u4e00\u6837\u7684\u6b63\u5219\u5316\u80fd\u529b\u3002<br \/>\nElasticNet\u4f7f\u7528\u65f6\u9700\u8981\u63d0\u4f9b\u03b1\u548c\u03b2\u4e24\u4e2a\u53c2\u6570\u3002\u5728\u03b2\u4e2d\u53c2\u6570\u7684\u540d\u79f0\u4e3al1_ratio\uff1a<\/p>\n<pre><code>from sklearn.datasets import load_boston\nfrom sklearn.linear_model import LassoCV, ElasticNetCV\n\nboston = load_boston()\n\n# Find the optimal alpha value for Lasso regression\nlscv = LassoCV(alphas=(1.0, 0.1, 0.01, 0.001, 0.005, 0.0025, 0.001, 0.00025), normalize=True)\nlscv.fit(boston.data, boston.target)\nprint('Lasso optimal alpha: %.3f' % lscv.alpha_)\n\n# Find the optimal alpha and l1_ratio for Elastic Net\nencv = ElasticNetCV(alphas=(0.1, 0.01, 0.005, 0.0025, 0.001), l1_ratio=(0.1, 0.25, 0.5, 0.75, 0.8), normalize=True)\nencv.fit(boston.data, boston.target)\nprint('ElasticNet optimal alpha: %.3f and L1 ratio: %.4f' % (encv.alpha_, encv.l1_ratio_))<\/code><\/pre>\n<p>\u53c2\u8003\u94fe\u63a5:<a href=\"https:\/\/esl.hohoweiya.xyz\/03-Linear-Methods-for-Regression\/3.4-Shrinkage-Methods\/index.html\">\u6536\u7f29\u7684\u65b9\u6cd5<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5904\u7406\u8f83\u4e3a\u590d\u6742\u7684\u6570\u636e\u7684\u56de\u5f52\u95ee\u9898\u65f6\uff0c\u666e\u901a\u7684\u7ebf\u6027\u56de\u5f52\u7b97\u6cd5\u901a\u5e38\u4f1a\u51fa\u73b0\u9884\u6d4b\u7cbe\u5ea6\u4e0d\u591f\uff0c\u5982\u679c\u6a21\u578b\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u76f8\u5173\u5173\u7cfb\uff0c\u5c31\u4f1a\u589e\u52a0\u6a21\u578b\u7684\u590d\u6742\u7a0b\u5ea6\u3002\u5f53\u6570\u636e\u96c6\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u8f83\u5f3a\u7684\u7ebf\u6027\u76f8\u5173\u6027\u65f6\uff0c\u5373\u7279\u5f81\u4e4b\u95f4\u51fa\u73b0\u4e25\u91cd\u7684\u591a\u91cd\u5171\u7ebf\u6027\u65f6\uff0c\u7528\u666e\u901a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u4f30\u8ba1\u6a21\u578b\u53c2\u6570\uff0c\u5f80\u5f80\u53c2\u6570\u4f30\u8ba1\u7684\u65b9\u5dee\u592a\u5927\uff0c\u6b64\u65f6\uff0c\u6c42\u89e3\u51fa\u6765\u7684\u6a21\u578b\u5c31\u5f88\u4e0d\u7a33\u5b9a\u3002\u5728\u5177\u4f53\u53d6\u503c\u4e0a\u4e0e\u771f\u503c\u6709\u8f83\u5927\u7684\u504f\u5dee\uff0c\u6709\u65f6\u4f1a\u51fa\u73b0\u4e0e\u5b9e\u9645\u610f\u4e49\u4e0d\u7b26\u7684\u6b63\u8d1f\u53f7\u3002<\/p>\n","protected":false},"author":1,"featured_media":95,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[7,6,5],"class_list":["post-9","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-default","tag-elasticnet","tag-lasso","tag-5"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52 - Mister.Hu\u7684\u4e16\u754c<\/title>\n<meta name=\"description\" content=\"\u5728\u5904\u7406\u8f83\u4e3a\u590d\u6742\u7684\u6570\u636e\u7684\u56de\u5f52\u95ee\u9898\u65f6\uff0c\u666e\u901a\u7684\u7ebf\u6027\u56de\u5f52\u7b97\u6cd5\u901a\u5e38\u4f1a\u51fa\u73b0\u9884\u6d4b\u7cbe\u5ea6\u4e0d\u591f\uff0c\u5982\u679c\u6a21\u578b\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u76f8\u5173\u5173\u7cfb\uff0c\u5c31\u4f1a\u589e\u52a0\u6a21\u578b\u7684\u590d\u6742\u7a0b\u5ea6\u3002\u5f53\u6570\u636e\u96c6\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u8f83\u5f3a\u7684\u7ebf\u6027\u76f8\u5173\u6027\u65f6\uff0c\u5373\u7279\u5f81\u4e4b\u95f4\u51fa\u73b0\u4e25\u91cd\u7684\u591a\u91cd\u5171\u7ebf\u6027\u65f6\uff0c\u7528\u666e\u901a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u4f30\u8ba1\u6a21\u578b\u53c2\u6570\uff0c\u5f80\u5f80\u53c2\u6570\u4f30\u8ba1\u7684\u65b9\u5dee\u592a\u5927\uff0c\u6b64\u65f6\uff0c\u6c42\u89e3\u51fa\u6765\u7684\u6a21\u578b\u5c31\u5f88\u4e0d\u7a33\u5b9a\u3002\u5728\u5177\u4f53\u53d6\u503c\u4e0a\u4e0e\u771f\u503c\u6709\u8f83\u5927\u7684\u504f\u5dee\uff0c\u6709\u65f6\u4f1a\u51fa\u73b0\u4e0e\u5b9e\u9645\u610f\u4e49\u4e0d\u7b26\u7684\u6b63\u8d1f\u53f7\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52 - Mister.Hu\u7684\u4e16\u754c\" \/>\n<meta property=\"og:description\" content=\"\u5728\u5904\u7406\u8f83\u4e3a\u590d\u6742\u7684\u6570\u636e\u7684\u56de\u5f52\u95ee\u9898\u65f6\uff0c\u666e\u901a\u7684\u7ebf\u6027\u56de\u5f52\u7b97\u6cd5\u901a\u5e38\u4f1a\u51fa\u73b0\u9884\u6d4b\u7cbe\u5ea6\u4e0d\u591f\uff0c\u5982\u679c\u6a21\u578b\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u76f8\u5173\u5173\u7cfb\uff0c\u5c31\u4f1a\u589e\u52a0\u6a21\u578b\u7684\u590d\u6742\u7a0b\u5ea6\u3002\u5f53\u6570\u636e\u96c6\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u8f83\u5f3a\u7684\u7ebf\u6027\u76f8\u5173\u6027\u65f6\uff0c\u5373\u7279\u5f81\u4e4b\u95f4\u51fa\u73b0\u4e25\u91cd\u7684\u591a\u91cd\u5171\u7ebf\u6027\u65f6\uff0c\u7528\u666e\u901a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u4f30\u8ba1\u6a21\u578b\u53c2\u6570\uff0c\u5f80\u5f80\u53c2\u6570\u4f30\u8ba1\u7684\u65b9\u5dee\u592a\u5927\uff0c\u6b64\u65f6\uff0c\u6c42\u89e3\u51fa\u6765\u7684\u6a21\u578b\u5c31\u5f88\u4e0d\u7a33\u5b9a\u3002\u5728\u5177\u4f53\u53d6\u503c\u4e0a\u4e0e\u771f\u503c\u6709\u8f83\u5927\u7684\u504f\u5dee\uff0c\u6709\u65f6\u4f1a\u51fa\u73b0\u4e0e\u5b9e\u9645\u610f\u4e49\u4e0d\u7b26\u7684\u6b63\u8d1f\u53f7\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/\" \/>\n<meta property=\"og:site_name\" content=\"Mister.Hu\u7684\u4e16\u754c\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-20T01:32:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-13T10:16:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/03\/ai.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Huayong Hu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Huayong Hu\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/\"},\"author\":{\"name\":\"Huayong Hu\",\"@id\":\"https:\\\/\\\/hhyblog.top\\\/#\\\/schema\\\/person\\\/20f51eb0a47419c8944a1976248d1727\"},\"headline\":\"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52\",\"datePublished\":\"2024-03-20T01:32:00+00:00\",\"dateModified\":\"2024-09-13T10:16:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/\"},\"wordCount\":63,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/#\\\/schema\\\/person\\\/20f51eb0a47419c8944a1976248d1727\"},\"image\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hhyblog.top\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/ai.jpg\",\"keywords\":[\"ElasticNet\u56de\u5f52\",\"Lasso\u56de\u5f52\",\"\u5cad\u56de\u5f52\"],\"articleSection\":[\"\u9ed8\u8ba4\u5206\u7c7b\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/\",\"url\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/\",\"name\":\"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52 - Mister.Hu\u7684\u4e16\u754c\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hhyblog.top\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/ai.jpg\",\"datePublished\":\"2024-03-20T01:32:00+00:00\",\"dateModified\":\"2024-09-13T10:16:12+00:00\",\"description\":\"\u5728\u5904\u7406\u8f83\u4e3a\u590d\u6742\u7684\u6570\u636e\u7684\u56de\u5f52\u95ee\u9898\u65f6\uff0c\u666e\u901a\u7684\u7ebf\u6027\u56de\u5f52\u7b97\u6cd5\u901a\u5e38\u4f1a\u51fa\u73b0\u9884\u6d4b\u7cbe\u5ea6\u4e0d\u591f\uff0c\u5982\u679c\u6a21\u578b\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u76f8\u5173\u5173\u7cfb\uff0c\u5c31\u4f1a\u589e\u52a0\u6a21\u578b\u7684\u590d\u6742\u7a0b\u5ea6\u3002\u5f53\u6570\u636e\u96c6\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u8f83\u5f3a\u7684\u7ebf\u6027\u76f8\u5173\u6027\u65f6\uff0c\u5373\u7279\u5f81\u4e4b\u95f4\u51fa\u73b0\u4e25\u91cd\u7684\u591a\u91cd\u5171\u7ebf\u6027\u65f6\uff0c\u7528\u666e\u901a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u4f30\u8ba1\u6a21\u578b\u53c2\u6570\uff0c\u5f80\u5f80\u53c2\u6570\u4f30\u8ba1\u7684\u65b9\u5dee\u592a\u5927\uff0c\u6b64\u65f6\uff0c\u6c42\u89e3\u51fa\u6765\u7684\u6a21\u578b\u5c31\u5f88\u4e0d\u7a33\u5b9a\u3002\u5728\u5177\u4f53\u53d6\u503c\u4e0a\u4e0e\u771f\u503c\u6709\u8f83\u5927\u7684\u504f\u5dee\uff0c\u6709\u65f6\u4f1a\u51fa\u73b0\u4e0e\u5b9e\u9645\u610f\u4e49\u4e0d\u7b26\u7684\u6b63\u8d1f\u53f7\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/#primaryimage\",\"url\":\"https:\\\/\\\/hhyblog.top\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/ai.jpg\",\"contentUrl\":\"https:\\\/\\\/hhyblog.top\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/ai.jpg\",\"width\":1200,\"height\":675},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/2024\\\/03\\\/20\\\/4\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/hhyblog.top\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hhyblog.top\\\/#website\",\"url\":\"https:\\\/\\\/hhyblog.top\\\/\",\"name\":\"Mister.Hu\u7684\u4e16\u754c\",\"description\":\"\u4e00\u5c71\u4e00\u6c34\u4e00\u6241\u821f\",\"publisher\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/#\\\/schema\\\/person\\\/20f51eb0a47419c8944a1976248d1727\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hhyblog.top\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/hhyblog.top\\\/#\\\/schema\\\/person\\\/20f51eb0a47419c8944a1976248d1727\",\"name\":\"Huayong Hu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/hhyblog.top\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/touxiang.jpg\",\"url\":\"https:\\\/\\\/hhyblog.top\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/touxiang.jpg\",\"contentUrl\":\"https:\\\/\\\/hhyblog.top\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/touxiang.jpg\",\"width\":742,\"height\":748,\"caption\":\"Huayong Hu\"},\"logo\":{\"@id\":\"https:\\\/\\\/hhyblog.top\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/touxiang.jpg\"},\"description\":\"\u6bd5\u4e1a\u4e8e\u4e1c\u5317\u90e8\u5730\u533a\u7684\u4e00\u6240\u90ae\u7535\u5b66\u6821\uff0c\u5e73\u5e38\u70ed\u8877\u4e8e\u7f16\u7a0b\uff0c\u4f46\u5728\u7f16\u7a0b\u65b9\u9762\u5e76\u6ca1\u6709\u4ec0\u4e48\u5efa\u6811\uff0c\u53ea\u662f\u628a\u7f16\u7a0b\u5f53\u4f5c\u4e00\u79cd\u7231\u597d\u800c\u5df2\u3002\u5e73\u5e38\u4f1a\u641e\u4e00\u4e9b\u5f00\u53d1\uff0c\u6bd4\u5982HTML\u3001PHP\u3001JAVA\u3001Python\u7b49\u3002\u5bf9\u4e8ePHP\u8fd8\u662f\u5f88\u4e0d\u719f\u6089\u7684\uff0c\u5927\u591a\u6570\u90fd\u662f\u4eceGitHub\u4e0a\u9762\u722c\u4e0b\u6765\u7136\u540e\u5bf9\u7167\u7740\u6539\u4e00\u4e0b\u76f8\u5e94\u7684\u4f4d\u7f6e\u7684\u4ee3\u7801\u7136\u540e\u5c31\u653e\u5230\u670d\u52a1\u5668\u4e0a\u8dd1\u4e86\u3002\u3002\u3002\u540c\u7406\uff0cJAVA\u4e3b\u8981\u662f\u5f00\u53d1\u5b89\u5353\u5e94\u7528\u7684\uff0c\u5f88\u591a\u90fd\u662f\u7ed9\u81ea\u5df1\u7528\u800c\u5df2\uff0c\u5b9e\u9645\u4e0a\u5e76\u6ca1\u6709\u4ec0\u4e48\u6280\u672f\u542b\u91cf\uff08\u56e0\u4e3a\u591a\u6570\u90fd\u662f\u57fa\u4e8ewebview\u5f00\u53d1\u7684\uff09\u3002 \u57282023\u5e74\u548c2024\u5e74\u53c2\u52a0\u8003\u7814\uff0c\u62a5\u8003\u7684THU\uff0c\u5747\u672a\u80fd\u6210\u529f\u4e0a\u5cb8\u7535\u5b50\u5de5\u7a0b\u7cfb\u3002\u76ee\u524d\u5728\u51c6\u5907\u7b2c\u4e09\u6b21\u8003\u7814\u4e2d\u3002\",\"sameAs\":[\"https:\\\/\\\/hhyblog.top\"],\"url\":\"https:\\\/\\\/hhyblog.top\\\/index.php\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52 - Mister.Hu\u7684\u4e16\u754c","description":"\u5728\u5904\u7406\u8f83\u4e3a\u590d\u6742\u7684\u6570\u636e\u7684\u56de\u5f52\u95ee\u9898\u65f6\uff0c\u666e\u901a\u7684\u7ebf\u6027\u56de\u5f52\u7b97\u6cd5\u901a\u5e38\u4f1a\u51fa\u73b0\u9884\u6d4b\u7cbe\u5ea6\u4e0d\u591f\uff0c\u5982\u679c\u6a21\u578b\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u76f8\u5173\u5173\u7cfb\uff0c\u5c31\u4f1a\u589e\u52a0\u6a21\u578b\u7684\u590d\u6742\u7a0b\u5ea6\u3002\u5f53\u6570\u636e\u96c6\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u8f83\u5f3a\u7684\u7ebf\u6027\u76f8\u5173\u6027\u65f6\uff0c\u5373\u7279\u5f81\u4e4b\u95f4\u51fa\u73b0\u4e25\u91cd\u7684\u591a\u91cd\u5171\u7ebf\u6027\u65f6\uff0c\u7528\u666e\u901a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u4f30\u8ba1\u6a21\u578b\u53c2\u6570\uff0c\u5f80\u5f80\u53c2\u6570\u4f30\u8ba1\u7684\u65b9\u5dee\u592a\u5927\uff0c\u6b64\u65f6\uff0c\u6c42\u89e3\u51fa\u6765\u7684\u6a21\u578b\u5c31\u5f88\u4e0d\u7a33\u5b9a\u3002\u5728\u5177\u4f53\u53d6\u503c\u4e0a\u4e0e\u771f\u503c\u6709\u8f83\u5927\u7684\u504f\u5dee\uff0c\u6709\u65f6\u4f1a\u51fa\u73b0\u4e0e\u5b9e\u9645\u610f\u4e49\u4e0d\u7b26\u7684\u6b63\u8d1f\u53f7\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/","og_locale":"zh_CN","og_type":"article","og_title":"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52 - Mister.Hu\u7684\u4e16\u754c","og_description":"\u5728\u5904\u7406\u8f83\u4e3a\u590d\u6742\u7684\u6570\u636e\u7684\u56de\u5f52\u95ee\u9898\u65f6\uff0c\u666e\u901a\u7684\u7ebf\u6027\u56de\u5f52\u7b97\u6cd5\u901a\u5e38\u4f1a\u51fa\u73b0\u9884\u6d4b\u7cbe\u5ea6\u4e0d\u591f\uff0c\u5982\u679c\u6a21\u578b\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u76f8\u5173\u5173\u7cfb\uff0c\u5c31\u4f1a\u589e\u52a0\u6a21\u578b\u7684\u590d\u6742\u7a0b\u5ea6\u3002\u5f53\u6570\u636e\u96c6\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u8f83\u5f3a\u7684\u7ebf\u6027\u76f8\u5173\u6027\u65f6\uff0c\u5373\u7279\u5f81\u4e4b\u95f4\u51fa\u73b0\u4e25\u91cd\u7684\u591a\u91cd\u5171\u7ebf\u6027\u65f6\uff0c\u7528\u666e\u901a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u4f30\u8ba1\u6a21\u578b\u53c2\u6570\uff0c\u5f80\u5f80\u53c2\u6570\u4f30\u8ba1\u7684\u65b9\u5dee\u592a\u5927\uff0c\u6b64\u65f6\uff0c\u6c42\u89e3\u51fa\u6765\u7684\u6a21\u578b\u5c31\u5f88\u4e0d\u7a33\u5b9a\u3002\u5728\u5177\u4f53\u53d6\u503c\u4e0a\u4e0e\u771f\u503c\u6709\u8f83\u5927\u7684\u504f\u5dee\uff0c\u6709\u65f6\u4f1a\u51fa\u73b0\u4e0e\u5b9e\u9645\u610f\u4e49\u4e0d\u7b26\u7684\u6b63\u8d1f\u53f7\u3002","og_url":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/","og_site_name":"Mister.Hu\u7684\u4e16\u754c","article_published_time":"2024-03-20T01:32:00+00:00","article_modified_time":"2024-09-13T10:16:12+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/03\/ai.jpg","type":"image\/jpeg"}],"author":"Huayong Hu","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"Huayong Hu","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/#article","isPartOf":{"@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/"},"author":{"name":"Huayong Hu","@id":"https:\/\/hhyblog.top\/#\/schema\/person\/20f51eb0a47419c8944a1976248d1727"},"headline":"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52","datePublished":"2024-03-20T01:32:00+00:00","dateModified":"2024-09-13T10:16:12+00:00","mainEntityOfPage":{"@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/"},"wordCount":63,"commentCount":0,"publisher":{"@id":"https:\/\/hhyblog.top\/#\/schema\/person\/20f51eb0a47419c8944a1976248d1727"},"image":{"@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/#primaryimage"},"thumbnailUrl":"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/03\/ai.jpg","keywords":["ElasticNet\u56de\u5f52","Lasso\u56de\u5f52","\u5cad\u56de\u5f52"],"articleSection":["\u9ed8\u8ba4\u5206\u7c7b"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/","url":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/","name":"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52 - Mister.Hu\u7684\u4e16\u754c","isPartOf":{"@id":"https:\/\/hhyblog.top\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/#primaryimage"},"image":{"@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/#primaryimage"},"thumbnailUrl":"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/03\/ai.jpg","datePublished":"2024-03-20T01:32:00+00:00","dateModified":"2024-09-13T10:16:12+00:00","description":"\u5728\u5904\u7406\u8f83\u4e3a\u590d\u6742\u7684\u6570\u636e\u7684\u56de\u5f52\u95ee\u9898\u65f6\uff0c\u666e\u901a\u7684\u7ebf\u6027\u56de\u5f52\u7b97\u6cd5\u901a\u5e38\u4f1a\u51fa\u73b0\u9884\u6d4b\u7cbe\u5ea6\u4e0d\u591f\uff0c\u5982\u679c\u6a21\u578b\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u76f8\u5173\u5173\u7cfb\uff0c\u5c31\u4f1a\u589e\u52a0\u6a21\u578b\u7684\u590d\u6742\u7a0b\u5ea6\u3002\u5f53\u6570\u636e\u96c6\u4e2d\u7684\u7279\u5f81\u4e4b\u95f4\u6709\u8f83\u5f3a\u7684\u7ebf\u6027\u76f8\u5173\u6027\u65f6\uff0c\u5373\u7279\u5f81\u4e4b\u95f4\u51fa\u73b0\u4e25\u91cd\u7684\u591a\u91cd\u5171\u7ebf\u6027\u65f6\uff0c\u7528\u666e\u901a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u4f30\u8ba1\u6a21\u578b\u53c2\u6570\uff0c\u5f80\u5f80\u53c2\u6570\u4f30\u8ba1\u7684\u65b9\u5dee\u592a\u5927\uff0c\u6b64\u65f6\uff0c\u6c42\u89e3\u51fa\u6765\u7684\u6a21\u578b\u5c31\u5f88\u4e0d\u7a33\u5b9a\u3002\u5728\u5177\u4f53\u53d6\u503c\u4e0a\u4e0e\u771f\u503c\u6709\u8f83\u5927\u7684\u504f\u5dee\uff0c\u6709\u65f6\u4f1a\u51fa\u73b0\u4e0e\u5b9e\u9645\u610f\u4e49\u4e0d\u7b26\u7684\u6b63\u8d1f\u53f7\u3002","breadcrumb":{"@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/#primaryimage","url":"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/03\/ai.jpg","contentUrl":"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/03\/ai.jpg","width":1200,"height":675},{"@type":"BreadcrumbList","@id":"https:\/\/hhyblog.top\/index.php\/2024\/03\/20\/4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/hhyblog.top\/"},{"@type":"ListItem","position":2,"name":"\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u4e4b\u5cad\u56de\u5f52\u3001Lasso\u56de\u5f52\u548cElasticNet\u56de\u5f52"}]},{"@type":"WebSite","@id":"https:\/\/hhyblog.top\/#website","url":"https:\/\/hhyblog.top\/","name":"Mister.Hu\u7684\u4e16\u754c","description":"\u4e00\u5c71\u4e00\u6c34\u4e00\u6241\u821f","publisher":{"@id":"https:\/\/hhyblog.top\/#\/schema\/person\/20f51eb0a47419c8944a1976248d1727"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hhyblog.top\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/hhyblog.top\/#\/schema\/person\/20f51eb0a47419c8944a1976248d1727","name":"Huayong Hu","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/09\/touxiang.jpg","url":"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/09\/touxiang.jpg","contentUrl":"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/09\/touxiang.jpg","width":742,"height":748,"caption":"Huayong Hu"},"logo":{"@id":"https:\/\/hhyblog.top\/wp-content\/uploads\/2024\/09\/touxiang.jpg"},"description":"\u6bd5\u4e1a\u4e8e\u4e1c\u5317\u90e8\u5730\u533a\u7684\u4e00\u6240\u90ae\u7535\u5b66\u6821\uff0c\u5e73\u5e38\u70ed\u8877\u4e8e\u7f16\u7a0b\uff0c\u4f46\u5728\u7f16\u7a0b\u65b9\u9762\u5e76\u6ca1\u6709\u4ec0\u4e48\u5efa\u6811\uff0c\u53ea\u662f\u628a\u7f16\u7a0b\u5f53\u4f5c\u4e00\u79cd\u7231\u597d\u800c\u5df2\u3002\u5e73\u5e38\u4f1a\u641e\u4e00\u4e9b\u5f00\u53d1\uff0c\u6bd4\u5982HTML\u3001PHP\u3001JAVA\u3001Python\u7b49\u3002\u5bf9\u4e8ePHP\u8fd8\u662f\u5f88\u4e0d\u719f\u6089\u7684\uff0c\u5927\u591a\u6570\u90fd\u662f\u4eceGitHub\u4e0a\u9762\u722c\u4e0b\u6765\u7136\u540e\u5bf9\u7167\u7740\u6539\u4e00\u4e0b\u76f8\u5e94\u7684\u4f4d\u7f6e\u7684\u4ee3\u7801\u7136\u540e\u5c31\u653e\u5230\u670d\u52a1\u5668\u4e0a\u8dd1\u4e86\u3002\u3002\u3002\u540c\u7406\uff0cJAVA\u4e3b\u8981\u662f\u5f00\u53d1\u5b89\u5353\u5e94\u7528\u7684\uff0c\u5f88\u591a\u90fd\u662f\u7ed9\u81ea\u5df1\u7528\u800c\u5df2\uff0c\u5b9e\u9645\u4e0a\u5e76\u6ca1\u6709\u4ec0\u4e48\u6280\u672f\u542b\u91cf\uff08\u56e0\u4e3a\u591a\u6570\u90fd\u662f\u57fa\u4e8ewebview\u5f00\u53d1\u7684\uff09\u3002 \u57282023\u5e74\u548c2024\u5e74\u53c2\u52a0\u8003\u7814\uff0c\u62a5\u8003\u7684THU\uff0c\u5747\u672a\u80fd\u6210\u529f\u4e0a\u5cb8\u7535\u5b50\u5de5\u7a0b\u7cfb\u3002\u76ee\u524d\u5728\u51c6\u5907\u7b2c\u4e09\u6b21\u8003\u7814\u4e2d\u3002","sameAs":["https:\/\/hhyblog.top"],"url":"https:\/\/hhyblog.top\/index.php\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":2,"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/posts\/9\/revisions\/96"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/media\/95"}],"wp:attachment":[{"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hhyblog.top\/index.php\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}