stinoco commited on
Commit
1264840
·
1 Parent(s): 4d1aec1

changed labels

Browse files
Files changed (1) hide show
  1. get_forecast.py +3 -3
get_forecast.py CHANGED
@@ -53,13 +53,13 @@ def get_forecast(serie: str, periods, percent_change: int):
53
  df_future[f'{serie} without price change'] = values_0.rename(columns = {'ds': 'Date', 'yhat': serie})[serie]
54
  df_future['Diff'] = df_future[serie] - df_future[f'{serie} without price change']
55
  df_future[serie] = df_future[serie].apply(lambda x: round(x, 4))
56
- df_future[f'{serie} without prince change'] = df_future[f'{serie} without price change'].apply(lambda x: round(x, 4))
57
  df_future['Diff'] = df_future['Diff'].apply(lambda x: round(x, 4))
58
 
59
  # plot
60
  fig = plt.figure()
61
- plt.plot(future_aux['ds'], future_aux['yhat'], label = 'Forecast with price change', marker = '.', color = 'C1')
62
- plt.plot(aux_0['ds'], aux_0['yhat'], label = 'Forecast without price change', marker = '.', color = 'C2')
63
  plt.plot(history['ds'], history['y'], label = 'Historic data', marker = '.', color = 'C0')
64
  plt.xticks(rotation = 45)
65
  plt.ylabel(serie)
 
53
  df_future[f'{serie} without price change'] = values_0.rename(columns = {'ds': 'Date', 'yhat': serie})[serie]
54
  df_future['Diff'] = df_future[serie] - df_future[f'{serie} without price change']
55
  df_future[serie] = df_future[serie].apply(lambda x: round(x, 4))
56
+ df_future[f'{serie} without price change'] = df_future[f'{serie} without price change'].apply(lambda x: round(x, 4))
57
  df_future['Diff'] = df_future['Diff'].apply(lambda x: round(x, 4))
58
 
59
  # plot
60
  fig = plt.figure()
61
+ plt.plot(future_aux['ds'], future_aux['yhat'], label = 'Price Change Forecast', marker = '.', color = 'C1')
62
+ plt.plot(aux_0['ds'], aux_0['yhat'], label = 'No Price Change Forecast', marker = '.', color = 'C2')
63
  plt.plot(history['ds'], history['y'], label = 'Historic data', marker = '.', color = 'C0')
64
  plt.xticks(rotation = 45)
65
  plt.ylabel(serie)