init
This commit is contained in:
10
README.md
10
README.md
@@ -1,6 +1,16 @@
|
|||||||
# StockPredictor
|
# 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
|
## Troubleshoot
|
||||||
1. OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized.
|
1. OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized.
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -166,10 +166,10 @@ if __name__ == "__main__":
|
|||||||
stock_codes = {
|
stock_codes = {
|
||||||
# 252670
|
# 252670
|
||||||
# 122630
|
# 122630
|
||||||
"252670": ['20220804'],
|
"252670": ['20220805'],
|
||||||
}
|
}
|
||||||
|
|
||||||
method = "answer" # "ml", "answer"
|
method = "" # "ml", "answer"
|
||||||
for stock_code in stock_codes:
|
for stock_code in stock_codes:
|
||||||
simulation = Simulation(RESOURCE_PATH)
|
simulation = Simulation(RESOURCE_PATH)
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class Stock2Vector(HTS):
|
|||||||
conn = sqlite3.connect(os.path.join(self.RESOURCE_PATH, "hts.db"))
|
conn = sqlite3.connect(os.path.join(self.RESOURCE_PATH, "hts.db"))
|
||||||
cursor = conn.cursor()
|
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,))
|
#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()
|
db_result = cursor.fetchall()
|
||||||
temp_result = []
|
temp_result = []
|
||||||
@@ -269,13 +269,13 @@ class Stock2Vector(HTS):
|
|||||||
X.append(temp_X)
|
X.append(temp_X)
|
||||||
if TOTAL_Y[0][i] == 0:
|
if TOTAL_Y[0][i] == 0:
|
||||||
#Y.append([1, 0, 0])
|
#Y.append([1, 0, 0])
|
||||||
Y.append([0])
|
Y.append(0)
|
||||||
elif TOTAL_Y[0][i] == 0.5:
|
elif TOTAL_Y[0][i] == 0.5:
|
||||||
#Y.append([0, 1, 0])
|
#Y.append([0, 1, 0])
|
||||||
Y.append([1])
|
Y.append(1)
|
||||||
else:
|
else:
|
||||||
#Y.append([0, 0, 1])
|
#Y.append([0, 0, 1])
|
||||||
Y.append([2])
|
Y.append(2)
|
||||||
|
|
||||||
X = np.asarray(X)
|
X = np.asarray(X)
|
||||||
Y = np.asarray(Y)
|
Y = np.asarray(Y)
|
||||||
|
|||||||
Reference in New Issue
Block a user