Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit15e18cb

Browse files
committed
updated stock price prediction tutorial
1 parent7cc58a0 commit15e18cb

File tree

37 files changed

+11128
-12271
lines changed

37 files changed

+11128
-12271
lines changed

‎machine-learning/stock-prediction/data/AAPL_2020-01-08.csvrenamed to‎machine-learning/stock-prediction/data/AAPL_2020-04-28.csv

Lines changed: 9927 additions & 9850 deletions
Large diffs are not rendered by default.

‎machine-learning/stock-prediction/data/TSLA_2020-01-08.csv

Lines changed: 0 additions & 2400 deletions
This file was deleted.

‎machine-learning/stock-prediction/parameters.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55

66
# Window size or the sequence length
7-
N_STEPS=100
7+
N_STEPS=70
88
# Lookup step, 1 is the next day
9-
LOOKUP_STEP=90
9+
LOOKUP_STEP=1
1010

1111
# test ratio size, 0.2 is 20%
1212
TEST_SIZE=0.2
@@ -24,17 +24,23 @@
2424
UNITS=256
2525
# 40% dropout
2626
DROPOUT=0.4
27+
# whether to use bidirectional RNNs
28+
BIDIRECTIONAL=False
2729

2830
### training parameters
2931

30-
# mean squared error loss
31-
LOSS="mse"
32-
OPTIMIZER="rmsprop"
32+
# mean absolute error loss
33+
# LOSS = "mae"
34+
# huber loss
35+
LOSS="huber_loss"
36+
OPTIMIZER="adam"
3337
BATCH_SIZE=64
34-
EPOCHS=300
38+
EPOCHS=400
3539

3640
# Apple stock market
3741
ticker="AAPL"
3842
ticker_data_filename=os.path.join("data",f"{ticker}_{date_now}.csv")
39-
# model name to save
40-
model_name=f"{date_now}_{ticker}-{LOSS}-{CELL.__name__}-seq-{N_STEPS}-step-{LOOKUP_STEP}-layers-{N_LAYERS}-units-{UNITS}"
43+
# model name to save, making it as unique as possible based on parameters
44+
model_name=f"{date_now}_{ticker}-{LOSS}-{OPTIMIZER}-{CELL.__name__}-seq-{N_STEPS}-step-{LOOKUP_STEP}-layers-{N_LAYERS}-units-{UNITS}"
45+
ifBIDIRECTIONAL:
46+
model_name+="-b"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp