This commit is contained in:
dsyoon
2022-08-06 14:38:22 +09:00
parent 35a1c939e9
commit f43688f0da
3 changed files with 16 additions and 6 deletions

View File

@@ -1,6 +1,16 @@
# StockPredictor
## Reference
* Vision Transormers 참고
* https://github.com/NielsRogge/Transformers-Tutorials/blob/master/VisionTransformer/Fine_tuning_the_Vision_Transformer_on_CIFAR_10_with_the_%F0%9F%A4%97_Trainer.ipynb
* How to convert datasets from a python dictionary
* https://huggingface.co/docs/datasets/v1.1.1/loading_datasets.html
* numpy -> tensor -> PILImage 변환 방법
* https://qlsenddl-lab.tistory.com/37
* Image Classification Models
* https://github.com/weiaicunzai/awesome-image-classification
## Troubleshoot
1. OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized.
```

View File

@@ -166,10 +166,10 @@ if __name__ == "__main__":
stock_codes = {
# 252670
# 122630
"252670": ['20220804'],
"252670": ['20220805'],
}
method = "answer" # "ml", "answer"
method = "" # "ml", "answer"
for stock_code in stock_codes:
simulation = Simulation(RESOURCE_PATH)

View File

@@ -159,7 +159,7 @@ class Stock2Vector(HTS):
conn = sqlite3.connect(os.path.join(self.RESOURCE_PATH, "hts.db"))
cursor = conn.cursor()
cursor.execute('SELECT ymd, hms, open, high, low, close, volume, label FROM ' + tableName + ' WHERE CODE=? and (ymd >= ? and ymd <= ?) order by ymd desc, hms ', (stock_code, "20220701", "20220731"))
cursor.execute('SELECT ymd, hms, open, high, low, close, volume, label FROM ' + tableName + ' WHERE CODE=? and (ymd >= ? and ymd <= ?) order by ymd desc, hms ', (stock_code, "20220726", "20220731"))
#cursor.execute('SELECT ymd, hms, open, high, low, close, volume, label FROM ' + tableName + ' WHERE CODE=? order by ymd desc, hms ', (stock_code,))
db_result = cursor.fetchall()
temp_result = []
@@ -269,13 +269,13 @@ class Stock2Vector(HTS):
X.append(temp_X)
if TOTAL_Y[0][i] == 0:
#Y.append([1, 0, 0])
Y.append([0])
Y.append(0)
elif TOTAL_Y[0][i] == 0.5:
#Y.append([0, 1, 0])
Y.append([1])
Y.append(1)
else:
#Y.append([0, 0, 1])
Y.append([2])
Y.append(2)
X = np.asarray(X)
Y = np.asarray(Y)