{"id":1879,"date":"2025-02-05T07:53:00","date_gmt":"2025-02-04T23:53:00","guid":{"rendered":"https:\/\/blog.laoyulaoyu.top\/?p=1879"},"modified":"2025-01-08T12:55:39","modified_gmt":"2025-01-08T04:55:39","slug":"%e7%94%a8neuralprophet%e9%a2%84%e6%b5%8b%e8%82%a1%e4%bb%b7%ef%bc%9aai%e9%87%91%e8%9e%8d%e6%96%b0%e5%88%a9%e5%99%a8%ef%bc%88%e9%99%84%e6%ba%90%e7%a0%81%ef%bc%89","status":"publish","type":"post","link":"https:\/\/laoyulaoyu.com\/index.php\/2025\/02\/05\/%e7%94%a8neuralprophet%e9%a2%84%e6%b5%8b%e8%82%a1%e4%bb%b7%ef%bc%9aai%e9%87%91%e8%9e%8d%e6%96%b0%e5%88%a9%e5%99%a8%ef%bc%88%e9%99%84%e6%ba%90%e7%a0%81%ef%bc%89\/","title":{"rendered":"\u7528NeuralProphet\u9884\u6d4b\u80a1\u4ef7\uff1aAI\u91d1\u878d\u65b0\u5229\u5668\uff08\u9644\u6e90\u7801\uff09"},"content":{"rendered":"\n<p>\u4f5c\u8005\uff1a<a href=\"https:\/\/www.laoyulaoyu.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u8001\u4f59\u635e\u9c7c<\/a><\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-cyan-bluish-gray-color\">\u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005\u3002<\/mark><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2025\/01\/1_-xEHsDeOaXYsLwiozU3hzQ.png\" alt=\"\" class=\"wp-image-3808\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-verse\"><strong>\u5199\u5728\u524d\u9762\u7684\u8bdd\uff1a<\/strong>\u6211\u7528NeuralProphet\u6a21\u578b\u9884\u6d4b\u4e86\u80a1\u7968\u4ef7\u683c\uff0c\u53d1\u73b0\u5176<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u901a\u8fc7\u7ed3\u5408\u65f6\u95f4\u5e8f\u5217\u5206\u6790\u548c\u795e\u7ecf\u7f51\u7edc\u7b97\u6cd5\uff0c\u786e\u5b9e\u80fd\u63d0\u4f9b\u6bd4\u4f20\u7edfLast Value\u65b9\u6cd5\u66f4\u7cbe\u51c6\u7684\u9884\u6d4b<\/mark>\u3002\u7ecf\u8fc7\u4e00\u7cfb\u5217\u8d85\u53c2\u6570\u8c03\u4f18\uff0c\u5176\u9884\u6d4b\u6548\u679c\u66f4\u662f\u663e\u8457\uff0c\u5982\u679c\u4f60\u4e5f\u5bf9AI\u91d1\u878d\u80a1\u4ef7\u9884\u6d4b\u611f\u5174\u8da3\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4f1a\u7ed9\u4f60\u5e26\u6765\u4e0d\u5c11\u542f\u53d1\u3002<\/pre>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e00\u3001NeuralProphet \u6982\u8ff0<\/strong><\/h2>\n\n\n\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u5c1d\u8bd5\u7528 NeuralProphet \u6765\u9884\u6d4b\u80a1\u7968\u4ef7\u683c\u3002NeuralProphet \u662f\u7531 Meta \u516c\u53f8\u5f00\u53d1\u7684\uff0c\u636e\u8bf4\u6bd4\u4e4b\u524d\u7684 Prophet \u8f6f\u4ef6\u5305\u66f4\u5f3a\u5927\u3002\u5728\u4e4b\u524d\u7684\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u7528 Prophet \u505a\u8fc7\u7c7b\u4f3c\u7684\u4efb\u52a1\uff0c\u4f46\u6548\u679c\u4e0d\u592a\u7406\u60f3\u3002\u8fd9\u6b21\uff0c\u6211\u4eec\u5c06\u770b\u770b NeuralProphet \u662f\u5426\u80fd\u5e26\u6765\u66f4\u597d\u7684\u8868\u73b0\u3002\u6839\u636e NeuralProphet \u5b98\u7f51\u7684\u4ecb\u7ecd\uff1a<\/p>\n\n\n\n<p>NeuralProphet &#8211; \u4f7f\u7528\u6807\u51c6\u6df1\u5ea6\u5b66\u4e60\u65b9\u6cd5\u878d\u5408\u4f20\u7edf\u65f6\u95f4\u5e8f\u5217\u7b97\u6cd5\uff0c\u57fa\u4e8e PyTorch \u6784\u5efa\uff0c\u7075\u611f\u6765\u81ea Facebook Prophet \u548c AR-Net\u3002<\/p>\n\n\n\n<p>NeuralProphet \u91c7\u7528\u53ef\u5206\u89e3\u7684\u65f6\u95f4\u5e8f\u5217\u6a21\u578b\uff0c\u5176\u6a21\u578b\u7ec4\u4ef6\u5305\u62ec\u8d8b\u52bf\u3001\u5b63\u8282\u6027\u3001\u4e8b\u4ef6\u6548\u5e94\u548c\u56de\u5f52\u6548\u5e94\u3002\u5b83\u4eec\u7684\u7ec4\u5408\u516c\u5f0f\u4e3a:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>y(t) = T(t) + S(t) + E(t) + F(t) + A(t) + L(t),\n\nwhere \n\nT(t) = Trend at time t\nS(t) = Seasonal effects at time t\nE(t) = Event and holiday effects at time t\nF(t) = Regression effects at time t for future-known exogenous variables\nA(t) = Auto-regression effects at time t based on past observations\nL(t) = Regression effects at time t for lagged observations of exogenous variables<\/code><\/pre>\n\n\n\n<p>\u8fd9\u79cd\u53ef\u5206\u89e3\u7684\u65f6\u95f4\u5e8f\u5217\u5728\u9884\u6d4b\u9886\u57df\u975e\u5e38\u5e38\u89c1\u3002\u5728\u6587\u7ae0\u7684\u540e\u534a\u90e8\u5206\uff0c\u6211\u4eec\u4f1a\u8be6\u7ec6\u8bb2\u89e3\u5982\u4f55\u8c03\u6574\u4e0a\u8ff0\u65b9\u7a0b\u4e2d\u7684\u5404\u4e2a\u7ec4\u6210\u90e8\u5206\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u4f18\u5316\u9884\u6d4b\u7ed3\u679c\u3002<\/p>\n\n\n\n<p>\u5b98\u7f51\u5730\u5740\u5982\u4e0b\uff1a<a href=\"https:\/\/neuralprophet.com\/\">https:\/\/neuralprophet.com\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e8c\u3001\u76ee\u7684<\/strong><\/h2>\n\n\n\n<p id=\"6bbf\">\u6211\u4eec\u7684\u6838\u5fc3\u4efb\u52a1\u662f\u5229\u7528\u8fc7\u53bb N \u5929\u7684\u5386\u53f2\u6570\u636e\uff0c\u9884\u6d4b Vanguard \u5168\u5e02\u573a ETF\uff08VTI\uff09\u6bcf\u65e5\u8c03\u6574\u540e\u7684\u6536\u76d8\u4ef7\u3002\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\uff0c\u6211\u4eec\u4f7f\u7528\u4e86 VTI \u4ece 2013 \u5e74 1 \u6708 2 \u65e5\u5230 2018 \u5e74 12 \u6708 28 \u65e5\u5171 6 \u5e74\u7684\u5386\u53f2\u4ef7\u683c\u6570\u636e\u3002\u8fd9\u4e9b\u6570\u636e\u53ef\u4ee5\u4ece\u96c5\u864e\u8d22\u7ecf\u8f7b\u677e\u83b7\u53d6\uff0c\u4e0b\u8f7d\u540e\u7684\u6570\u636e\u96c6\u7ed3\u6784\u5982\u4e0b\u6240\u793a\u3002\u901a\u8fc7\u8fd9\u4e2a\u9879\u76ee\uff0c\u6211\u4eec\u65e8\u5728\u9a8c\u8bc1 NeuralProphet \u6a21\u578b\u5728\u80a1\u4ef7\u9884\u6d4b\u4e2d\u7684\u8868\u73b0\uff0c\u5e76\u63a2\u7d22\u5176\u5728\u5b9e\u9645\u6295\u8d44\u5206\u6790\u4e2d\u7684\u5e94\u7528\u6f5c\u529b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"631f\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*6-dR4ip4hbEbCveXC4s8eA.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"c250\">\u6211\u4eec\u603b\u5171\u6709 1509 \u5929\u7684\u6570\u636e\u53ef\u4f9b\u4f7f\u7528\u3002\u6574\u4e2a\u6570\u636e\u96c6\u4e2d\u7684\u8c03\u6574\u540e\u6536\u76d8\u4ef7\u56fe\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"1737\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*9nRMizol3E-LBIMpchthrg.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"f796\">\u6211\u4eec\u4f7f\u7528\u4ee5\u4e0b\u516c\u5f0f\u8ba1\u7b97\u6bcf\u65e5\u6536\u76ca<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\" id=\"b297\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*we9HmD33ht_0ym-aMWNmgQ.png\" alt=\"\" style=\"width:341px;height:auto\"\/><\/figure>\n\n\n\n<p id=\"fe5f\">\u5176\u4e2d\uff0cr(t) \u548c p(t) \u5206\u522b\u8868\u793a\u7b2c t \u5929\u7684\u65e5\u6536\u76ca\u7387\u548c\u8c03\u6574\u540e\u6536\u76d8\u4ef7\u3002\u4e3a\u4e86\u89c2\u5bdf\u6bcf\u65e5\u6536\u76ca\u7684\u5206\u5e03\u60c5\u51b5\uff0c\u6211\u4eec\u7ed8\u5236\u4e86\u4e0b\u9762\u7684\u5206\u5e03\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"4cb9\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*WvQIVQTbBAbnRexrJT_Hdg.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"dd66\">\u5982\u4e0a\u56fe\u6240\u793a\uff0c\u5206\u5e03\u56fe\u975e\u5e38\u63a5\u8fd1\u9ad8\u65af\u5206\u5e03\u3002\u4e3a\u4e86\u8fdb\u4e00\u6b65\u9a8c\u8bc1\u8fd9\u4e00\u70b9\uff0c\u6211\u4eec\u4f7f\u7528 scipy.stats \u8f6f\u4ef6\u5305\u7ed8\u5236\u6982\u7387\u56fe\uff0c\u5982\u4e0b\u6240\u793a\u3002\u5bf9\u4e8e scipy.stats \u4e2d\u7684\u6982\u7387\u56fe\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u5c06\u6837\u672c\u5206\u5e03\u4e0e\u9ad8\u65af\u5206\u5e03\u8fdb\u884c\u6bd4\u8f83\u3002\u4e0e\u7ea2\u8272\u76f4\u7ebf\u7684\u62df\u5408\u5ea6\u8d8a\u9ad8\uff0c\u5219\u4e0e\u9ad8\u65af\u5206\u5e03\u7684\u62df\u5408\u5ea6\u8d8a\u9ad8\u3002\u6211\u4eec\u89c2\u5bdf\u5230\uff0c\u9664\u4e86\u6781\u7aef\u503c\uff08\u7ea6 &gt; +\/- 2.5\uff09\u5916\uff0c\u6bcf\u65e5\u56de\u62a5\u7684\u5206\u5e03\u4e0e\u9ad8\u65af\u5206\u5e03\u7684\u62df\u5408\u7a0b\u5ea6\u76f8\u5f53\u9ad8\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"56e6\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*Ytb99RNeGsduWPmI79VuEQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"8274\">\u4e3a\u4e86\u5168\u9762\u8bc4\u4f30 NeuralProphet \u7684\u6027\u80fd\uff0c\u4ec5\u4ec5\u5728\u5355\u4e00\u65e5\u671f\u8fdb\u884c\u4e00\u6b21\u9884\u6d4b\u662f\u8fdc\u8fdc\u4e0d\u591f\u7684\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u5c06\u5728\u6570\u636e\u96c6\u4e2d\u7684\u591a\u4e2a\u4e0d\u540c\u65e5\u671f\u8fdb\u884c\u591a\u6b21\u9884\u6d4b\uff0c\u5e76\u53d6\u8fd9\u4e9b\u9884\u6d4b\u7ed3\u679c\u7684\u5e73\u5747\u503c\u4f5c\u4e3a\u6700\u7ec8\u8bc4\u4f30\u4f9d\u636e\u3002\u5728\u6bcf\u6b21\u9884\u6d4b\u4e2d\uff0c\u6211\u4eec\u90fd\u4f1a\u5c06 NeuralProphet \u65b9\u6cd5\u4e0e Last Value \u65b9\u6cd5\u8fdb\u884c\u5bf9\u6bd4\uff0c\u4ee5\u66f4\u5ba2\u89c2\u5730\u8861\u91cf NeuralProphet \u7684\u51c6\u786e\u6027\u548c\u7a33\u5b9a\u6027\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u4ec5\u80fd\u51cf\u5c11\u968f\u673a\u8bef\u5dee\u7684\u5f71\u54cd\uff0c\u8fd8\u80fd\u66f4\u597d\u5730\u53cd\u6620\u6a21\u578b\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u8868\u73b0\u3002<\/p>\n\n\n\n<p id=\"9995\">\u4e3a\u4e86\u8bc4\u4f30\u6211\u4eec\u65b9\u6cd5\u7684\u6709\u6548\u6027\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u5747\u65b9\u6839\u8bef\u5dee (RMSE)\u3001\u5e73\u5747\u7edd\u5bf9\u767e\u5206\u6bd4\u8bef\u5dee (MAPE) \u548c\u5e73\u5747\u7edd\u5bf9\u8bef\u5dee (MAE) \u6307\u6807\u3002\u5bf9\u4e8e\u6240\u6709\u6307\u6807\uff0c\u6570\u503c\u8d8a\u5c0f\uff0c\u9884\u6d4b\u6548\u679c\u8d8a\u597d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"b260\"><strong>\u4e09\u3001\u8bad\u7ec3\u548c\u9a8c\u8bc1<\/strong><\/h2>\n\n\n\n<p id=\"0096\">\u4e3a\u4e86\u8fdb\u884c\u9884\u6d4b\uff0c\u6211\u4eec\u9700\u8981\u5c06\u6570\u636e\u5206\u4e3a\u8bad\u7ec3\u96c6\u548c\u9a8c\u8bc1\u96c6\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u6211\u4eec\u5c06\u4f7f\u7528 3 \u5e74\u7684\u6570\u636e\uff08\u7ea6 756 \u5929\uff0c\u6309\u6bcf\u5e74 252 \u4e2a\u4ea4\u6613\u65e5\u8ba1\u7b97\uff09\u4f5c\u4e3a\u8bad\u7ec3\u96c6\uff0c\u5e76\u7528\u63a5\u4e0b\u6765 1 \u5e74\u7684\u6570\u636e\uff08252 \u5929\uff09\u4f5c\u4e3a\u9a8c\u8bc1\u96c6\u3002\u8fd9\u610f\u5473\u7740\u6bcf\u6b21\u9884\u6d4b\u90fd\u9700\u8981 1,008 \u5929\u7684\u6570\u636e\uff08756 \u5929\u8bad\u7ec3 + 252 \u5929\u9a8c\u8bc1\uff09\u3002\u6a21\u578b\u4f1a\u5728\u8bad\u7ec3\u96c6\u4e0a\u8fdb\u884c\u8bad\u7ec3\uff0c\u800c\u9a8c\u8bc1\u96c6\u5219\u7528\u4e8e\u8c03\u6574\u8d85\u53c2\u6570\u3002<\/p>\n\n\n\n<p id=\"0096\">\u4e3a\u4e86\u4f18\u5316\u8d85\u53c2\u6570\uff0c\u6211\u4eec\u91c7\u7528\u4e86<strong>\u79fb\u52a8\u7a97\u53e3\u9a8c\u8bc1\u6cd5<\/strong>\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5047\u8bbe\u6211\u4eec\u603b\u5171\u6709 896 \u5929\u7684\u6570\u636e\uff0c\u5e76\u5e0c\u671b\u5728\u7b2c 857 \u5929\u8fdb\u884c\u4e3a\u671f 40 \u5929\u7684\u9884\u6d4b\u3002\u6839\u636e\u7ecf\u9a8c\uff0c\u5bf9\u4e8e\u9884\u6d4b\u8303\u56f4 H\uff0c\u6211\u4eec\u901a\u5e38\u6bcf\u9694 H\/2 \u5929\u8fdb\u884c\u4e00\u6b21\u9884\u6d4b\u3002\u901a\u8fc7 756 \u5929\u7684\u8bad\u7ec3\u96c6\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c 4 \u6b21\u9a8c\u8bc1\uff08\u5982\u4e0b\u56fe\u6240\u793a\uff09\u3002\u6211\u4eec\u4f1a\u8ba1\u7b97\u8fd9 4 \u6b21\u9a8c\u8bc1\u7684\u8bef\u5dee\u6307\u6807\uff08\u5982 RMSE\u3001MAPE \u7b49\uff09\uff0c\u5e76\u53d6\u5176\u5e73\u5747\u503c\u3002\u6700\u7ec8\uff0c\u9009\u62e9\u8bef\u5dee\u5e73\u5747\u503c\u6700\u5c0f\u7684\u8d85\u53c2\u6570\u7ec4\u5408\u4f5c\u4e3a\u6700\u4f73\u6a21\u578b\u914d\u7f6e\u3002\u786e\u5b9a\u6700\u4f73\u8d85\u53c2\u6570\u540e\uff0c\u6211\u4eec\u5c06\u5728\u7b2c 857 \u5929\u8fdb\u884c\u9884\u6d4b\u5e76\u62a5\u544a\u7ed3\u679c\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u4ec5\u80fd\u63d0\u9ad8\u6a21\u578b\u7684\u7a33\u5b9a\u6027\uff0c\u8fd8\u80fd\u66f4\u51c6\u786e\u5730\u8bc4\u4f30\u5176\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u8868\u73b0\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"2573\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*v5cRgWom8DKLlg19S_lM-A.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"09eb\">\u5728\u4e0b\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u9996\u5148\u5bf9\u6570\u636e\u96c6\u7684\u7b2c 1009 \u5929\u8fdb\u884c\u9884\u6d4b\uff0c\u9884\u6d4b\u671f\u9650\u4e3a 21 \u5929\uff08\u6ce8\u610f\uff0c\u4e00\u4e2a\u6708\u7ea6\u6709 21 \u4e2a\u4ea4\u6613\u65e5\uff0c\u4e0d\u5305\u62ec\u5468\u672b\uff09\u3002\u5bf9\u4e8e NeuralProphet\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u524d 1008 \u5929\u4f5c\u4e3a\u8bad\u7ec3\u96c6\u548c\u9a8c\u8bc1\u96c6\uff0c\u5982\u4e0a\u6587\u6240\u8ff0\uff0c\u6309 756:252 \u7684\u6bd4\u4f8b\u5206\u5272\u3002\u6211\u4eec\u5c06\u5728\u4e0b\u4e00\u8282\u9996\u5148\u89e3\u91ca\u6700\u540e\u503c\u65b9\u6cd5\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"8afe\"><strong>\u56db\u3001Last Value<\/strong><\/h2>\n\n\n\n<p id=\"63bc\">\u5728&#8221;Last Value&#8221;\u65b9\u6cd5\u4e2d\uff0c\u9884\u6d4b\u503c\u76f4\u63a5\u91c7\u7528\u6700\u8fd1\u4e00\u6b21\u7684\u89c2\u6d4b\u503c\u3002\u5177\u4f53\u5230\u6211\u4eec\u7684\u5e94\u7528\u573a\u666f\uff0c\u5c31\u662f\u5c06\u5f53\u524d\u7684\u8c03\u6574\u540e\u6536\u76d8\u4ef7\u9884\u6d4b\u4e3a\u524d\u4e00\u5929\u7684\u8c03\u6574\u540e\u6536\u76d8\u4ef7\u3002\u8fd9\u79cd\u65b9\u6cd5\u5177\u6709\u4ee5\u4e0b\u7279\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b9e\u73b0\u7b80\u5355\uff0c\u8ba1\u7b97\u6210\u672c\u6700\u4f4e\u3002<\/li>\n\n\n\n<li>\u65e0\u9700\u8fdb\u884c\u4efb\u4f55\u8d85\u53c2\u6570\u8c03\u6574\u3002<\/li>\n\n\n\n<li>\u5e38\u88ab\u7528\u4f5c\u8bc4\u4f30\u66f4\u590d\u6742\u9884\u6d4b\u6a21\u578b\u7684\u57fa\u51c6\u3002<\/li>\n<\/ul>\n\n\n\n<p id=\"63bc\">\u57fa\u4e8e\u8be5\u65b9\u6cd5\uff0c\u6211\u4eec\u5bf9\u6570\u636e\u96c6\u7b2c1009\u5929\u8fdb\u884c\u4e8621\u5929\u671f\u9650\u7684\u9884\u6d4b\u3002\u8fd9\u79cd\u6734\u7d20\u9884\u6d4b\u65b9\u6cd5\u867d\u7136\u7b80\u5355\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u80fd\u8868\u73b0\u51fa\u4ee4\u4eba\u60ca\u8bb6\u7684\u6709\u6548\u6027\uff0c\u7279\u522b\u662f\u5728\u65f6\u95f4\u5e8f\u5217\u5177\u6709\u8f83\u5f3a\u6301\u7eed\u6027\u7684\u60c5\u51b5\u4e0b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"72e2\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*lcBJaWlevKvNtJVczgZK7A.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"b2f9\">\u4e0a\u8ff0\u9884\u6d4b\u7684 RMSE \u4e3a 1.89\uff0cMAPE \u4e3a 1.59%\uff0cMAE \u4e3a 1.80\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c809\"><strong>\u4e94\u3001\u8fd0\u884c\u9884\u6d4b<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><br><strong>5.1 \u65e0\u8d85\u53c2\u6570\u8c03\u6574\u7684 NeuralProphet<\/strong><\/h3>\n\n\n\n<p id=\"c1de\">\u8981\u4f7f\u7528 NeuralProphet \u8fd0\u884c\u9884\u6d4b\uff0c\u8bf7\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from neuralprophet import NeuralProphet, set_random_seed\n\ntrain_size = 252*3                     # Use 3 years of data as train set\nval_size = 252                         # Use 1 year of data as validation set\ntrain_val_size = train_size + val_size # Size of train+validation set\ni = train_val_size                     # Day to forecast\nH = 21                                 # Forecast horizon\n\nset_random_seed(random_seed) # Set a random seed for reproducibility\n\nm = NeuralProphet()\nm.set_plotting_backend(\"plotly-static\")\nmetrics = m.fit(df_nprophet&#91;i-train_val_size:i])\n\n# Create dataframe with the dates we want to predict\nfuture = m.make_future_dataframe(df_nprophet&#91;i-train_val_size:i], n_historic_predictions=True, periods=H)\n\n# Predict\nforecast = m.predict(future)<\/code><\/pre>\n\n\n\n<p id=\"c0d8\">\u4e3a\u4e86\u5feb\u901f\u76f4\u89c2\uff0c\u6211\u4eec\u4f7f\u7528 Prophet \u7ed8\u5236\u9884\u6d4b\u56fe\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>m.plot(forecast)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"b2ac\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*XJAEYBuJpGWChdFBInwr0A.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"06f5\">\u8fd9\u4e2a\u6a21\u578b\u7ed3\u6784\u8f83\u4e3a\u57fa\u7840\uff0c\u5176\u521d\u59cb\u914d\u7f6e\u5305\u62ec\u8d8b\u52bf\u9879\u3001\u6bcf\u5468\u5468\u671f\u6027\u53d8\u5316\u4ee5\u53ca\u5e74\u5ea6\u5468\u671f\u6027\u53d8\u5316\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u4ee5\u4e0b\u65b9\u5f0f\u5355\u72ec\u67e5\u770b\u6bcf\u4e2a\u7ec4\u6210\u90e8\u5206\u7684\u5185\u5bb9\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">m.plot_components(forecast);<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"db3b\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*uxBLLnrecE20GyqxAMS8Cw.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"1c44\">\u8bf7\u6ce8\u610f\u89c2\u5bdf\u5c31\u4f1a\u53d1\u73b0\uff0c\u5468\u5b63\u8282\u6027\u66f2\u7ebf\u56fe\u51e0\u4e4e\u662f\u5e73\u7684\uff0c\u8fd9\u610f\u5473\u7740 NeuralProphet \u65e0\u6cd5\u68c0\u6d4b\u5230\u5468\u5185\u5dee\u5f02\u3002<\/p>\n\n\n\n<p id=\"af04\">\u5355\u4e2a\u7cfb\u6570\u7684\u6570\u503c\u4e5f\u53ef\u4ee5\u7ed8\u5236\u6210\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u4ee5\u83b7\u5f97\u66f4\u6df1\u5165\u7684\u4e86\u89e3\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">m.plot_parameters()<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"563d\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*PzcKihY3mB6lLGjbXc0jfg.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"75b8\">\u8bf7\u6ce8\u610f\uff0c\u4e0a\u9762\u663e\u793a\u7684 &#8220;\u5b63\u8282\u6027\uff1a\u5e74\u56fe &#8220;\u548c &#8220;\u5b63\u8282\u6027\uff1a\u5468\u56fe &#8220;\u662f\u6210\u5206\u56fe\u7684\u4e00\u4e2a\u5468\u671f\u3002<\/p>\n\n\n\n<p id=\"f3de\">\u5728\u4e0a\u56fe\u7684\u9884\u6d4b\u4e2d\uff0c\u663e\u793a\u7684\u662f\u80a1\u7968\u6536\u76ca\u9884\u6d4b\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee3\u7801\u5c06\u5176\u8f6c\u6362\u4e3a\u4ef7\u683c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Convert back to price\nest_adj_close = &#91;]\nprev_tg = df.loc&#91;i-1, 'adj_close']\nfor n in range(H):\n    est_adj_close.append((float(preds_list.iloc&#91;n])\/100+1)*prev_tg)\n    prev_tg = (float(preds_list.iloc&#91;n])\/100+1)*prev_tg<\/code><\/pre>\n\n\n\n<p id=\"ac38\">\u4e4b\u540e\uff0c\u80a1\u7968\u4ef7\u683c\u7684\u9884\u6d4b\u7ed3\u679c\u5982\u4e0b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"827b\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*3WfN8boGAyGOvHSAw4xXIA.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"a1ea\">\u4e0a\u8ff0\u9884\u6d4b\u7684 RMSE \u4e3a 1.60\uff0cMAPE \u4e3a 1.35%\uff0cMAE \u4e3a 1.52\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"49a1\"><strong>5.2 \u5e26\u6709\u8d85\u53c2\u6570\u8c03\u6574\u529f\u80fd\u7684 NeuralProphet &#8211; Changepoints<\/strong><\/h3>\n\n\n\n<p id=\"c3a6\">\u65f6\u95f4\u5e8f\u5217\u7684\u8f68\u8ff9\u901a\u5e38\u4f1a\u53d1\u751f\u7a81\u53d8\u3002\u8fd9\u79cd\u53d8\u5316\u70b9\u68c0\u6d4b\u7684\u5f3a\u5ea6\u53ef\u4ee5\u901a\u8fc7\u53c2\u6570 n_changepoints \u6765\u8c03\u6574\u3002\u589e\u52a0 n_changepoints \u4f1a\u4f7f\u8d8b\u52bf\u66f4\u7075\u6d3b\uff0c\u5bfc\u81f4\u8fc7\u5ea6\u62df\u5408\u3002\u51cf\u5c11 n_changepoints \u4f1a\u964d\u4f4e\u8d8b\u52bf\u7684\u7075\u6d3b\u6027\uff0c\u5bfc\u81f4\u62df\u5408\u4e0d\u8db3\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8be5\u53c2\u6570\u8bbe\u7f6e\u4e3a 10\u3002<\/p>\n\n\n\n<p id=\"4652\">\u5728\u504f\u79fb\u91cf m \u7684\u57fa\u7840\u4e0a\uff0c\u518d\u5c06\u589e\u957f\u7387 k \u4e58\u4ee5\u81ea\u8d77\u70b9 t0 \u8d77\u7684\u65f6\u95f4\u5dee (t1-t0)\uff0c\u5c31\u5f97\u5230\u4e86 t1 \u65f6\u523b\u7684\u8d8b\u52bf\u6548\u5e94\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>trend(t1) = m + k(t1 - t0) = trend(t0) + k(t1-t0)<\/code><\/pre>\n\n\n\n<p id=\"1df9\">\u6d4b\u8bd5 n_\u53d8\u5316\u70b9\u7684\u503c\u4e3a 2\u30015\u300110\u300115 \u548c 20\u3002\u5bf9\u4e8e n_changepoints \u7684\u6bcf\u4e2a\u503c\uff0c\u6211\u4eec\u4f7f\u7528\u8bad\u7ec3\u96c6\u548c\u9a8c\u8bc1\u96c6\u8fdb\u884c\u9884\u6d4b\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"d7a1\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*YaBfe0552e8LUaTVe5aJXA.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"23b1\">\u4e0a\u8ff0\u8fc7\u7a0b\u5171\u8017\u65f6 8 \u5206\u949f\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f7f\u7528\u8fd9\u4e2a\u503c\u5728\u6d4b\u8bd5\u96c6\u4e0a\u8fd0\u884c\u9884\u6d4b\u3002\u7ed3\u679c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"b686\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*SXehcHuKf7x9j4xe6CTVAQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"17f1\">\u4e0a\u8ff0\u9884\u6d4b\u7684 RMSE \u4e3a 2.75\uff0cMAPE \u4e3a 2.35%\uff0cMAE \u4e3a 2.65\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"f139\"><strong>5.3 \u5e26\u6709\u8d85\u53c2\u6570\u8c03\u6574\u7684 NeuralProphet &#8211; Monthly Seasonality<\/strong><\/h3>\n\n\n\n<p id=\"f699\"><br>\u6bcf\u6708\u7684\u5b63\u8282\u6027\u53ef\u4ee5\u5728 NeuralProphet \u4e2d\u8fd9\u6837\u8bbe\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>m = NeuralProphet()\nm = m.add_seasonality(name=\"monthly\", period=30.5, fourier_order=3)<\/code><\/pre>\n\n\n\n<p id=\"10d6\"><br>NeuralProphet \u4e2d\u7684\u5b63\u8282\u6027\u662f\u501f\u52a9\u5085\u7acb\u53f6\u9879\u6765\u5efa\u6a21\u7684\u3002\u4e0a\u8ff0\u5085\u7acb\u53f6\u9636\u6570\u6307\u7684\u662f\u7528\u4e8e\u4f30\u8ba1\u5b63\u8282\u6027\u7684\u504f\u548c\u4e2d\u7684\u9879\u6570\u3002<\/p>\n\n\n\n<p id=\"3eba\">\u4f7f\u7528 2\u30014\u30016\u30018 \u548c 10 \u7684\u5085\u7acb\u53f6\u9636\u6570\u503c\u8fdb\u884c\u6d4b\u8bd5\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u5085\u7acb\u53f6\u9636\u6570\u503c\uff0c\u6211\u4eec\u4f7f\u7528\u8bad\u7ec3\u96c6\u548c\u9a8c\u8bc1\u96c6\u8fdb\u884c\u9884\u6d4b\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"3c36\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*-l3xAnSFBsIkklrvlDkQoQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"6035\">\u4e0a\u8ff0\u8fc7\u7a0b\u603b\u5171\u8017\u65f6 8 \u5206\u949f\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f7f\u7528\u8fd9\u4e2a\u503c\u5728\u6d4b\u8bd5\u96c6\u4e0a\u8fdb\u884c\u9884\u6d4b\u3002\u7ed3\u679c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"fc24\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*wlhavEmSO8kqyqSbXfJaoQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"b165\"><br>\u4e0a\u8ff0\u9884\u6d4b\u7684 RMSE \u4e3a 2.19\uff0cMAPE \u4e3a 1.87%\uff0cMAE \u4e3a 2.12\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"37aa\"><strong>5.4 \u5e26\u6709\u8d85\u53c2\u6570\u8c03\u6574\u529f\u80fd\u7684 NeuralProphet &#8211; \u6d3b\u52a8\u548c\u5047\u671f<\/strong><\/h3>\n\n\n\n<p id=\"5fb7\">\u5728\u8282\u5047\u65e5\u671f\u95f4\uff0c\u80a1\u5e02\u7684\u8d70\u52bf\u53ef\u80fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002\u4ee5\u201c\u5723\u8bde\u53cd\u5f39\u201d\u73b0\u8c61\u4e3a\u4f8b\uff0c\u8fd9\u662f\u6307\u80a1\u5e02\u5728\u5723\u8bde\u8282\u671f\u95f4\u901a\u5e38\u4f1a\u51fa\u73b0\u7684\u4e0a\u6da8\u8d8b\u52bf\u3002NeuralProphet \u5728\u8fdb\u884c\u5e02\u573a\u9884\u6d4b\u65f6\u80fd\u591f\u5c06\u8fd9\u4e9b\u7279\u5b9a\u4e8b\u4ef6\u7eb3\u5165\u8003\u91cf\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u4e8b\u4ef6\u6570\u636e\u6846\uff0c\u5982\u4e0b\u6240\u793a\uff0c\u8fd9\u4e00\u6b65\u9aa4\u53ef\u4ee5\u901a\u8fc7\u5bfc\u5165CSV\u6587\u4ef6\u8f7b\u677e\u5b8c\u6210\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"7baa\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*rizhXH3e8SrO-Zm_S3tTAg.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"c5ee\">\u4e8b\u4ef6\u53ef\u4ee5\u5728 NeuralProphet \u4e2d\u8fd9\u6837\u8bbe\u7f6e\uff08events \u5c31\u662f\u4e0a\u56fe\u6240\u793a\u7684\u6570\u636e\u5e27\uff09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>m = NeuralProphet()\nm.add_events(\"hols\", lower_window=lower_window, upper_window=upper_window)\nhistory_df = m.create_df_with_events(df, holidays)\nm.fit(history_df)\nfuture = m.make_future_dataframe(history_df, events_df=events, n_historic_predictions=True, periods=H)\nforecast = m.predict(future)<\/code><\/pre>\n\n\n\n<p id=\"6faa\">\u7a97\u53e3\u5927\u5c0f\u8d85\u53c2\u6570\u5c06\u5047\u671f\u6269\u5c55\u5230\u65e5\u671f\u5468\u56f4\u7684 [lower_window, upper_window]\u5929\u6570\u3002\u4e3a\u7b80\u5355\u8d77\u89c1\uff0c\u5047\u8bbe lower_window \u548c upper_window \u7684\u5927\u5c0f\u76f8\u540c\uff0c\u5373 lower_window = upper_window = \u7a97\u53e3\u5927\u5c0f\u3002\u6211\u4eec\u5c06\u6d4b\u8bd5\u7a97\u53e3\u5927\u5c0f\u7684\u503c 0\u30011 \u548c 2\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u7a97\u53e3\u5927\u5c0f\u503c\uff0c\u6211\u4eec\u4f7f\u7528\u8bad\u7ec3\u96c6\u548c\u9a8c\u8bc1\u96c6\u8fdb\u884c\u9884\u6d4b\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"64a5\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*7-7tH9uEw1CdLq8SqGCJug.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"cf4e\">\u8fc7\u7a0b\u5171\u8017\u65f6 5 \u5206\u949f\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f7f\u7528\u8fd9\u4e2a\u503c\u5728\u6d4b\u8bd5\u96c6\u4e0a\u8fdb\u884c\u9884\u6d4b\u3002\u7ed3\u679c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"633b\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*MUVWEl4X1qfFngtRUQht0Q.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"3b43\">\u9884\u6d4b\u7684 RMSE \u4e3a 2.05\uff0cMAPE \u4e3a 1.74%\uff0cMAE \u4e3a 1.96\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"ae52\"><strong>5.5 \u5e26\u6709\u8d85\u53c2\u6570\u8c03\u6574\u529f\u80fd\u7684 NeuralProphet &#8211; \u81ea\u56de\u5f52<\/strong><\/h3>\n\n\n\n<p id=\"f076\">\u81ea\u56de\u5f52\u662f\u4e00\u79cd\u65f6\u95f4\u5e8f\u5217\u6a21\u578b\uff0c\u5b83\u4f7f\u7528\u524d\u4e00\u65f6\u95f4\u6b65\u7684\u89c2\u6d4b\u503c\u4f5c\u4e3a\u56de\u5f52\u65b9\u7a0b\u7684\u8f93\u5165\uff0c\u4ee5\u9884\u6d4b\u4e0b\u4e00\u65f6\u95f4\u6b65\u7684\u503c\u3002<\/p>\n\n\n\n<p id=\"fd7b\">NeuralProphet \u4e2d\u7684\u81ea\u56de\u5f52\u7531 n_lags \u53c2\u6570\u51b3\u5b9a\u3002\u6211\u4eec\u5c06\u6d4b\u8bd5 n_lags \u7684\u503c 0\u30012\u30015 \u548c 10\u3002\u5bf9\u4e8e\u6bcf\u4e2a n_lags \u503c\uff0c\u4f7f\u7528\u8bad\u7ec3\u96c6\u548c\u9a8c\u8bc1\u96c6\u8fdb\u884c\u9884\u6d4b\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"1c56\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*L_9Q3qr-0_qP-q47c3dYjg.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"a503\">\u4e0a\u8ff0\u8fc7\u7a0b\u5171\u8017\u65f6 7 \u5206\u949f\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f7f\u7528\u8fd9\u4e2a\u503c\u5728\u6d4b\u8bd5\u96c6\u4e0a\u8fd0\u884c\u6211\u4eec\u7684\u9884\u6d4b\u3002\u7ed3\u679c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"f49b\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*2VXrPGttuBCqMe2ZH45PAA.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"cb50\">\u9884\u6d4b\u7684 RMSE \u4e3a 1.18\uff0cMAPE \u4e3a 0.89%\uff0cMAE \u4e3a 1.01\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"a7fb\"><strong>5.6 \u5e26\u6709\u8d85\u53c2\u6570\u8c03\u6574\u529f\u80fd\u7684 NeuralProphet &#8211; \u7ed3\u5408\u6240\u6709\u8d85\u53c2\u6570<\/strong><\/h3>\n\n\n\n<p id=\"b570\">\u4e0b\u4e00\u6b65\u5c06\u6d4b\u8bd5\u8d85\u53c2\u6570\u7684\u7ec4\u5408\uff0c\u627e\u51fa\u6700\u4f73\u7684\u8d85\u53c2\u6570\u96c6\u3002\u4ee5\u7f51\u683c\u641c\u7d22\u65b9\u5f0f\u6d4b\u8bd5\u4e0a\u8ff0\u6bcf\u4e2a\u8d85\u53c2\u6570\u7ec4\u5408\u603b\u5171\u9700\u8981 5 * 5 * 3 * 4 * 7 \u5206\u949f = 35 \u5c0f\u65f6\u3002\u4e3a\u4e86\u8282\u7701\u65f6\u95f4\uff0c\u53c2\u8003\u4e0a\u8ff0\u7ed3\u679c\uff0c\u53ea\u7528\u4ee5\u4e0b\u503c\u8fdb\u884c\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>n_changepoints_list = &#91;2, 5]\nfourier_order_list = &#91;6, 8]\nwindow_list = &#91;1]         \nn_lags_list = &#91;0, 2] <\/code><\/pre>\n\n\n\n<p id=\"847e\">\u6b64\u5916\uff0c\u6211\u4eec\u8fd8\u5c1d\u8bd5\u4e86\u4e0a\u8ff0\u8d85\u53c2\u6570\uff0c\u9996\u5148\u662f\u4e0d\u5e26\u4e8b\u4ef6\u8d85\u53c2\u6570\u7684\u8d85\u53c2\u6570\uff0c\u5176\u6b21\u662f\u5e26\u4e8b\u4ef6\u8d85\u53c2\u6570\u7684\u8d85\u53c2\u6570\u3002\u4ee5\u4e0b\u662f\u4e0d\u5e26\u4e8b\u4ef6\u8d85\u53c2\u6570\u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"0e24\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*2wUUzj8QL16FH1G6WT0Nog.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"bcaf\">\u4ee5\u4e0b\u662f\u4f7f\u7528\u4e8b\u4ef6\u8d85\u53c2\u6570\u5f97\u51fa\u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"39dc\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*r16pgZ6H4niwBdf0aeeeRA.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"757a\"> \u4ece\u4e0a\u9762\u53ef\u4ee5\u770b\u51fa\uff0cn_changepoints\u3001fourier_order\u3001window \u548c n_lags \u7684\u6700\u4f73\u503c\u5206\u522b\u4e3a 2\u30016\u30011\u30012 \u548c\u4f7f\u7528\u4e8b\u4ef6\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f7f\u7528\u8fd9\u4e9b\u503c\u5728\u6d4b\u8bd5\u96c6\u4e0a\u8fd0\u884c\u6211\u4eec\u7684\u9884\u6d4b\u3002\u7ed3\u679c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"ec25\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*rUC64iRAatEXMley8m9J0g.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"a8d4\">\u4e0a\u8ff0\u9884\u6d4b\u7684 RMSE \u4e3a 1.04\uff0cMAPE \u4e3a 0.81%\uff0cMAE \u4e3a 0.91\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"0862\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*XI7JNoJoQfDFaJOHHKecMA.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"5a62\">\u7ecf\u8fc7\u5bf9\u6240\u6709\u8d85\u53c2\u6570\u7684\u7ec6\u81f4\u4f18\u5316\uff0c\u6211\u4eec\u5728\u7b2c1009\u5929\u7684\u9884\u6d4b\u4e2d\uff0c\u5229\u7528NeuralProphet\u6a21\u578b\u53d6\u5f97\u4e86\u5353\u8d8a\u7684\u8868\u73b0\u3002\u5728\u5b8c\u6210\u8d85\u53c2\u6570\u7684\u5168\u9762\u8c03\u6574\u540e\uff0c\u8be5\u6a21\u578b\u5728RMSE\u3001MAPE\u548cMAE\u6307\u6807\u4e0a\u5747\u8fbe\u5230\u4e86\u6700\u4f4e\u503c\uff0c\u8d85\u8d8a\u4e86\u5305\u62ecLast Value\u57fa\u51c6\u5728\u5185\u7684\u5176\u4ed6\u6240\u6709\u9884\u6d4b\u65b9\u6cd5\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u63a2\u7a76NeuralProphet\u6a21\u578b\u5728\u5176\u4ed6\u65e5\u671f\u7684\u9884\u6d4b\u6210\u6548\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"6be4\"><strong>5.7 \u591a\u65e5\u9884\u6d4b<\/strong><\/h3>\n\n\n\n<p id=\"1447\">\u5728\u5ba1\u89c6\u4e86\u4e0a\u8ff0\u8d85\u53c2\u6570\u8c03\u6574\u5e26\u6765\u7684\u6210\u679c\u4e4b\u540e\uff0c\u6211\u4eec\u8ba1\u5212\u5c06\u8fd9\u79cd\u65b9\u6cd5\u6269\u5c55\u5e94\u7528\uff0c\u4ee5\u5bf9\u8fde\u7eed\u591a\u5929\u8fdb\u884c\u9884\u6d4b\u3002\u6211\u4eec\u7684\u9884\u6d4b\u5c06\u4ece\u6570\u636e\u96c6\u7684\u7b2c1009\u5929\u8d77\u6b65\uff0c\u5e76\u4ee542\u5929\u4e3a\u5468\u671f\u8fdb\u884c\u65b0\u4e00\u8f6e\u9884\u6d4b\u3002\u9274\u4e8e\u6570\u636e\u96c6\u5305\u542b1509\u5929\u7684\u6570\u636e\uff0c\u6211\u4eec\u5c06\u6267\u884c\u5171\u8ba112\u8f6e\u7684\u9884\u6d4b\u3002\u6bcf\u8f6e\u9884\u6d4b\u90fd\u5c06\u8986\u76d6\u672a\u676521\u5929\u7684\u65f6\u95f4\u8303\u56f4\u3002\u540c\u65f6\uff0c\u5bf9\u4e8e\u6bcf\u4e00\u5929t\u7684\u9884\u6d4b\uff0c\u6211\u4eec\u90fd\u5c06\u5e94\u7528\u4e4b\u524d\u786e\u5b9a\u7684\u6700\u4f18\u8d85\u53c2\u6570\u914d\u7f6e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"e377\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*r2hGrmWBUhfifUvAXX_v-Q.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"5bc3\">\u4ece\u4e0a\u6587\u4e2d\u53ef\u4ee5\u660e\u663e\u770b\u51fa\uff0c\u5e76\u975e\u6240\u6709\u7684\u9884\u6d4b\u7ed3\u679c\u90fd\u662f\u7406\u60f3\u7684\u3002\u6709\u4e9b\u65e5\u671f\u7684\u9884\u6d4b\u65b9\u5411\u548c\u5e45\u5ea6\u4e0e\u5b9e\u9645\u503c\u76f8\u5f53\u63a5\u8fd1\uff0c\u7136\u800c\u5728\u5176\u4ed6\u65e5\u671f\uff0c\u9884\u6d4b\u7684\u65b9\u5411\u548c\u5e45\u5ea6\u5219\u4e0e\u5b9e\u9645\u503c\u76f8\u53bb\u751a\u8fdc\u3002\u4ee5\u4e0b\u5c55\u793a\u4e86\u6bcf\u9879\u9884\u6d4b\u7684\u6027\u80fd\u6307\u6807\u7ed3\u679c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"ee2f\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*L9EA1SVBjqLEzwLI97M8OQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"3e55\">\u8ba9\u6211\u4eec\u5c06\u4e0a\u8ff0\u7ed3\u679c\u4e0e\u4e0b\u56fe\u6240\u793a\u7684 &#8221; Last Value &#8220;\u65b9\u6cd5\u8fdb\u884c\u6bd4\u8f83\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"20e6\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.readmedium.com\/v2\/resize:fit:800\/1*2cgwCjwuS7QqZ1aeyBURzQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"b598\">NeuralProphet \u572812\u6b21\u9884\u6d4b\u4e2d\u7684\u5e73\u5747RMSE\u4e3a2.15\uff0c\u5e73\u5747MAPE\u4e3a1.41%\uff0c\u5e73\u5747MAE\u4e3a1.88\u3002\u76f8\u6bd4\u4e4b\u4e0b\uff0cLast Value\u65b9\u6cd5\u7684\u5e73\u5747RMSE\u4e3a2.53\uff0c\u5e73\u5747MAPE\u4e3a1.69%\uff0c\u5e73\u5747MAE\u4e3a2.26\u3002\u5728\u8fd9\u4e9b\u6307\u6807\u4e0a\uff0cNeuralProphet \u663e\u7136\u8868\u73b0\u66f4\u4e3a\u4f18\u5f02\u3002\u8fd9\u4e00\u7ed3\u679c\u9887\u4e3a\u6709\u8da3\uff0c\u56e0\u4e3a\u5728\u6211\u7684\u5148\u524d\u5b9e\u9a8c\u4e2d\uff0c\u4f7f\u7528\u7684\u662fProphet\u800c\u975eNeuralProphet\uff0c\u90a3\u65f6Last Value\u65b9\u6cd5\u7684\u8868\u73b0\u66f4\u4e3a\u7a81\u51fa\u3002\u5728\u8fd9\u4e2a\u6848\u4f8b\u4e2d\uff0cNeuralProphet \u7684\u8d21\u732e\u4e0d\u5bb9\u5c0f\u89d1\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u516d\u3001\u89c2\u70b9\u603b\u7ed3<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>NeuralProphet \u5728\u80a1\u4ef7\u9884\u6d4b\u4e2d\u8868\u73b0\u5353\u8d8a<\/strong>\uff1a\u6587\u7ae0\u901a\u8fc7\u5bf9\u6bd4 Last Value \u65b9\u6cd5\u548c Prophet \u6a21\u578b\uff0c\u8bc1\u5b9e NeuralProphet \u5728\u9884\u6d4b\u80a1\u4ef7\u65f6\u5177\u6709\u66f4\u9ad8\u7684\u51c6\u786e\u6027\uff0c\u6210\u4e3a\u91d1\u878d\u5206\u6790\u4e2d\u7684\u65b0\u5229\u5668\u3002<\/li>\n\n\n\n<li><strong>\u8d85\u53c2\u6570\u8c03\u4f18\u662f\u63d0\u5347\u6a21\u578b\u6027\u80fd\u7684\u5173\u952e<\/strong>\uff1a\u4f5c\u8005\u901a\u8fc7\u8c03\u6574 changepoints\u3001fourier_order\u3001window_size \u548c n_lags \u7b49\u8d85\u53c2\u6570\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f18\u5316\u6a21\u578b\uff0c\u4ece\u800c\u663e\u8457\u63d0\u5347\u9884\u6d4b\u6548\u679c\u3002<\/li>\n\n\n\n<li><strong>\u4e8b\u4ef6\u548c\u5047\u671f\u5bf9\u80a1\u5e02\u5f71\u54cd\u4e0d\u53ef\u5ffd\u89c6<\/strong>\uff1a\u6587\u7ae0\u5f3a\u8c03\u4e86\u8282\u5047\u65e5\u548c\u7279\u6b8a\u4e8b\u4ef6\u5bf9\u80a1\u4ef7\u6ce2\u52a8\u7684\u91cd\u8981\u6027\uff0c\u63d0\u9192\u6211\u4eec\u5728\u5efa\u6a21\u65f6\u9700\u5145\u5206\u8003\u8651\u8fd9\u4e9b\u56e0\u7d20\uff0c\u4ee5\u63d0\u9ad8\u9884\u6d4b\u7cbe\u5ea6\u3002<\/li>\n\n\n\n<li><strong>\u81ea\u56de\u5f52\u663e\u8457\u63d0\u5347\u9884\u6d4b\u51c6\u786e\u6027<\/strong>\uff1a\u901a\u8fc7\u5f15\u5165\u81ea\u56de\u5f52\u53c2\u6570 n_lags\uff0cNeuralProphet \u80fd\u591f\u66f4\u597d\u5730\u6355\u6349\u65f6\u95f4\u5e8f\u5217\u4e2d\u7684\u52a8\u6001\u53d8\u5316\uff0c\u4ece\u800c\u5927\u5e45\u63d0\u5347\u9884\u6d4b\u7684\u53ef\u9760\u6027\u3002<\/li>\n\n\n\n<li><strong>NeuralProphet \u5177\u5907\u9ad8\u5ea6\u7075\u6d3b\u6027\u548c\u6269\u5c55\u6027<\/strong>\uff1a\u4f5c\u8005\u901a\u8fc7\u6dfb\u52a0\u4e8b\u4ef6\u6570\u636e\u6846\u67b6\u548c\u8c03\u6574\u5b63\u8282\u6027\u53c2\u6570\uff0c\u5c55\u793a\u4e86 NeuralProphet \u5982\u4f55\u9002\u5e94\u590d\u6742\u7684\u5e02\u573a\u73af\u5883\uff0c\u6ee1\u8db3\u591a\u6837\u5316\u7684\u9884\u6d4b\u9700\u6c42\u3002<\/li>\n\n\n\n<li><strong>\u591a\u65e5\u9884\u6d4b\u5b9e\u9a8c\u8bc1\u660e NeuralProphet \u7684\u4f18\u8d8a\u6027<\/strong>\uff1a\u5728\u591a\u6b21\u9884\u6d4b\u5b9e\u9a8c\u4e2d\uff0cNeuralProphet \u7684 RMSE\u3001MAPE \u548c MAE \u6307\u6807\u5747\u4f18\u4e8e Last Value \u65b9\u6cd5\uff0c\u5c55\u73b0\u4e86\u5176\u5728\u80a1\u4ef7\u9884\u6d4b\u9886\u57df\u7684\u5de8\u5927\u6f5c\u529b\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4ee3\u7801\u5730\u5740\uff1a<\/strong><a href=\"https:\/\/github.com\/alexyu2013\/Stocks2025\/blob\/master\/StockReturnsPrediction_fh21\/StockReturnsPrediction_v9_neuralprophet.ipynb\">https:\/\/github.com\/alexyu2013\/Stocks2025\/blob\/master\/StockReturnsPrediction_fh21\/StockReturnsPrediction_v9_neuralprophet.ipynb<\/a><\/p>\n\n\n\n<p><em>\u611f<em>\u8c22\u60a8\u9605\u8bfb\u5230\u6700\u540e\uff0c\u5e0c\u671b\u672c\u6587\u80fd\u7ed9\u60a8\u5e26\u6765\u65b0\u7684\u6536\u83b7\u3002\u7801\u5b57\u4e0d\u6613\uff0c\u8bf7\u5e2e\u6211\u70b9\u8d5e\u3001\u5206\u4eab\u3002\u795d\u60a8\u6295\u8d44\u987a\u5229\uff01\u5982\u679c\u5bf9\u6587\u4e2d\u7684\u5185\u5bb9\u6709\u4efb\u4f55\u7591\u95ee\uff0c\u8bf7\u7ed9\u6211\u7559\u8a00\uff0c\u5fc5\u590d\u3002<\/em><\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"has-text-align-center\" id=\"a1c6\">\u672c\u6587\u5185\u5bb9\u4ec5\u9650\u6280\u672f\u63a2\u8ba8\u548c\u5b66\u4e60\uff0c\u4e0d\u6784\u6210\u4efb\u4f55\u6295\u8d44\u5efa\u8bae\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1a\u8001\u4f59\u635e\u9c7c \u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005\u3002&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/laoyulaoyu.com\/index.php\/2025\/02\/05\/%e7%94%a8neuralprophet%e9%a2%84%e6%b5%8b%e8%82%a1%e4%bb%b7%ef%bc%9aai%e9%87%91%e8%9e%8d%e6%96%b0%e5%88%a9%e5%99%a8%ef%bc%88%e9%99%84%e6%ba%90%e7%a0%81%ef%bc%89\/\">Continue reading<span class=\"screen-reader-text\">\u7528NeuralProphet\u9884\u6d4b\u80a1\u4ef7\uff1aAI\u91d1\u878d\u65b0\u5229\u5668\uff08\u9644\u6e90\u7801\uff09<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,6],"class_list":["post-1879","post","type-post","status-publish","format-standard","hentry","category-aiinvest","tag-ai","tag-6","entry"],"_links":{"self":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/comments?post=1879"}],"version-history":[{"count":1,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1879\/revisions"}],"predecessor-version":[{"id":1880,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1879\/revisions\/1880"}],"wp:attachment":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/media?parent=1879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/categories?post=1879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/tags?post=1879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}