Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
souvik03-136 committed Oct 24, 2024
1 parent 790dac0 commit 3f01e17
Show file tree
Hide file tree
Showing 10 changed files with 1,200,136 additions and 139 deletions.
Binary file modified demand_forecast/__pycache__/bokeh_forecast.cpython-310.pyc
Binary file not shown.
Binary file modified demand_forecast/__pycache__/forecasting.cpython-310.pyc
Binary file not shown.
Binary file added demand_forecast/best_model.keras
Binary file not shown.
11 changes: 0 additions & 11 deletions demand_forecast/bokeh_forecast.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
from bokeh.plotting import figure, show, output_file
from bokeh.layouts import column
from bokeh.models import ColumnDataSource







def create_bokeh_plots(df, item_id, future_months, predicted_demand):
item_data = df[df['item_id'] == item_id].copy()
item_data['year_month'] = item_data['transaction_date'].dt.to_period('M')
actual_demand = item_data.groupby('year_month')['quantity'].sum().reset_index()

actual_source = ColumnDataSource(
data=dict(month=actual_demand['year_month'].dt.to_timestamp(), quantity=actual_demand['quantity']))
predicted_source = ColumnDataSource(data=dict(month=future_months, quantity=predicted_demand))

actual_plot = figure(title=f'Actual Demand for Item ID {item_id}', x_axis_label='Date', y_axis_label='Quantity',
x_axis_type='datetime')
actual_plot.line('month', 'quantity', source=actual_source, line_width=2, color='blue',
legend_label='Actual Demand')
actual_plot.scatter('month', 'quantity', source=actual_source, size=8, color='blue')

predicted_plot = figure(title=f'Predicted Demand for Item ID {item_id}', x_axis_label='Date',
y_axis_label='Quantity', x_axis_type='datetime')
predicted_plot.line('month', 'quantity', source=predicted_source, line_width=2, color='orange',
legend_label='Predicted Demand')
predicted_plot.scatter('month', 'quantity', source=predicted_source, size=8, color='orange')

output_file("demand_forecasting.html")
show(column(actual_plot, predicted_plot))
Loading

0 comments on commit 3f01e17

Please sign in to comment.