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

@@ -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)