Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Lawrence Tang
/
stocks
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5a529460
authored
Jun 17, 2021
by
Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
parent
3c6892e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
correlation_test_all.py
model.py
correlation_test_all.py
View file @
5a529460
...
...
@@ -52,7 +52,8 @@ def main():
if
len
(
prev_price_dict
[
i
[
"ticker"
]])
>
LEN_PREV
:
prev_price_dict
[
i
[
"ticker"
]]
.
pop
(
0
)
prev_price_dict
[
i
[
"ticker"
]]
.
append
(
float
(
i
[
"open"
]))
prev_price_dict
[
i
[
"ticker"
]]
.
append
(
float
(
i
[
"open"
]))
for
i
in
av_gain_turn_dict
:
if
count_pos_dict
[
i
]
>
0
and
count_turn_dict
[
i
]
>
0
and
count_dict
[
i
]
>
0
:
...
...
model.py
View file @
5a529460
import
csv
import
torch.nn
as
nn
import
torch
#
import torch.nn as nn
#
import torch
import
math
import
os
import
io
import
numpy
as
np
import
pandas
as
pd
import
random
from
torch.utils.data
import
Dataset
,
DataLoader
,
random_split
import
torch.nn.functional
as
F
from
torchvision
import
transforms
#
from torch.utils.data import Dataset, DataLoader, random_split
#
import torch.nn.functional as F
#
from torchvision import transforms
FILE_NAME
=
"historical_stock_prices.csv"
OUTPUT_FILE_NAME
=
"30-day-stocks.csv"
...
...
@@ -177,5 +177,4 @@ def train():
correct
=
0.0
if
__name__
==
"__main__"
:
make_dataset
()
train
()
\ No newline at end of file
make_dataset
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment