From f43688f0dab36305e286cbd8a64d98be0b4a7091 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Sat, 6 Aug 2022 14:38:22 +0900 Subject: [PATCH] init --- README.md | 10 ++++++++++ Simulation.py | 4 ++-- stock/util/Stock2Vector.py | 8 ++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c7b2eb0..9dd8ce3 100644 --- a/README.md +++ b/README.md @@ -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. ``` diff --git a/Simulation.py b/Simulation.py index 9b6d3bb..3aeb711 100644 --- a/Simulation.py +++ b/Simulation.py @@ -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) diff --git a/stock/util/Stock2Vector.py b/stock/util/Stock2Vector.py index 9853ad7..a9fe18b 100644 --- a/stock/util/Stock2Vector.py +++ b/stock/util/Stock2Vector.py @@ -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)