{"id":3833,"date":"2026-04-10T07:39:00","date_gmt":"2026-04-09T23:39:00","guid":{"rendered":"https:\/\/www.laoyulaoyu.com\/?p=3833"},"modified":"2026-03-31T16:12:25","modified_gmt":"2026-03-31T08:12:25","slug":"%e9%87%8f%e5%8c%96%e5%b0%8f%e5%8a%a9%e6%89%8b%ef%bc%9alstm%e5%9c%a8%e6%97%a5%e5%86%85%e4%ba%a4%e6%98%93%e4%b8%ad%e7%9a%84%e5%ae%9e%e6%88%98%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.laoyulaoyu.com\/index.php\/2026\/04\/10\/%e9%87%8f%e5%8c%96%e5%b0%8f%e5%8a%a9%e6%89%8b%ef%bc%9alstm%e5%9c%a8%e6%97%a5%e5%86%85%e4%ba%a4%e6%98%93%e4%b8%ad%e7%9a%84%e5%ae%9e%e6%88%98%e5%ba%94%e7%94%a8\/","title":{"rendered":"\u91cf\u5316\u5c0f\u52a9\u624b\uff1aLSTM\u5728\u65e5\u5185\u4ea4\u6613\u4e2d\u7684\u5b9e\u6218\u5e94\u7528"},"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 fetchpriority=\"high\" decoding=\"async\" width=\"900\" height=\"383\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/cover-2.jpg\" alt=\"\" class=\"wp-image-3834\" srcset=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/cover-2.jpg 900w, https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/cover-2-300x128.jpg 300w, https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/cover-2-768x327.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/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>\u4eca\u5929\u5206\u4eab\u4e00\u4e2a\u7528Python\u5199\u7684LSTM\u6a21\u578b\uff0c\u5e2e\u4f60\u66f4\u597d\u5730\u8bfb\u61c2\u76d8\u9762\u8d70\u52bf\u3002<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u5b83\u4e0d\u662f\u81ea\u52a8\u4ea4\u6613\u5de5\u5177\uff0c\u800c\u662f\u4e00\u4e2a\u5b9e\u65f6\u7684AI\u53c2\u8c0b<\/mark>\uff1a\u5728\u4f60\u505a\u51b3\u7b56\u65f6\u63d0\u4f9b\u53c2\u8003\u3002\u4ee3\u7801\u53ea\u670980\u884c\uff0c\u5c0f\u767d\u4e5f\u80fd\u8dd1\u8d77\u6765\u3002<\/pre>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e00\u3001\u8fd9\u4e0d\u662f\u4ea4\u6613\u673a\u5668\u4eba\uff0c\u662f\u4e00\u4e2a&#8221;\u7b2c\u4e8c\u610f\u89c1&#8221;\u5de5\u5177<\/strong><\/h2>\n\n\n\n<p>\u4eca\u5929\u60f3\u8ddf\u5927\u5bb6\u5206\u4eab\u4e00\u4e2a\u6211\u6700\u8fd1\u5728\u7528\u7684\u91cf\u5316\u5c0f\u5de5\u5177\u3002\u4e0d\u662f\u90a3\u79cd\u5168\u81ea\u52a8\u5e2e\u4f60\u4e0b\u5355\u7684\u673a\u5668\u4eba\uff0c\u800c\u662f\u4e00\u4e2a\u5b9e\u5b9e\u5728\u5728\u7684<strong>&#8220;\u7b2c\u4e8c\u610f\u89c1&#8221;<\/strong>\u2014\u2014\u6bcf\u5929\u65e9\u4e0a\u7ed9\u4f60\u4e00\u4efd\u5206\u6790\u62a5\u544a\uff0c\u5728\u4f60\u770b\u76d8\u7684\u65f6\u5019\u968f\u65f6\u63d0\u4f9b\u53c2\u8003\u3002<\/p>\n\n\n\n<p>\u4ee3\u7801\u4e0d\u957f\uff0c\u52a0\u8d77\u6765\u5927\u698280\u884cPython\uff0c\u4f46\u5b83\u505a\u7684\u4e8b\u633a\u6709\u610f\u601d\uff1a\u7528LSTM\u6a21\u578b\u5b66\u4e60\u8fc7\u53bb\u7684\u4ef7\u683c\u8d70\u52bf\uff0c\u7136\u540e\u544a\u8bc9\u4f60\u63a5\u4e0b\u6765\u5927\u6982\u4f1a\u600e\u4e48\u8d70\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-verse\">\u91cd\u8981\u63d0\u9192\uff1a\u8fd9\u4e2a\u5de5\u5177\u8f93\u51fa\u7684\u53ea\u662f\u53c2\u8003\u4fe1\u606f\uff0c\u4e0d\u662f\u4ea4\u6613\u4fe1\u53f7\u3002\u6700\u7ec8\u7684\u51b3\u7b56\u6743\u6c38\u8fdc\u5728\u4f60\u624b\u91cc\uff0c\u6a21\u578b\u53ea\u662f\u5e2e\u4f60\u591a\u4e00\u4e2a\u89c6\u89d2\u6765\u770b\u95ee\u9898\u3002<\/pre>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e8c\u3001\u4ec0\u4e48\u662fLSTM\uff1f\u4e3a\u4ec0\u4e48\u4ea4\u6613\u8005\u9700\u8981\u4e86\u89e3\u5b83<\/strong><\/h2>\n\n\n\n<p>LSTM\u5168\u79f0\u662f\u957f\u77ed\u671f\u8bb0\u5fc6\u7f51\u7edc\uff08Long Short-Term Memory\uff09\uff0c\u662f\u4e00\u79cd\u4e13\u95e8\u7528\u6765\u5904\u7406\u5e8f\u5217\u6570\u636e\u7684\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u3002\u5b83\u6700\u5389\u5bb3\u7684\u5730\u65b9\u5728\u4e8e\uff1a<strong>\u80fd\u591f\u8bb0\u4f4f\u4e4b\u524d\u53d1\u751f\u7684\u4e8b\uff0c\u5e76\u5229\u7528\u8fd9\u4e9b\u8bb0\u5fc6\u6765\u5f71\u54cd\u73b0\u5728\u7684\u5224\u65ad<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"700\" height=\"467\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/LSTM\u6a21\u578b\u5de5\u4f5c\u539f\u7406.jpg\" alt=\"\" class=\"wp-image-3835\" srcset=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/LSTM\u6a21\u578b\u5de5\u4f5c\u539f\u7406.jpg 700w, https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/LSTM\u6a21\u578b\u5de5\u4f5c\u539f\u7406-300x200.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p>\u8fd9\u4e48\u8bf4\u53ef\u80fd\u6709\u70b9\u62bd\u8c61\uff0c\u6211\u6765\u4e3e\u4e2a\u4f8b\u5b50\u5e2e\u4f60\u7406\u89e3\uff1a<\/p>\n\n\n\n<p><strong>\u6211\u4eec\u5e73\u65f6\u770b\u76d8\u65f6\u7684\u601d\u8003\u65b9\u5f0f\uff1a<\/strong><br>\u8fc7\u53bb30\u5206\u949f\u4ef7\u683c\u4e00\u76f4\u5728\u7f13\u6162\u4e0b\u8dcc\uff0c\u5728373\u7f8e\u5143\u9644\u8fd1\u627e\u5230\u4e86\u652f\u6491\u3002\u5982\u679c\u6210\u4ea4\u91cf\u5f00\u59cb\u653e\u5927\uff0c\u8fd9\u91cc\u53ef\u80fd\u4f1a\u53cd\u5f39\u3002<\/p>\n\n\n\n<p><strong>LSTM\u6a21\u578b\u7684&#8221;\u601d\u8003\u65b9\u5f0f&#8221;\uff1a<\/strong><br>\u6839\u636e\u8fc7\u53bb60\u5206\u949f\u7684\u6536\u76d8\u4ef7\u6570\u636e\uff0c\u7ed3\u5408\u7c7b\u4f3c\u7684&#8221;\u7f13\u8dcc\u540e\u7a33&#8221;\u7684\u8d70\u52bf\u6a21\u5f0f\uff0c\u6a21\u578b\u9884\u6d4b\u4e0b\u4e00\u6839K\u7ebf\u4ef7\u683c\u5927\u6982\u5728372.71\u7f8e\u5143\u5de6\u53f3\uff0c\u6bd4\u5f53\u524d372.48\u7f8e\u5143\u7565\u9ad8\u3002<\/p>\n\n\n\n<p>\u770b\u51fa\u533a\u522b\u4e86\u5417\uff1f\u6211\u4eec\u4eba\u770b\u76d8\u9760\u7684\u662f\u7ecf\u9a8c\u548c\u76d8\u611f\uff0c\u800cLSTM\u9760\u7684\u662f\u5b83&#8221;\u89c1\u8fc7&#8221;\u7684\u6a21\u5f0f\u3002\u5b83\u53ef\u80fd\u4e0d\u61c2\u4ec0\u4e48\u53eb\u652f\u6491\u4f4d\uff0c\u4f46\u5b83\u89c1\u8fc7\u8db3\u591f\u591a\u7684\u7c7b\u4f3c\u8d70\u52bf\uff0c\u4f1a\u7528\u6570\u5b57\u544a\u8bc9\u4f60\u5386\u53f2\u4e0a\u8fd9\u79cd\u60c5\u51b5\u901a\u5e38\u4f1a\u600e\u4e48\u8d70\u3002<\/p>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u628aLSTM\u60f3\u8c61\u6210\u4e00\u4e2a<strong>\u4e0d\u77e5\u75b2\u5026\u7684\u91cf\u5316\u5206\u6790\u5e08<\/strong>\uff1a\u5b83\u4e00\u76f4\u5728\u76ef\u77401\u5206\u949fK\u7ebf\u56fe\u770b\uff0c\u80fd\u544a\u8bc9\u4f60\u7c7b\u4f3c\u7684\u5e02\u573a\u8d70\u6cd5\u5728\u8fc7\u53bb\u662f\u600e\u4e48\u53d1\u5c55\u7684\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e09\u3001\u600e\u4e48\u628a\u8fd9\u4e2a\u5de5\u5177\u7528\u8fdb\u4f60\u7684\u65e5\u5e38\u770b\u76d8<\/strong><\/h2>\n\n\n\n<p>\u8bf4\u5b8c\u4e86\u539f\u7406\uff0c\u6211\u4eec\u6765\u804a\u5b9e\u64cd\u3002\u8fd9\u4e2a\u5de5\u5177\u7684\u4f7f\u7528\u6d41\u7a0b\u5f88\u7b80\u5355\uff0c\u5206\u6210\u4e09\u4e2a\u65f6\u95f4\u8282\u70b9\uff1a<\/p>\n\n\n\n<p><strong>\u76d8\u524d\u51c6\u5907\uff089:00\u524d\uff09<\/strong>\u00a0\u2014 \u7528\u524d\u4e00\u5929\u7684\u5168\u5929\u6570\u636e\u8bad\u7ec3\u6a21\u578b\u3002\u6a21\u578b\u4f1a\u5b66\u4e60\u8fc7\u53bb\u4e00\u5929\u7684\u5e02\u573a\u8282\u594f\u548c\u6ce2\u52a8\u7279\u5f81\uff0c\u5927\u6982\u9700\u89812\u5206\u949f\u5728\u666e\u901a\u7b14\u8bb0\u672c\u4e0a\u8dd1\u5b8c\u3002<\/p>\n\n\n\n<p><strong>\u76d8\u4e2d\u51b3\u7b56<\/strong>\u00a0\u2014 \u6bcf\u5f53\u4f60\u5728\u67d0\u4e2a\u4f4d\u7f6e\u60f3\u52a8\u624b\u4e4b\u524d\uff0c\u5148\u770b\u770b\u6a21\u578b\u7684\u9884\u6d4b\u3002\u5b83\u7684\u65b9\u5411\u8ddf\u4f60\u7684\u5224\u65ad\u4e00\u81f4\u5417\uff1f\u5982\u679c\u4e0d\u4e00\u81f4\uff0c\u539f\u56e0\u53ef\u80fd\u662f\u6a21\u578b\u770b\u5230\u4e86\u4f60\u6ca1\u6ce8\u610f\u5230\u7684\u7ec6\u8282\uff0c\u4e5f\u53ef\u80fd\u662f\u6a21\u578b\u8fd9\u6b21\u5224\u65ad\u5931\u8bef\u4e86\uff1a\u4e24\u79cd\u60c5\u51b5\u90fd\u503c\u5f97\u4f60\u505c\u4e0b\u6765\u591a\u60f3\u4e00\u60f3\u3002<\/p>\n\n\n\n<p><strong>\u6536\u76d8\u590d\u76d8<\/strong>\u00a0\u2014 \u5bf9\u6bd4\u6a21\u578b\u4eca\u5929\u7684\u9884\u6d4b\u548c\u5b9e\u9645\u8d70\u52bf\u3002\u54ea\u4e9b\u5730\u65b9\u5b83\u770b\u5bf9\u4e86\uff1f\u54ea\u4e9b\u5730\u65b9\u5b83\u5224\u65ad\u5931\u8bef\u4e86\uff1f\u575a\u6301\u8bb0\u5f55\u4e00\u6bb5\u65f6\u95f4\uff0c\u4f60\u4f1a\u6162\u6162\u53d1\u73b0\u6a21\u578b\u5728\u4ec0\u4e48\u5e02\u573a\u73af\u5883\u4e0b\u6bd4\u8f83\u9760\u8c31\uff0c\u5728\u4ec0\u4e48\u60c5\u51b5\u4e0b\u5bb9\u6613\u51fa\u9519\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u56db\u3001\u4ee3\u7801\u5b9e\u73b0\uff1a\u4e00\u6b65\u6b65\u642d\u8d77\u4f60\u7684\u91cf\u5316\u52a9\u624b<\/strong><\/h2>\n\n\n\n<p>\u63a5\u4e0b\u6765\u662f\u6280\u672f\u90e8\u5206\uff0c\u6211\u4f1a\u628a\u4ee3\u7801\u62c6\u6210\u51e0\u4e2a\u5173\u952e\u6a21\u5757\u6765\u8bb2\uff0c\u4fdd\u8bc1\u4f60\u770b\u5b8c\u4e0d\u4ec5\u80fd\u8dd1\u901a\uff0c\u8fd8\u80fd\u7406\u89e3\u6bcf\u4e00\u6b65\u5728\u505a\u4ec0\u4e48\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u7b2c\u4e00\u6b65\uff1a\u51c6\u5907\u5de5\u5177\u548c\u6570\u636e<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u4e00\u6b65\u4e3b\u8981\u662f\u628a\u9700\u8981\u7684\u5e93\u5bfc\u5165\u8fdb\u6765\uff0c\u7136\u540e\u5b9a\u4e49\u51e0\u4e2a\u5173\u952e\u53c2\u6570\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>import&nbsp;yfinance&nbsp;as&nbsp;yf<\/code><code>import&nbsp;pandas&nbsp;as&nbsp;pd<\/code><code>import&nbsp;numpy&nbsp;as&nbsp;np<\/code><code>import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<\/code><code>from&nbsp;datetime&nbsp;import&nbsp;datetime, timedelta<\/code><code>from&nbsp;tensorflow.keras.models&nbsp;import&nbsp;Sequential<\/code><code>from&nbsp;tensorflow.keras.layers&nbsp;import&nbsp;LSTM, Dense, Dropout, Input<\/code><code>from&nbsp;tensorflow.keras.optimizers&nbsp;import&nbsp;Adam<\/code><code>from&nbsp;sklearn.preprocessing&nbsp;import&nbsp;MinMaxScaler<\/code><code><\/code><code># === \u914d\u7f6e\u53c2\u6570\uff1a\u8fd9\u51e0\u4e2a\u662f\u4f60\u9700\u8981\u81ea\u5df1\u8c03\u6574\u7684 ===<\/code><code><\/code><code>TICKER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&nbsp;\"TSLA\"&nbsp; &nbsp;# \u6362\u6210\u4f60\u60f3\u5206\u6790\u7684\u54c1\u79cd<\/code><code>LOOKBACK_INTERVALS =&nbsp;60&nbsp; &nbsp; &nbsp; &nbsp;# \u7528\u8fc7\u53bb60\u6839K\u7ebf\u6765\u9884\u6d4b<\/code><code>EPOCHS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&nbsp;50<\/code><code>BATCH_SIZE &nbsp; &nbsp; &nbsp; &nbsp; =&nbsp;16<\/code><\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>\u5c0f\u63d0\u793a\uff1a<\/strong>LOOKBACK_INTERVALS\u8fd9\u4e2a\u53c2\u6570\u63a7\u5236\u6a21\u578b\u770b\u591a\u957f\u7684\u5386\u53f2\u6570\u636e\u3002\u8bbe\u5f97\u8d8a\u957f\uff0c\u6a21\u578b\u80fd\u770b\u5230\u66f4\u5927\u7ea7\u522b\u7684\u8d8b\u52bf\uff0c\u4f46\u8ba1\u7b97\u91cf\u4e5f\u4f1a\u53d8\u5927\uff1b\u8bbe\u5f97\u77ed\u4e00\u4e9b\uff0c\u6a21\u578b\u5bf9\u77ed\u671f\u53d8\u5316\u66f4\u654f\u611f\uff0c\u4f46\u53ef\u80fd\u66f4\u5bb9\u6613\u88ab\u566a\u97f3\u5e72\u6270\u3002<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u7b2c\u4e8c\u6b65\uff1a\u83b7\u53d6\u5f53\u5929\u6570\u636e<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u4e00\u6b65\u7528yfinance\u5e93\u4e0b\u8f7d\u6307\u5b9a\u54c1\u79cd\u76841\u5206\u949fK\u7ebf\u6570\u636e\uff0c\u7136\u540e\u6574\u7406\u6210\u4e00\u4e2a\u5e72\u51c0\u7684\u8868\u683c\uff0c\u53ea\u4fdd\u7559\u6211\u4eec\u9700\u8981\u7684\u4ef7\u683c\u5217\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>def&nbsp;get_processed_data():<\/code><code>&nbsp; &nbsp;&nbsp;# \u4e0b\u8f7d\u5f53\u5929\u76841\u5206\u949fK\u7ebf\u6570\u636e<\/code><code>&nbsp; &nbsp; df = yf.download(TICKER, period=\"1d\", interval=\"1m\", progress=False)<\/code><code><\/code><code>&nbsp; &nbsp;&nbsp;# \u5904\u7406\u591a\u7ea7\u5217\u540d\u7684\u60c5\u51b5<\/code><code>&nbsp; &nbsp;&nbsp;if&nbsp;isinstance(df.columns, pd.MultiIndex):<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; df.columns = df.columns.get_level_values(0)<\/code><code><\/code><code>&nbsp; &nbsp;&nbsp;# \u91cd\u547d\u540d\u5e76\u6e05\u7406\u6570\u636e<\/code><code>&nbsp; &nbsp; df = df.reset_index().rename(columns={'Date':&nbsp;'Datetime'})<\/code><code>&nbsp; &nbsp; df.dropna(subset=&#91;'Close'], inplace=True)<\/code><code>&nbsp; &nbsp;&nbsp;return&nbsp;df<\/code><code><\/code><code># \u83b7\u53d6\u539f\u59cb\u6570\u636e\u2014\u2014\u5b8c\u6574\u4ea4\u6613\u65e5\u76841\u5206\u949fK\u7ebf<\/code><code>df_raw = get_processed_data()<\/code><\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>\u76d8\u524d\u5c0f\u6280\u5de7\uff1a<\/strong>\u5728\u628a\u6570\u636e\u5582\u7ed9\u6a21\u578b\u4e4b\u524d\uff0c\u4f60\u53ef\u4ee5\u5148\u7528 df_raw[&#8216;Close&#8217;].describe() \u770b\u4e00\u4e0b\u6570\u636e\u7684\u7edf\u8ba1\u7279\u5f81\u3002\u5982\u679c\u5f53\u5929\u7684\u6ce2\u52a8\u8303\u56f4\u660e\u663e\u6bd4\u5e73\u65f6\u5927\uff0c\u53ef\u80fd\u610f\u5473\u7740\u4eca\u5929\u5e02\u573a\u6bd4\u8f83\u6d3b\u8dc3\uff0c\u770b\u76d8\u7684\u65f6\u5019\u8981\u66f4\u8c28\u614e\u4e00\u4e9b\u3002<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u7b2c\u4e09\u6b65\uff1a\u6570\u636e\u5f52\u4e00\u5316\u5904\u7406<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u662f\u5f88\u91cd\u8981\u7684\u4e00\u6b65\u3002\u6a21\u578b\u5904\u7406\u7684\u6570\u636e\u8303\u56f4\u592a\u5927\u4e0d\u5229\u4e8e\u5b66\u4e60\uff0c\u6240\u4ee5\u6211\u4eec\u628a\u4ef7\u683c\u5168\u90e8\u538b\u7f29\u52300\u52301\u4e4b\u95f4\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u53eb\u505a&#8221;\u5f52\u4e00\u5316&#8221;\uff0c\u5c31\u50cf\u628a\u4e0d\u540c\u5927\u5c0f\u7684\u6c34\u679c\u90fd\u6309\u6bd4\u4f8b\u7f29\u5c0f\u5230\u540c\u4e00\u4e2a\u76d2\u5b50\u91cc\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>LOOKBACK_INTERVALS&nbsp;=&nbsp;60&nbsp; # \u7528\u8fc7\u53bb60\u5206\u949fK\u7ebf\u6765\u9884\u6d4b\u4e0b\u4e00\u6839<\/code><code><\/code><code># \u521d\u59cb\u5316\u5f52\u4e00\u5316\u5668\uff0c\u5c06\u4ef7\u683c\u6620\u5c04\u52300-1\u533a\u95f4<\/code><code>scaler&nbsp; &nbsp; &nbsp; = MinMaxScaler(feature_range=(0,&nbsp;1))<\/code><code>scaled_data&nbsp;= scaler.fit_transform(df_raw&#91;&#91;'Close']])<\/code><code><\/code><code># \u6784\u5efa\u8bad\u7ec3\u6570\u636e\uff1aX = \u8fc7\u53bb60\u4e2a\u4ef7\u683c\uff0cy = \u4e0b\u4e00\u4e2a\u4ef7\u683c<\/code><code>X, y =&nbsp;&#91;], &#91;]<\/code><code>if&nbsp;len(scaled_data) &lt; LOOKBACK_INTERVALS:<\/code><code>&nbsp; &nbsp;&nbsp;print(\"\u6570\u636e\u91cf\u4e0d\u8db3\uff0c\u8df3\u8fc7\u6a21\u578b\u8bad\u7ec3\")<\/code><code>else:<\/code><code>&nbsp; &nbsp;&nbsp;for&nbsp;i in range(LOOKBACK_INTERVALS, len(scaled_data)):<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;X.append(scaled_data&#91;i-LOOKBACK_INTERVALS:i,&nbsp;0])<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;y.append(scaled_data&#91;i,&nbsp;0])<\/code><code><\/code><code>&nbsp; &nbsp;&nbsp;# \u8f6c\u6362\u4e3aNumPy\u6570\u7ec4\u5e76\u8c03\u6574\u5f62\u72b6<\/code><code>&nbsp; &nbsp;&nbsp;X, y = np.array(X), np.array(y)<\/code><code>&nbsp; &nbsp;&nbsp;X&nbsp; &nbsp; = np.reshape(X, (X.shape&#91;0], X.shape&#91;1],&nbsp;1))<\/code><code><\/code><code>&nbsp; &nbsp;&nbsp;# 80%\u7528\u6765\u8bad\u7ec3\uff0c20%\u7528\u6765\u6d4b\u8bd5\u2014\u2014\u4e25\u683c\u6309\u65f6\u95f4\u987a\u5e8f\u5207\u5206<\/code><code>&nbsp; &nbsp;&nbsp;split&nbsp;= int(len(X) *&nbsp;0.8)<\/code><code>&nbsp; &nbsp;&nbsp;X_train, X_test = X&#91;:split], X&#91;split:]<\/code><code>&nbsp; &nbsp;&nbsp;y_train, y_test = y&#91;:split], y&#91;split:]<\/code><\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>\u4e3a\u4ec0\u4e48\u898180\/20\u5207\u5206\uff1f<\/strong>\u56e0\u4e3a\u6211\u4eec\u4e25\u683c\u6309\u7167\u65f6\u95f4\u987a\u5e8f\u6765\u5207\u5206\u6570\u636e\uff1a\u524d80%\u662f\u8f83\u65e9\u7684\u6570\u636e\uff0c\u540e20%\u662f\u8f83\u65b0\u7684\u6570\u636e\u3002\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\u907f\u514d&#8221;\u672a\u6765\u6570\u636e\u6cc4\u9732&#8221;\uff0c\u6a21\u578b\u4e0d\u4f1a\u770b\u5230\u8fd8\u6ca1\u53d1\u751f\u7684\u4e8b\u60c5\u3002<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u7b2c\u56db\u6b65\uff1a\u6784\u5efaLSTM\u795e\u7ecf\u7f51\u7edc<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u91cc\u662f\u6a21\u578b\u7684\u6838\u5fc3\u90e8\u5206\u3002\u4e24\u5c42LSTM\u53e0\u52a0\uff0c\u5f62\u6210&#8221;\u4e24\u5c42\u9012\u8fdb&#8221;\u7684\u6a21\u5f0f\u8bc6\u522b\u80fd\u529b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># \u6784\u5efa\u53cc\u5c42LSTM\u6a21\u578b<\/code><code>model = Sequential(&#91;<\/code><code>&nbsp; &nbsp;&nbsp;# \u8f93\u5165\u5c42 + \u7b2c\u4e00\u5c42LSTM\uff1a\u8bc6\u522b\u57fa\u7840\u8d70\u52bf\u6a21\u5f0f<\/code><code>&nbsp; &nbsp; Input(shape=(LOOKBACK_INTERVALS,&nbsp;1)),<\/code><code>&nbsp; &nbsp; LSTM(units=50, return_sequences=True),<\/code><code><\/code><code>&nbsp; &nbsp;&nbsp;# Dropout\u5c42\uff1a\u968f\u673a\u65ad\u5f0020%\u8fde\u63a5\uff0c\u9632\u6b62\u6b7b\u8bb0\u786c\u80cc<\/code><code>&nbsp; &nbsp; Dropout(0.2),<\/code><code><\/code><code>&nbsp; &nbsp;&nbsp;# \u7b2c\u4e8c\u5c42LSTM\uff1a\u5728\u7b2c\u4e00\u5c42\u57fa\u7840\u4e0a\u627e\u66f4\u9ad8\u5c42\u7684\u89c4\u5f8b<\/code><code>&nbsp; &nbsp; LSTM(units=50),<\/code><code><\/code><code>&nbsp; &nbsp;&nbsp;# \u8f93\u51fa\u5c42\uff1a\u7ed9\u51fa\u9884\u6d4b\u4ef7\u683c<\/code><code>&nbsp; &nbsp; Dense(1)<\/code><code>])<\/code><code><\/code><code># \u7f16\u8bd1\u6a21\u578b\uff1a\u4f7f\u7528Adam\u4f18\u5316\u5668\u548cMSE\u635f\u5931\u51fd\u6570<\/code><code>model.compile(<\/code><code>&nbsp; &nbsp; optimizer=Adam(learning_rate=0.01),&nbsp;<\/code><code>&nbsp; &nbsp; loss='mse'<\/code><code>)<\/code><code><\/code><code># \u8bad\u7ec3\u6a21\u578b<\/code><code>model.fit(<\/code><code>&nbsp; &nbsp; X_train, y_train,&nbsp;<\/code><code>&nbsp; &nbsp; epochs=50,&nbsp;<\/code><code>&nbsp; &nbsp; batch_size=16,&nbsp;<\/code><code>&nbsp; &nbsp; verbose=0<\/code><code>)<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u4e3a\u4ec0\u4e48\u8981\u52a0Dropout\u5c42\uff1f<\/strong><\/h3>\n\n\n\n<p><strong>\u9632\u6b62\u8fc7\u5ea6\u4f9d\u8d56\uff1a<\/strong>\u5982\u679c\u6ca1\u6709Dropout\uff0c\u6a21\u578b\u53ef\u80fd\u5b66\u4f1a&#8221;\u6284\u8fd1\u9053&#8221;\u2014\u2014\u67d0\u4e00\u4e2a\u795e\u7ecf\u5143\u7279\u522b\u5f3a\uff0c\u4e00\u76f4\u5e26\u7740\u6574\u4e2a\u6a21\u578b\u8d70\u3002\u8fd9\u6837\u6a21\u578b\u5728\u65b0\u6570\u636e\u4e0a\u8868\u73b0\u5c31\u4f1a\u53d8\u5dee\u3002Dropout\u5f3a\u8feb\u6bcf\u4e2a\u795e\u7ecf\u5143\u90fd\u5f97\u5b66\u4f1a\u72ec\u7acb\u5de5\u4f5c\u3002<\/p>\n\n\n\n<p><strong>\u63d0\u5347\u6cdb\u5316\u80fd\u529b\uff1a<\/strong>\u6a21\u578b\u5728&#8221;\u6709\u5e72\u6270&#8221;\u7684\u73af\u5883\u4e0b\u8bad\u7ec3\u8fc7\uff0c\u5230\u4e86\u771f\u5b9e\u5e02\u573a\uff08\u566a\u97f3\u66f4\u591a\uff09\uff0c\u53cd\u800c\u80fd\u8868\u73b0\u5f97\u66f4\u597d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u7b2c\u4e94\u6b65\uff1a\u8bc4\u4f30\u6a21\u578b\u8868\u73b0<\/strong><\/h3>\n\n\n\n<p>\u6a21\u578b\u8dd1\u5b8c\u4e4b\u540e\uff0c\u6211\u4eec\u9700\u8981\u77e5\u9053\u5b83\u9884\u6d4b\u5f97\u51c6\u4e0d\u51c6\u3002\u8fd9\u91cc\u7528\u4e09\u4e2a\u6307\u6807\u6765\u8861\u91cf\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\"><strong>\u6307\u6807\u540d\u79f0<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>\u542b\u4e49<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>\u89e3\u8bfb<\/strong><\/th><\/tr><\/thead><tbody><tr><td>MSE\uff08\u5747\u65b9\u8bef\u5dee\uff09<\/td><td>\u9884\u6d4b\u8bef\u5dee\u7684\u5e73\u65b9\u7684\u5e73\u5747\u503c<\/td><td>\u5bf9\u5927\u8bef\u5dee\u60e9\u7f5a\u66f4\u91cd<\/td><\/tr><tr><td>RMSE\uff08\u5747\u65b9\u6839\u8bef\u5dee\uff09<\/td><td>MSE\u7684\u5e73\u65b9\u6839<\/td><td>\u8ddf\u4ef7\u683c\u5355\u4f4d\u4e00\u81f4\uff0c\u66f4\u6613\u7406\u89e3<\/td><\/tr><tr><td>MAE\uff08\u5e73\u5747\u7edd\u5bf9\u8bef\u5dee\uff09<\/td><td>\u9884\u6d4b\u8bef\u5dee\u7edd\u5bf9\u503c\u7684\u5e73\u5747<\/td><td>\u5bf9\u5f02\u5e38\u503c\u4e0d\u654f\u611f\uff0c\u66f4\u7a33\u5065<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code><code>from&nbsp;sklearn.metrics&nbsp;import&nbsp;mean_squared_error, mean_absolute_error<\/code><code><\/code><code># \u628a\u9884\u6d4b\u7ed3\u679c\u8fd8\u539f\u6210\u771f\u5b9e\u4ef7\u683c<\/code><code>actual_test_prices = scaler.inverse_transform(y_test.reshape(-1,&nbsp;1))<\/code><code><\/code><code># \u8ba1\u7b97\u5404\u9879\u8bef\u5dee\u6307\u6807<\/code><code>mse &nbsp;= mean_squared_error(actual_test_prices, test_preds)<\/code><code>rmse = np.sqrt(mse)<\/code><code>mae &nbsp;= mean_absolute_error(actual_test_prices, test_preds)<\/code><code><\/code><code>print(f\"\u6a21\u578b\u5728\u6d4b\u8bd5\u96c6\u4e0a\u7684\u8868\u73b0\uff1a\")<\/code><code>print(f\"- \u5747\u65b9\u8bef\u5dee(MSE):&nbsp;{mse:.4f}\")<\/code><code>print(f\"- \u5747\u65b9\u6839\u8bef\u5dee(RMSE):&nbsp;{rmse:.4f}\")<\/code><code>print(f\"- \u5e73\u5747\u7edd\u5bf9\u8bef\u5dee(MAE):&nbsp;{mae:.4f}\")<\/code><code><\/code><code># \u8f93\u51fa\u7ed3\u679c\u793a\u4f8b\uff1a<\/code><code># \u6a21\u578b\u5728\u6d4b\u8bd5\u96c6\u4e0a\u7684\u8868\u73b0\uff1a<\/code><code># - \u5747\u65b9\u8bef\u5dee(MSE): 0.1201<\/code><code># - \u5747\u65b9\u6839\u8bef\u5dee(RMSE): 0.3466<\/code><code># - \u5e73\u5747\u7edd\u5bf9\u8bef\u5dee(MAE): 0.2848<\/code><\/code><\/pre>\n\n\n\n<p>\u62ff\u6211\u4eec\u4f8b\u5b50\u91cc\u7684\u6570\u5b57\u6765\u8bf4\uff0cMAE\u662f0.28\u5de6\u53f3\uff0cRMSE\u662f0.35\u5de6\u53f3\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/\u6a21\u578b\u9884\u6d4b-vs-\u5b9e\u9645\u4ef7\u683c\u5bf9\u6bd4.png\" alt=\"\" class=\"wp-image-3836\" srcset=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/\u6a21\u578b\u9884\u6d4b-vs-\u5b9e\u9645\u4ef7\u683c\u5bf9\u6bd4.png 700w, https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2026\/03\/\u6a21\u578b\u9884\u6d4b-vs-\u5b9e\u9645\u4ef7\u683c\u5bf9\u6bd4-300x160.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p>\u8fd9\u610f\u5473\u7740\uff1a<strong>\u6a21\u578b\u9884\u6d4b\u4ef7\u683c\u8ddf\u5b9e\u9645\u4ef7\u683c\u7684\u5e73\u5747\u5dee\u8ddd\u5927\u6982\u662f3\u6bdb\u94b1<\/strong>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e94\u30013\u500dRMSE\u6cd5\u5219\uff1a\u600e\u4e48\u8fc7\u6ee4&#8221;\u566a\u97f3\u4fe1\u53f7&#8221;<\/strong><\/h2>\n\n\n\n<p>\u77e5\u9053\u6a21\u578b\u7684\u8bef\u5dee\u8303\u56f4\u4e4b\u540e\uff0c\u4e0b\u4e00\u4e2a\u95ee\u9898\u5c31\u662f\uff1a\u4ec0\u4e48\u65f6\u5019\u8be5\u4fe1\u6a21\u578b\u7684\u9884\u6d4b\uff0c\u4ec0\u4e48\u65f6\u5019\u8be5\u5ffd\u7565\u5b83\uff1f<\/p>\n\n\n\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u5f88\u5b9e\u7528\u7684\u6cd5\u5219\u2014\u2014<strong>3\u500dRMSE\u6cd5\u5219<\/strong>\u3002\u53ea\u6709\u5f53\u6a21\u578b\u9884\u6d4b\u7684\u6ce2\u52a8\u5e45\u5ea6\u81f3\u5c11\u662fRMSE\u4e09\u500d\u4ee5\u4e0a\u7684\u65f6\u5019\uff0c\u8fd9\u4e2a\u4fe1\u53f7\u624d\u503c\u5f97\u91cd\u89c6\u3002\u4e3a\u4ec0\u4e48\u4e0d\u662f\u770b\u5230\u9884\u6d4b\u6da8\u8dcc\u5c31\u884c\u52a8\uff1f\u539f\u56e0\u5f88\u7b80\u5355\uff1a\u5982\u679c\u6a21\u578b\u9884\u6d4b\u4ef7\u683c\u4f1a\u53d8\u52a80.2\u7f8e\u5143\uff0c\u4f46\u5b83\u7684\u5e73\u5747\u8bef\u5dee\u662f0.35\u7f8e\u5143\uff0c\u90a3\u8fd9\u4e2a&#8221;\u9884\u6d4b&#8221;\u5176\u5b9e\u8ddf\u63b7\u786c\u5e01\u5dee\u4e0d\u591a\u3002\u4f60\u771f\u6b63\u5e94\u8be5\u5173\u6ce8\u7684\uff0c\u662f\u90a3\u4e9b\u9884\u6d4b\u5e45\u5ea6\u660e\u663e\u8d85\u8fc7\u8bef\u5dee\u8303\u56f4\u7684\u4fe1\u53f7\u3002<\/p>\n\n\n\n<p>\u7528\u6570\u5b57\u6765\u8bf4\u660e\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\"><strong>RMSE\u500d\u6570<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>\u5bf9\u5e94\u6ce2\u52a8<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>\u4fe1\u53f7\u53ef\u4fe1\u5ea6<\/strong><\/th><\/tr><\/thead><tbody><tr><td>1\u500dRMSE<\/td><td>$0.35<\/td><td>\u566a\u97f3\u592a\u5927\uff0c\u7b49\u4e8e\u8d4c\u8fd0\u6c14<\/td><\/tr><tr><td>2\u500dRMSE<\/td><td>$0.70<\/td><td>\u5f00\u59cb\u6709\u53c2\u8003\u4ef7\u503c<\/td><\/tr><tr><td>3\u500dRMSE<\/td><td>$1.05<\/td><td>\u9ec4\u91d1\u6807\u51c6\uff0c\u503c\u5f97\u91cd\u89c6<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u8fd9\u80cc\u540e\u7684\u903b\u8f91\u6765\u81ea\u7edf\u8ba1\u5b66\u4e0a\u7684&#8221;<strong>68-95-99.7\u6cd5\u5219<\/strong>&#8220;\uff08\u4e5f\u53eb\u6b63\u6001\u5206\u5e03\u4e09\u897f\u683c\u739b\u539f\u5219\uff09\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>1\u03c3\uff081\u500dRMSE\uff09<\/strong>\u00a0\u2014 \u8986\u76d668%\u7684\u6570\u636e\uff0c\u5c5e\u4e8e&#8221;\u666e\u901a&#8221;\u6c34\u5e73\u3002<\/li>\n\n\n\n<li><strong>2\u03c3\uff082\u500dRMSE\uff09<\/strong>\u00a0\u2014 \u8986\u76d695%\u7684\u6570\u636e\uff0c\u5c5e\u4e8e&#8221;\u8f83\u53ef\u4fe1&#8221;\u6c34\u5e73\u3002<\/li>\n\n\n\n<li><strong>3\u03c3\uff083\u500dRMSE\uff09<\/strong>\u00a0\u2014 \u8986\u76d699.7%\u7684\u6570\u636e\uff0c\u5c5e\u4e8e&#8221;\u51e0\u4e4e\u786e\u5b9a&#8221;\u6c34\u5e73\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5b9e\u6218\u7ecf\u9a8c\uff1a\u771f\u5b9e\u5e02\u573a\u8fd8\u6709\u6ed1\u70b9\u3001\u4ef7\u5dee\u3001\u624b\u7eed\u8d39\u8fd9\u4e9b\u6210\u672c\u3002\u5982\u679c\u4f60\u6bcf\u4e2a\u5c0f\u6ce2\u52a8\u90fd\u8ddf\u7740\u6a21\u578b\u8d70\uff0c\u8fd9\u4e9b\u6210\u672c\u4f1a\u6162\u6162\u5403\u6389\u4f60\u7684\u8d26\u6237\u30023\u500d\u6cd5\u5219\u5e2e\u4f60\u8fc7\u6ee4\u6389\u566a\u97f3\uff0c\u53ea\u53c2\u4e0e\u771f\u6b63\u6709\u628a\u63e1\u7684\u673a\u4f1a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u516d\u3001\u5de5\u5177\u7684\u5c40\u9650\u6027\uff1a\u5b83\u4e0d\u662f\u4e07\u80fd\u7684<\/strong><br><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. \u8d8b\u52bf\u884c\u60c5\u6548\u679c\u597d\uff0c\u9707\u8361\u884c\u60c5\u6548\u679c\u5dee<\/strong><\/h3>\n\n\n\n<p>LSTM\u64c5\u957f\u7684\u662f&#8221;\u5ef6\u7eed&#8221;\u2014\u2014\u5ef6\u7eed\u4e4b\u524d\u7684\u4e0a\u6da8\u6216\u8005\u4e0b\u8dcc\u3002\u4f46\u5728\u6a2a\u76d8\u9707\u8361\u7684\u65f6\u5019\uff0c\u6a21\u5f0f\u4f1a\u53cd\u590d\u5207\u6362\uff0c\u6a21\u578b\u7684\u9884\u6d4b\u5c31\u4f1a\u53d8\u5f97\u5f88\u4e0d\u7a33\u5b9a\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. \u5bf9\u7a81\u53d1\u6d88\u606f\u5b8c\u5168\u65e0\u611f<\/strong><\/h3>\n\n\n\n<p>\u6a21\u578b\u53ea\u80fd\u770b\u5230\u4ef7\u683c\u6570\u636e\u672c\u8eab\uff0c\u5982\u679c\u7a81\u7136\u51fa\u4e86\u4e2a\u91cd\u5927\u6d88\u606f\u5bfc\u81f4\u4ef7\u683c\u8df3\u7a7a\uff0c\u6a21\u578b\u662f\u6ca1\u529e\u6cd5\u9884\u5224\u7684\u3002\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u6536\u76d8\u540e\u7684\u590d\u76d8\u7279\u522b\u91cd\u8981\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. \u53ea\u7528\u4ef7\u683c\u6570\u636e\uff0c\u4fe1\u606f\u91cf\u6709\u9650<\/strong><\/h3>\n\n\n\n<p>\u5f53\u524d\u7684\u7248\u672c\u53ea\u7528\u4e86\u6536\u76d8\u4ef7\u3002\u5982\u679c\u52a0\u4e0a\u6210\u4ea4\u91cf\u3001RSI\u3001\u5747\u7ebf\u8fd9\u4e9b\u6307\u6807\uff0c\u6a21\u578b\u7684\u5224\u65ad\u7ef4\u5ea6\u4f1a\u66f4\u4e30\u5bcc\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e03\u3001\u4ece80\u884c\u4ee3\u7801\u5f00\u59cb\u4f60\u7684\u91cf\u5316\u4e4b\u65c5<\/strong><\/h2>\n\n\n\n<p>\u4eca\u5929\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\u3002\u8fd9\u4e2a\u5de5\u5177\u867d\u7136\u7b80\u5355\uff0c\u4f46\u5b83\u7ed9\u4f60\u6253\u5f00\u4e86\u4e00\u6247\u7a97\uff1a<strong>\u91cf\u5316\u4e0d\u662f\u9ad8\u4e0d\u53ef\u6500\u7684\uff0c80\u884c\u4ee3\u7801\u5c31\u80fd\u8dd1\u8d77\u6765<\/strong>\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u8fd9\u4e2a\u5de5\u5177\u8dd1\u4e86\u4e00\u6bb5\u65f6\u95f4\uff0c\u4f60\u89c9\u5f97\u987a\u624b\u4e86\uff0c\u53ef\u4ee5\u8003\u8651\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u5411\u5347\u7ea7\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u52a0\u5165\u6210\u4ea4\u91cf<\/strong>\u00a0\u2014 \u6210\u4ea4\u91cf\u7684\u53d8\u5316\u5f80\u5f80\u80fd\u63d0\u524d\u53cd\u6620\u5e02\u573a\u60c5\u7eea\u3002<\/li>\n\n\n\n<li><strong>\u52a0\u5165\u6280\u672f\u6307\u6807<\/strong>\u00a0\u2014 RSI\u3001MACD\u3001\u5e03\u6797\u5e26\u90fd\u53ef\u4ee5\u4f5c\u4e3a\u989d\u5916\u8f93\u5165\u3002<\/li>\n\n\n\n<li><strong>\u62c9\u957f\u8bad\u7ec3\u7a97\u53e3<\/strong>\u00a0\u2014 \u7528\u8fc7\u53bb\u51e0\u5929\u7684\u6570\u636e\u4e00\u8d77\u8bad\u7ec3\u3002<\/li>\n\n\n\n<li><strong>\u8bb0\u5f55\u6bcf\u6b21\u9884\u6d4b\u7684\u80dc\u7387<\/strong>\u00a0\u2014 \u7528Excel\u8bb0\u4e0b\u6765\uff0c\u6162\u6162\u79ef\u7d2f\u5bf9\u6a21\u578b\u7684\u8ba4\u77e5\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u6700\u540e\u518d\u5f3a\u8c03\u4e00\u904d\uff1a<strong>\u8fd9\u4e2a\u5de5\u5177\u662f\u7528\u6765\u8f85\u52a9\u4f60\u770b\u76d8\u7684\uff0c\u4e0d\u662f\u66ff\u4f60\u505a\u51b3\u5b9a\u7684<\/strong>\u3002\u6a21\u578b\u7ed9\u7684\u662f\u6982\u7387\uff0c\u4f60\u505a\u7684\u662f\u51b3\u7b56\u3002\u4e24\u8005\u7ed3\u5408\uff0c\u624d\u662f\u73b0\u4ee3\u4ea4\u6613\u8005\u8be5\u6709\u7684\u6837\u5b50\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u603b \u7ed3<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>LSTM\u662f\u64c5\u957f\u5904\u7406\u65f6\u95f4\u5e8f\u5217\u7684\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\uff0c\u80fd\u591f\u5b66\u4e60\u4ef7\u683c\u8d70\u52bf\u4e2d\u7684\u6a21\u5f0f\u3002<\/li>\n\n\n\n<li>\u8be5\u5de5\u5177\u7684\u6838\u5fc3\u4ef7\u503c\u5728\u4e8e\u63d0\u4f9b\u5ba2\u89c2\u7684\u91cf\u5316\u89c6\u89d2\uff0c\u4e0e\u4eba\u7684\u4e3b\u89c2\u5224\u65ad\u5f62\u6210\u4e92\u8865\u3002<\/li>\n\n\n\n<li>\u6a21\u578b\u4f7f\u7528\u524d\u9700\u8981\u5bf9\u6570\u636e\u8fdb\u884c\u5f52\u4e00\u5316\u5904\u7406\uff0c80%\u6570\u636e\u8bad\u7ec3\u300120%\u6570\u636e\u6d4b\u8bd5\u3002<\/li>\n\n\n\n<li>3\u500dRMSE\u6cd5\u5219\u662f\u5b9e\u7528\u7684\u4fe1\u53f7\u7b5b\u9009\u6807\u51c6\uff0c\u53ea\u6709\u8d85\u8fc7\u9608\u503c\u7684\u9884\u6d4b\u624d\u503c\u5f97\u91cd\u89c6\u3002<\/li>\n\n\n\n<li>\u5de5\u5177\u53ef\u4ee5\u968f\u9700\u6c42\u5347\u7ea7\uff0c\u52a0\u5165\u6210\u4ea4\u91cf\u3001\u6280\u672f\u6307\u6807\u7b49\u66f4\u591a\u7279\u5f81\u6765\u4e30\u5bcc\u6a21\u578b\u3002<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\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>\u98ce\u9669\u63d0\u793a\uff1a<\/strong>\u672c\u6587\u4ec5\u4f9b\u53c2\u8003\uff0c\u4e0d\u6784\u6210\u6295\u8d44\u5efa\u8bae\u3002\u6295\u8d44\u6709\u98ce\u9669\uff0c\u5165\u5e02\u9700\u8c28\u614e\u3002<\/pre>\n\n\n\n<pre class=\"wp-block-verse\"><strong>\u7248\u6743\u58f0\u660e\uff1a<\/strong>\u672c\u6587\u4e3a\u539f\u521b\u5185\u5bb9\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002<\/pre>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>#LSTM\u6a21\u578b #\u91cf\u5316\u4ea4\u6613\u5165\u95e8 #Python\u91cf\u5316 #\u65e5\u5185\u4ea4\u6613\u7b56\u7565 #\u673a\u5668\u5b66\u4e60\u4ea4\u6613 #\u4ea4\u6613\u4fe1\u53f7\u5206\u6790 #\u91cf\u5316\u5de5\u5177\u5206\u4eab #Python\u4ee3\u7801\u6559\u5b66 #\u91d1\u878d\u79d1\u6280 #\u4ea4\u6613\u8f85\u52a9\u5de5\u5177<\/p>\n\n\n\n<p><\/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:\/\/www.laoyulaoyu.com\/index.php\/2026\/04\/10\/%e9%87%8f%e5%8c%96%e5%b0%8f%e5%8a%a9%e6%89%8b%ef%bc%9alstm%e5%9c%a8%e6%97%a5%e5%86%85%e4%ba%a4%e6%98%93%e4%b8%ad%e7%9a%84%e5%ae%9e%e6%88%98%e5%ba%94%e7%94%a8\/\">Continue reading<span class=\"screen-reader-text\">\u91cf\u5316\u5c0f\u52a9\u624b\uff1aLSTM\u5728\u65e5\u5185\u4ea4\u6613\u4e2d\u7684\u5b9e\u6218\u5e94\u7528<\/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":[17,4,5],"class_list":{"0":"post-3833","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-aiinvest","7":"tag-ai","10":"entry"},"_links":{"self":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/3833","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/comments?post=3833"}],"version-history":[{"count":2,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/3833\/revisions"}],"predecessor-version":[{"id":3840,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/3833\/revisions\/3840"}],"wp:attachment":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/media?parent=3833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/categories?post=3833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/tags?post=3833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}