farquasar commited on
Commit
a3eeeeb
·
verified ·
1 Parent(s): a4e3034

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -152,7 +152,7 @@ def get_data_predict(
152
 
153
  btc_data_ = remove_outliers(btc_data_, epsilon)
154
  bch_data_ = remove_outliers(bch_data_, epsilon)
155
- print(btc_data_)
156
 
157
  if normalized:
158
  # merge with ori if you still want to include historical yf data
@@ -202,17 +202,18 @@ with open('model_n4h_cat.pkl','rb') as f:
202
  def predict_and_plot(timeframe, limit, epsilon, n_steps, ma):
203
  period = f'{limit}d'
204
  # original “ori” series now also from yfinance
205
- btc_ori = fetch_yfinance_data('BTC/USDT', period, timeframe)
206
- bch_ori = fetch_yfinance_data('BCH/USDT', period, timeframe)
207
-
208
- btc_data, bch_data, label = get_data_predict(
209
- btc_ori, bch_ori,
210
- symbol='BCH/USDT',
211
- timeframe=timeframe,
212
- epsilon=epsilon,
213
- normalized=True,
214
- limit=limit
215
- )
 
216
  model = model_n1d_cat if timeframe=='1d' else model_n4h_cat
217
  preds = predictions(model, btc_data, bch_data, name=timeframe, n_steps=n_steps)
218
  fig = plot(preds, label=label, timeframe=timeframe, ma=ma, n_steps=n_steps)
 
152
 
153
  btc_data_ = remove_outliers(btc_data_, epsilon)
154
  bch_data_ = remove_outliers(bch_data_, epsilon)
155
+ # print(btc_data_.head)
156
 
157
  if normalized:
158
  # merge with ori if you still want to include historical yf data
 
202
  def predict_and_plot(timeframe, limit, epsilon, n_steps, ma):
203
  period = f'{limit}d'
204
  # original “ori” series now also from yfinance
205
+ btc_data = fetch_yfinance_data('BTC/USDT', period, timeframe)
206
+ bch_data = fetch_yfinance_data('BCH/USDT', period, timeframe)
207
+ btc_data, _ = normalize(btc_data)
208
+ bch_data, _ = normalize(bch_data)
209
+ # btc_data, bch_data, label = get_data_predict(
210
+ # btc_ori, bch_ori,
211
+ # symbol='BCH/USDT',
212
+ # timeframe=timeframe,
213
+ # epsilon=epsilon,
214
+ # normalized=True,
215
+ # limit=limit
216
+ # )
217
  model = model_n1d_cat if timeframe=='1d' else model_n4h_cat
218
  preds = predictions(model, btc_data, bch_data, name=timeframe, n_steps=n_steps)
219
  fig = plot(preds, label=label, timeframe=timeframe, ma=ma, n_steps=n_steps)