analyser_hj3415 2.8.0__tar.gz → 2.8.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/PKG-INFO +1 -1
  2. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/tsa.py +8 -5
  3. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/pyproject.toml +1 -1
  4. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/.DS_Store +0 -0
  5. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/.gitattributes +0 -0
  6. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/.gitignore +0 -0
  7. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/.idea/.gitignore +0 -0
  8. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/.idea/analyser-hj3415.iml +0 -0
  9. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  10. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/.idea/misc.xml +0 -0
  11. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/.idea/modules.xml +0 -0
  12. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/.idea/vcs.xml +0 -0
  13. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/LICENSE +0 -0
  14. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/README.md +0 -0
  15. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/.DS_Store +0 -0
  16. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/__init__.py +0 -0
  17. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/cli.py +0 -0
  18. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/eval.py +0 -0
  19. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/workroom/__init__.py +0 -0
  20. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/workroom/lstm.py +0 -0
  21. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/workroom/mysklearn.py +0 -0
  22. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/workroom/mysklearn2.py +0 -0
  23. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/workroom/score.py +0 -0
  24. {analyser_hj3415-2.8.0 → analyser_hj3415-2.8.1}/analyser_hj3415/workroom/trash.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: analyser_hj3415
3
- Version: 2.8.0
3
+ Version: 2.8.1
4
4
  Summary: Stock analyser and database processing programs
5
5
  Author-email: Hyungjin Kim <hj3415@gmail.com>
6
6
  Description-Content-Type: text/markdown
@@ -105,12 +105,13 @@ class MyProphet:
105
105
 
106
106
  def get_yhat(self) -> dict:
107
107
  """
108
- 예측하는 첫째날의 예측 데이터를 반환한다.
108
+ 최근 날짜의 예측데이터를 반환한다.
109
109
  :return: {'ds':..., 'yhat':.., 'yhat_lower':.., 'yhat_upper':..,}
110
110
  """
111
111
  df = self.df_forecast
112
- analyser_logger.debug(df)
113
- yhat_dict = df.iloc[0][['ds', 'yhat_lower', 'yhat_upper', 'yhat']].to_dict()
112
+ last_real_date = self.df_real.iloc[-1]['ds']
113
+ analyser_logger.info(last_real_date)
114
+ yhat_dict = df[df['ds']==last_real_date].iloc[0][['ds', 'yhat_lower', 'yhat_upper', 'yhat']].to_dict()
114
115
  analyser_logger.info(yhat_dict)
115
116
  return yhat_dict
116
117
 
@@ -186,14 +187,16 @@ class MyProphet:
186
187
  p = MyProphet('005930')
187
188
  for i, code in enumerate(myredis.Corps.list_all_codes()):
188
189
  p.code = code
189
- recent_price = p._preprocessing_for_prophet().iloc[-1]['y']
190
+ last_real_data = p._preprocessing_for_prophet().iloc[-1]
191
+ recent_price = last_real_data['y']
192
+ recent_date = datetime.strftime(last_real_data['ds'], '%Y-%m-%d')
190
193
  yhat_dict = p.get_yhat()
191
194
  analyser_logger.info(f'recent_price: {recent_price}, yhat_dict: {yhat_dict}')
192
195
  yhat_lower = int(yhat_dict['yhat_lower'])
193
196
  if recent_price < yhat_lower:
194
197
  deviation = int(eval.Tools.cal_deviation(recent_price, yhat_lower))
195
198
  data[code] = deviation
196
- print(f"{i}.{p.code}/{p.name} 최근가격:{recent_price} 기대하한값:{yhat_lower} 편차:{deviation}")
199
+ print(f"{i}.{p.code}/{p.name} date: {recent_date} 가격:{recent_price} 기대하한값:{yhat_lower} 편차:{deviation}")
197
200
  return data
198
201
 
199
202
  data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_ranking, timer=expire_time)
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "analyser_hj3415"
7
- version = "2.8.0"
7
+ version = "2.8.1"
8
8
  authors = [{name = "Hyungjin Kim", email = "hj3415@gmail.com"}]
9
9
  description = "Stock analyser and database processing programs"
10
10
  readme = "README.md"
File without changes