analyser_hj3415 2.9.17__tar.gz → 2.10.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/PKG-INFO +3 -3
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/analyser_hj3415/tsa.py +31 -15
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/pyproject.toml +3 -3
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/.gitignore +0 -0
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/README.md +0 -0
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/analyser_hj3415/__init__.py +0 -0
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/analyser_hj3415/cli.py +0 -0
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/analyser_hj3415/eval.py +0 -0
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/analyser_hj3415/workroom/__init__.py +0 -0
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/analyser_hj3415/workroom/mysklearn.py +0 -0
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/analyser_hj3415/workroom/mysklearn2.py +0 -0
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/analyser_hj3415/workroom/score.py +0 -0
- {analyser_hj3415-2.9.17 → analyser_hj3415-2.10.0}/analyser_hj3415/workroom/trash.py +0 -0
@@ -1,11 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: analyser_hj3415
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.10.0
|
4
4
|
Summary: Stock analyser and database processing programs
|
5
5
|
Requires-Python: >=3.6
|
6
6
|
Description-Content-Type: text/markdown
|
7
|
-
Requires-Dist: utils-hj3415>=2.9.
|
8
|
-
Requires-Dist: db-hj3415>=4.
|
7
|
+
Requires-Dist: utils-hj3415>=2.9.4
|
8
|
+
Requires-Dist: db-hj3415>=4.2.3
|
9
9
|
Requires-Dist: scikit-learn>=1.5.2
|
10
10
|
Requires-Dist: plotly>=5.24.1
|
11
11
|
Requires-Dist: yfinance>=0.2.44
|
@@ -290,7 +290,7 @@ class MyLSTM:
|
|
290
290
|
@code.setter
|
291
291
|
def code(self, code: str):
|
292
292
|
assert utils.is_6digit(code), f'Invalid value : {code}'
|
293
|
-
tsa_logger.
|
293
|
+
tsa_logger.debug(f'change code : {self.code} -> {code}')
|
294
294
|
|
295
295
|
self._code = code
|
296
296
|
self.name = myredis.Corps(code, 'c101').get_name()
|
@@ -346,12 +346,28 @@ class MyLSTM:
|
|
346
346
|
y.append(data[i + time_step, 0])
|
347
347
|
return np.array(X), np.array(y)
|
348
348
|
|
349
|
+
|
349
350
|
X_train, y_train_1d = create_dataset(train_data_2d)
|
350
351
|
X_test, y_test_1d = create_dataset(test_data_2d)
|
352
|
+
tsa_logger.debug(X_train.shape)
|
353
|
+
tsa_logger.debug(X_test.shape)
|
351
354
|
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
+
try:
|
356
|
+
# LSTM 모델 입력을 위해 데이터를 3차원으로 변환
|
357
|
+
X_train_3d = X_train.reshape(X_train.shape[0], X_train.shape[1], 1)
|
358
|
+
X_test_3d = X_test.reshape(X_test.shape[0], X_test.shape[1], 1)
|
359
|
+
except IndexError:
|
360
|
+
return LSTMData(
|
361
|
+
code=self.code,
|
362
|
+
data_2d=np.array([]),
|
363
|
+
train_size=0,
|
364
|
+
train_data_2d=np.array([]),
|
365
|
+
test_data_2d=np.array([]),
|
366
|
+
X_train_3d=np.array([]),
|
367
|
+
X_test_3d=np.array([]),
|
368
|
+
y_train_1d=np.array([]),
|
369
|
+
y_test_1d=np.array([]),
|
370
|
+
)
|
355
371
|
|
356
372
|
tsa_logger.debug(f'n_dim - X_train_3d : {X_train_3d.ndim}, X_test_3d : {X_test_3d.ndim}, y_train : {y_train_1d.ndim}, y_test : {y_test_1d.ndim}')
|
357
373
|
tsa_logger.debug(f'len - X_train_3d : {len(X_train_3d)}, X_test_3d : {len(X_test_3d)}, y_train : {len(y_train_1d)}, y_test : {len(y_test_1d)}')
|
@@ -517,8 +533,11 @@ class MyLSTM:
|
|
517
533
|
:return:
|
518
534
|
"""
|
519
535
|
# 앙상블 테스트와 채점
|
520
|
-
|
536
|
+
try:
|
537
|
+
_, _, ensemble_future_predictions_2d = self.ensemble_training(
|
521
538
|
num=num_in)
|
539
|
+
except IndexError:
|
540
|
+
return [], []
|
522
541
|
|
523
542
|
"""if grading:
|
524
543
|
lstm_grade = self.grading(ensemble_train_predictions_2d, ensemble_test_predictions_2d)
|
@@ -671,17 +690,14 @@ class MyLSTM:
|
|
671
690
|
plt.title('Stock Price Prediction with LSTM Ensemble')
|
672
691
|
plt.show()"""
|
673
692
|
|
674
|
-
def is_up(self)->
|
693
|
+
def is_up(self)-> bool:
|
675
694
|
# 튜플의 [0]은 날짜 [1]은 값 배열
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
return all(flattened_data[i] < flattened_data[i + 1] for i in range(len(flattened_data) - 1))
|
683
|
-
else:
|
684
|
-
return None
|
695
|
+
data = self.get_final_predictions(refresh=False, expire_time_h=24)[1]
|
696
|
+
# 데이터를 1D 배열로 변환
|
697
|
+
flattened_data = data.flatten()
|
698
|
+
tsa_logger.debug(f"flattened_data : {flattened_data}")
|
699
|
+
# 증가 여부 확인
|
700
|
+
return all(flattened_data[i] < flattened_data[i + 1] for i in range(len(flattened_data) - 1))
|
685
701
|
|
686
702
|
@staticmethod
|
687
703
|
def caching_based_on_prophet_ranking(refresh: bool, expire_time_h: int, top=20):
|
@@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
|
|
5
5
|
|
6
6
|
[project]
|
7
7
|
name = "analyser_hj3415"
|
8
|
-
version = "2.
|
8
|
+
version = "2.10.0"
|
9
9
|
description = "Stock analyser and database processing programs"
|
10
10
|
readme = "README.md"
|
11
11
|
requires-python = ">=3.6"
|
@@ -20,8 +20,8 @@ requires-python = ">=3.6"
|
|
20
20
|
# "Operating System :: OS Independent"
|
21
21
|
#]
|
22
22
|
dependencies = [
|
23
|
-
"utils-hj3415>=2.9.
|
24
|
-
"db-hj3415>=4.
|
23
|
+
"utils-hj3415>=2.9.4",
|
24
|
+
"db-hj3415>=4.2.3",
|
25
25
|
"scikit-learn>=1.5.2",
|
26
26
|
"plotly>=5.24.1",
|
27
27
|
"yfinance>=0.2.44",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|