From 2ca0c07f55303cbc320187e7991d0f52b2dc9ac3 Mon Sep 17 00:00:00 2001 From: kahung33 Date: Thu, 30 Mar 2023 21:39:10 -0600 Subject: [PATCH] =?UTF-8?q?Update=20=F0=9F=9B=A0=5F10=5FTime=5Fseries=5Ffu?= =?UTF-8?q?ndamentals=5Fand=5FMilestone=5FProject=5F3=5FBitPredict=5F?= =?UTF-8?q?=F0=9F=92=B0=F0=9F=93=88=5FExercise=5FSolutions.ipynb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the documentation of tensorflow, the ds should be generate in this way, data = price[:-WINDOW_SIZE] targets = price[WINDOW_SIZE:] in the original code, both price are passed in, it simply treat the 1st data point in price as the first label --- ...\360\237\222\260\360\237\223\210_Exercise_Solutions.ipynb" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/extras/solutions/\360\237\233\240_10_Time_series_fundamentals_and_Milestone_Project_3_BitPredict_\360\237\222\260\360\237\223\210_Exercise_Solutions.ipynb" "b/extras/solutions/\360\237\233\240_10_Time_series_fundamentals_and_Milestone_Project_3_BitPredict_\360\237\222\260\360\237\223\210_Exercise_Solutions.ipynb" index 6312a98..f92017d 100644 --- "a/extras/solutions/\360\237\233\240_10_Time_series_fundamentals_and_Milestone_Project_3_BitPredict_\360\237\222\260\360\237\223\210_Exercise_Solutions.ipynb" +++ "b/extras/solutions/\360\237\233\240_10_Time_series_fundamentals_and_Milestone_Project_3_BitPredict_\360\237\222\260\360\237\223\210_Exercise_Solutions.ipynb" @@ -1535,7 +1535,7 @@ }, "source": [ "ds = tf.keras.utils.timeseries_dataset_from_array(\n", - " data = prices , targets = prices , sequence_length = WINDOW_SIZE , sequence_stride = HORIZON, \n", + " data = prices[:-WINDOW_SIZE] , targets = prices[WINDOW_SIZE:] , sequence_length = WINDOW_SIZE , sequence_stride = HORIZON, \n", " batch_size = 128\n", ")" ], @@ -4784,4 +4784,4 @@ "outputs": [] } ] -} \ No newline at end of file +}