analyser_hj3415 2.9.12__tar.gz → 2.9.14__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/PKG-INFO +1 -1
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/analyser_hj3415/cli.py +4 -4
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/analyser_hj3415/eval.py +1 -1
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/analyser_hj3415/tsa.py +14 -3
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/pyproject.toml +1 -1
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/.gitignore +0 -0
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/README.md +0 -0
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/analyser_hj3415/__init__.py +0 -0
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/analyser_hj3415/workroom/__init__.py +0 -0
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/analyser_hj3415/workroom/mysklearn.py +0 -0
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/analyser_hj3415/workroom/mysklearn2.py +0 -0
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/analyser_hj3415/workroom/score.py +0 -0
- {analyser_hj3415-2.9.12 → analyser_hj3415-2.9.14}/analyser_hj3415/workroom/trash.py +0 -0
@@ -207,7 +207,7 @@ def analyser_manager():
|
|
207
207
|
elif args.type == 'prophet':
|
208
208
|
if args.command == 'ranking':
|
209
209
|
myprophet = tsa.MyProphet
|
210
|
-
result = myprophet.ranking(refresh=args.refresh, expire_time_h=
|
210
|
+
result = myprophet.ranking(refresh=args.refresh, expire_time_h=48)
|
211
211
|
print(result)
|
212
212
|
mymongo.Logs.save('cli','INFO', 'run >> analyser prophet ranking')
|
213
213
|
|
@@ -215,13 +215,13 @@ def analyser_manager():
|
|
215
215
|
mylstm = tsa.MyLSTM
|
216
216
|
if args.command == 'caching':
|
217
217
|
if args.top:
|
218
|
-
mylstm.caching_based_on_prophet_ranking(refresh=args.refresh, expire_time_h=
|
218
|
+
mylstm.caching_based_on_prophet_ranking(refresh=args.refresh, expire_time_h=96, top=args.top)
|
219
219
|
else:
|
220
|
-
mylstm.caching_based_on_prophet_ranking(refresh=args.refresh, expire_time_h=
|
220
|
+
mylstm.caching_based_on_prophet_ranking(refresh=args.refresh, expire_time_h=96)
|
221
221
|
mymongo.Logs.save('cli','INFO', f'run >> analyser lstm caching / top={args.top if args.top else 20}')
|
222
222
|
elif args.command == 'get':
|
223
223
|
assert utils.is_6digit(args.code), "code 인자는 6자리 숫자이어야 합니다."
|
224
|
-
result = mylstm(args.code).get_final_predictions(refresh=args.refresh, expire_time_h=
|
224
|
+
result = mylstm(args.code).get_final_predictions(refresh=args.refresh, expire_time_h=96)
|
225
225
|
mymongo.Logs.save('cli','INFO', f'run >> analyser lstm get {args.code}')
|
226
226
|
|
227
227
|
elif args.type == 'setting':
|
@@ -193,7 +193,7 @@ class MyProphet:
|
|
193
193
|
Exception("to 인자가 맞지 않습니다.")
|
194
194
|
|
195
195
|
@classmethod
|
196
|
-
def ranking(cls, refresh = False, expire_time_h = 24) -> OrderedDict:
|
196
|
+
def ranking(cls, refresh = False, expire_time_h = 24, top='all') -> OrderedDict:
|
197
197
|
"""
|
198
198
|
가장 최근 날짜의 랭킹 분석
|
199
199
|
:param refresh:
|
@@ -209,7 +209,11 @@ class MyProphet:
|
|
209
209
|
data = {}
|
210
210
|
p = MyProphet('005930')
|
211
211
|
for i, code in enumerate(myredis.Corps.list_all_codes()):
|
212
|
-
|
212
|
+
try:
|
213
|
+
p.code = code
|
214
|
+
except ValueError:
|
215
|
+
tsa_logger.error(f'myprophet ranking error : {code}/{myredis.Corps(code, "c101").get_name()}')
|
216
|
+
continue
|
213
217
|
last_real_data = p._preprocessing_for_prophet().iloc[-1]
|
214
218
|
recent_price = last_real_data['y']
|
215
219
|
recent_date = datetime.strftime(last_real_data['ds'], '%Y-%m-%d')
|
@@ -224,7 +228,14 @@ class MyProphet:
|
|
224
228
|
|
225
229
|
data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_ranking, timer=expire_time_h * 3600)
|
226
230
|
|
227
|
-
|
231
|
+
ranking = OrderedDict(sorted(data_dict.items(), key=lambda item: item[1], reverse=True))
|
232
|
+
if top == 'all':
|
233
|
+
return ranking
|
234
|
+
else:
|
235
|
+
if isinstance(top, int):
|
236
|
+
return OrderedDict(list(ranking.items())[:top])
|
237
|
+
else:
|
238
|
+
raise ValueError("top 인자는 int 형이어야 합니다.")
|
228
239
|
|
229
240
|
@dataclass
|
230
241
|
class LSTMData:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|