analyser_hj3415 2.10.0__tar.gz → 2.10.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/PKG-INFO +1 -1
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/analyser_hj3415/tsa.py +18 -11
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/pyproject.toml +1 -1
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/.gitignore +0 -0
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/README.md +0 -0
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/analyser_hj3415/__init__.py +0 -0
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/analyser_hj3415/cli.py +0 -0
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/analyser_hj3415/eval.py +0 -0
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/analyser_hj3415/workroom/__init__.py +0 -0
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/analyser_hj3415/workroom/mysklearn.py +0 -0
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/analyser_hj3415/workroom/mysklearn2.py +0 -0
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/analyser_hj3415/workroom/score.py +0 -0
- {analyser_hj3415-2.10.0 → analyser_hj3415-2.10.1}/analyser_hj3415/workroom/trash.py +0 -0
@@ -192,6 +192,21 @@ class MyProphet:
|
|
192
192
|
else:
|
193
193
|
Exception("to 인자가 맞지 않습니다.")
|
194
194
|
|
195
|
+
def scoring(self) -> int:
|
196
|
+
last_real_data = self.df_real.iloc[-1]
|
197
|
+
recent_price = last_real_data['y']
|
198
|
+
recent_date = datetime.strftime(last_real_data['ds'], '%Y-%m-%d')
|
199
|
+
yhat_dict = self.get_yhat()
|
200
|
+
tsa_logger.info(f'recent_price: {recent_price}, yhat_dict: {yhat_dict}')
|
201
|
+
yhat_lower = int(yhat_dict['yhat_lower'])
|
202
|
+
deviation = int(eval.Tools.cal_deviation(recent_price, yhat_lower))
|
203
|
+
if recent_price > yhat_lower:
|
204
|
+
score = -deviation
|
205
|
+
else:
|
206
|
+
score = deviation
|
207
|
+
print(f"{self.code}/{self.name} date: {recent_date} 가격:{recent_price} 기대하한값:{yhat_lower} 편차:{deviation} score:{score}")
|
208
|
+
return score
|
209
|
+
|
195
210
|
@classmethod
|
196
211
|
def ranking(cls, refresh = False, expire_time_h = 24, top='all') -> OrderedDict:
|
197
212
|
"""
|
@@ -208,22 +223,14 @@ class MyProphet:
|
|
208
223
|
def fetch_ranking() -> dict:
|
209
224
|
data = {}
|
210
225
|
p = MyProphet('005930')
|
211
|
-
for
|
226
|
+
for code in myredis.Corps.list_all_codes():
|
212
227
|
try:
|
213
228
|
p.code = code
|
214
229
|
except ValueError:
|
215
230
|
tsa_logger.error(f'myprophet ranking error : {code}/{myredis.Corps(code, "c101").get_name()}')
|
216
231
|
continue
|
217
|
-
|
218
|
-
|
219
|
-
recent_date = datetime.strftime(last_real_data['ds'], '%Y-%m-%d')
|
220
|
-
yhat_dict = p.get_yhat()
|
221
|
-
tsa_logger.info(f'recent_price: {recent_price}, yhat_dict: {yhat_dict}')
|
222
|
-
yhat_lower = int(yhat_dict['yhat_lower'])
|
223
|
-
if recent_price < yhat_lower:
|
224
|
-
deviation = int(eval.Tools.cal_deviation(recent_price, yhat_lower))
|
225
|
-
data[code] = deviation
|
226
|
-
print(f"{i}.{p.code}/{p.name} date: {recent_date} 가격:{recent_price} 기대하한값:{yhat_lower} 편차:{deviation}")
|
232
|
+
score = p.scoring()
|
233
|
+
data[code] = score
|
227
234
|
return data
|
228
235
|
|
229
236
|
data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_ranking, timer=expire_time_h * 3600)
|
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
|