Spaces:
Runtime error
Runtime error
File size: 1,727 Bytes
c97655d 08e016d 54df5db 08e016d c97655d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
from get_forecast import get_forecast
import gradio as gr
with gr.Blocks() as demo:
gr.Markdown(
"""
# AB InBev Data Science Challenge
Welcome to the AB InBev Data Science Challenge demo! This interactive tool is designed to help you forecast the **SOM** and **Volume** series, and analyze their price sensitivity.
## How to use this demo?
Using this demo is simple and straightforward. Just follow these steps:
1. Select the series you want to forecast from the dropdown menu. The valid options are **SOM** and **Volume**.
2. Specify the number of months ahead for your forecast.
3. Choose the desired price variation compared to the previous year. A value of 0 indicates that the future price values will be the same as the previous year.
That's it! You're ready to explore and analyze the forecasted series. Enjoy!
""")
with gr.Row():
serie = gr.Dropdown(choices = ['SOM', 'Volumen'], value = 'SOM', label = 'Serie', info = 'Choose the serie to forecast')
periods = gr.Slider(minimum = 1, maximum = 12, step = 1, value = 3, label = 'Months')
percent_change = gr.Slider(minimum = -100, maximum = 100, step = 5, value = -5, label = '% Change vs Last Year')
plot = gr.Plot()
serie.change(get_forecast, [serie, periods, percent_change], plot, queue=False)
periods.change(get_forecast, [serie, periods, percent_change], plot, queue=False)
percent_change.change(get_forecast, [serie, periods, percent_change], plot, queue=False)
plot.change(get_forecast, [serie, periods, percent_change], plot, queue=False)
demo.load(get_forecast, [serie, periods, percent_change], plot, queue=False)
demo.launch(debug = False) |