Spaces:
Runtime error
Runtime error
zhang qiao
commited on
Commit
·
49ba314
1
Parent(s):
f3054b6
Upload folder using huggingface_hub
Browse files- .DS_Store +0 -0
- .env +2 -0
- .gitignore +160 -0
- .vscode/settings.json +6 -0
- README.md +3 -9
- __pycache__/gr_app.cpython-310.pyc +0 -0
- configs/idsc_config.yaml +4 -0
- data/mock/demand_table.csv +4 -0
- data/mock/product_table.csv +4 -0
- gr_app.py +235 -0
- gradio/calculator.py +33 -0
- gradio/hello.py +59 -0
- notebooks/inventory.ipynb +1421 -0
- requirements.txt +1 -0
- src/.DS_Store +0 -0
- src/__init__.py +1 -0
- src/__pycache__/GradioApp.cpython-310.pyc +0 -0
- src/__pycache__/GradioFns.cpython-310.pyc +0 -0
- src/__pycache__/__init__.cpython-310.pyc +0 -0
- src/__pycache__/gr_args.cpython-310.pyc +0 -0
- src/apis/__init__.py +0 -0
- src/apis/idsc_login.py +40 -0
- src/apis/inventory.py +0 -0
- src/demo_data/example_inventory.csv +6 -0
- src/demo_data/example_rm.csv +3 -0
- src/demo_data/example_wip.csv +4 -0
- src/gr/GradioApp.py +376 -0
- src/gr/GradioFns.py +144 -0
- src/gr/__init__.py +0 -0
- src/gr/__pycache__/GradioApp.cpython-310.pyc +0 -0
- src/gr/__pycache__/GradioFns.cpython-310.pyc +0 -0
- src/gr/__pycache__/__init__.cpython-310.pyc +0 -0
- src/gr/__pycache__/gr_args.cpython-310.pyc +0 -0
- src/gr/gr_args.py +132 -0
- src/idsc/__pycache__/idsc_apis.cpython-310.pyc +0 -0
- src/idsc/idsc_apis.py +134 -0
- src/idsc/idsc_config.yaml +2 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
.env
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
IDSC_ACC=sentient_test@idsc.com.sg
|
| 2 |
+
IDSC_PASS=APItest1412
|
.gitignore
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
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.class
|
| 5 |
+
|
| 6 |
+
# C extensions
|
| 7 |
+
*.so
|
| 8 |
+
|
| 9 |
+
# Distribution / packaging
|
| 10 |
+
.Python
|
| 11 |
+
build/
|
| 12 |
+
develop-eggs/
|
| 13 |
+
dist/
|
| 14 |
+
downloads/
|
| 15 |
+
eggs/
|
| 16 |
+
.eggs/
|
| 17 |
+
lib/
|
| 18 |
+
lib64/
|
| 19 |
+
parts/
|
| 20 |
+
sdist/
|
| 21 |
+
var/
|
| 22 |
+
wheels/
|
| 23 |
+
share/python-wheels/
|
| 24 |
+
*.egg-info/
|
| 25 |
+
.installed.cfg
|
| 26 |
+
*.egg
|
| 27 |
+
MANIFEST
|
| 28 |
+
|
| 29 |
+
# PyInstaller
|
| 30 |
+
# Usually these files are written by a python script from a template
|
| 31 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 32 |
+
*.manifest
|
| 33 |
+
*.spec
|
| 34 |
+
|
| 35 |
+
# Installer logs
|
| 36 |
+
pip-log.txt
|
| 37 |
+
pip-delete-this-directory.txt
|
| 38 |
+
|
| 39 |
+
# Unit test / coverage reports
|
| 40 |
+
htmlcov/
|
| 41 |
+
.tox/
|
| 42 |
+
.nox/
|
| 43 |
+
.coverage
|
| 44 |
+
.coverage.*
|
| 45 |
+
.cache
|
| 46 |
+
nosetests.xml
|
| 47 |
+
coverage.xml
|
| 48 |
+
*.cover
|
| 49 |
+
*.py,cover
|
| 50 |
+
.hypothesis/
|
| 51 |
+
.pytest_cache/
|
| 52 |
+
cover/
|
| 53 |
+
|
| 54 |
+
# Translations
|
| 55 |
+
*.mo
|
| 56 |
+
*.pot
|
| 57 |
+
|
| 58 |
+
# Django stuff:
|
| 59 |
+
*.log
|
| 60 |
+
local_settings.py
|
| 61 |
+
db.sqlite3
|
| 62 |
+
db.sqlite3-journal
|
| 63 |
+
|
| 64 |
+
# Flask stuff:
|
| 65 |
+
instance/
|
| 66 |
+
.webassets-cache
|
| 67 |
+
|
| 68 |
+
# Scrapy stuff:
|
| 69 |
+
.scrapy
|
| 70 |
+
|
| 71 |
+
# Sphinx documentation
|
| 72 |
+
docs/_build/
|
| 73 |
+
|
| 74 |
+
# PyBuilder
|
| 75 |
+
.pybuilder/
|
| 76 |
+
target/
|
| 77 |
+
|
| 78 |
+
# Jupyter Notebook
|
| 79 |
+
.ipynb_checkpoints
|
| 80 |
+
|
| 81 |
+
# IPython
|
| 82 |
+
profile_default/
|
| 83 |
+
ipython_config.py
|
| 84 |
+
|
| 85 |
+
# pyenv
|
| 86 |
+
# For a library or package, you might want to ignore these files since the code is
|
| 87 |
+
# intended to run in multiple environments; otherwise, check them in:
|
| 88 |
+
# .python-version
|
| 89 |
+
|
| 90 |
+
# pipenv
|
| 91 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 92 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 93 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 94 |
+
# install all needed dependencies.
|
| 95 |
+
#Pipfile.lock
|
| 96 |
+
|
| 97 |
+
# poetry
|
| 98 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
| 99 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
| 100 |
+
# commonly ignored for libraries.
|
| 101 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
| 102 |
+
#poetry.lock
|
| 103 |
+
|
| 104 |
+
# pdm
|
| 105 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
| 106 |
+
#pdm.lock
|
| 107 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
| 108 |
+
# in version control.
|
| 109 |
+
# https://pdm.fming.dev/#use-with-ide
|
| 110 |
+
.pdm.toml
|
| 111 |
+
|
| 112 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
| 113 |
+
__pypackages__/
|
| 114 |
+
|
| 115 |
+
# Celery stuff
|
| 116 |
+
celerybeat-schedule
|
| 117 |
+
celerybeat.pid
|
| 118 |
+
|
| 119 |
+
# SageMath parsed files
|
| 120 |
+
*.sage.py
|
| 121 |
+
|
| 122 |
+
# Environments
|
| 123 |
+
.env
|
| 124 |
+
.venv
|
| 125 |
+
env/
|
| 126 |
+
venv/
|
| 127 |
+
ENV/
|
| 128 |
+
env.bak/
|
| 129 |
+
venv.bak/
|
| 130 |
+
|
| 131 |
+
# Spyder project settings
|
| 132 |
+
.spyderproject
|
| 133 |
+
.spyproject
|
| 134 |
+
|
| 135 |
+
# Rope project settings
|
| 136 |
+
.ropeproject
|
| 137 |
+
|
| 138 |
+
# mkdocs documentation
|
| 139 |
+
/site
|
| 140 |
+
|
| 141 |
+
# mypy
|
| 142 |
+
.mypy_cache/
|
| 143 |
+
.dmypy.json
|
| 144 |
+
dmypy.json
|
| 145 |
+
|
| 146 |
+
# Pyre type checker
|
| 147 |
+
.pyre/
|
| 148 |
+
|
| 149 |
+
# pytype static type analyzer
|
| 150 |
+
.pytype/
|
| 151 |
+
|
| 152 |
+
# Cython debug symbols
|
| 153 |
+
cython_debug/
|
| 154 |
+
|
| 155 |
+
# PyCharm
|
| 156 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
| 157 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
| 158 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
| 159 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 160 |
+
#.idea/
|
.vscode/settings.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"[python]": {
|
| 3 |
+
"editor.defaultFormatter": "ms-python.autopep8"
|
| 4 |
+
},
|
| 5 |
+
"python.formatting.provider": "none"
|
| 6 |
+
}
|
README.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
colorFrom: yellow
|
| 5 |
-
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
---
|
| 11 |
-
|
| 12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: inventory-optimization-demo
|
| 3 |
+
app_file: gr_app.py
|
|
|
|
|
|
|
| 4 |
sdk: gradio
|
| 5 |
+
sdk_version: 3.41.0
|
|
|
|
|
|
|
| 6 |
---
|
|
|
|
|
|
__pycache__/gr_app.cpython-310.pyc
ADDED
|
Binary file (3.72 kB). View file
|
|
|
configs/idsc_config.yaml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
apikey: 61ef23ae00df4f91417ec0d45fe7b03319f1bdc7
|
| 2 |
+
apikey_expire: 08/17/2023, 13:54:15
|
| 3 |
+
email: sentient_test@idsc.com.sg
|
| 4 |
+
password: APItest1412
|
data/mock/demand_table.csv
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
product,demand
|
| 2 |
+
White Bread,40
|
| 3 |
+
Special Cake,40
|
| 4 |
+
Wedding Cake,30
|
data/mock/product_table.csv
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
product,price,cost,required_space_per_unit,inventory_consideration_range
|
| 2 |
+
White Bread,100,70,3,0.1
|
| 3 |
+
Special Cake,100,60,2,0.1
|
| 4 |
+
Wedding Cake,100,50,3,0.1
|
gr_app.py
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
from src.gr.GradioApp import GradioApp
|
| 4 |
+
from src.gr import gr_args
|
| 5 |
+
|
| 6 |
+
# =============================== #
|
| 7 |
+
# Inventory Optimization Demo App #
|
| 8 |
+
# =============================== #
|
| 9 |
+
|
| 10 |
+
app = GradioApp()
|
| 11 |
+
|
| 12 |
+
demo = gr.Blocks(**gr_args.main_block)
|
| 13 |
+
|
| 14 |
+
with demo:
|
| 15 |
+
|
| 16 |
+
gr.Markdown('# Inventory Optimization')
|
| 17 |
+
|
| 18 |
+
with gr.Tabs() as tabs:
|
| 19 |
+
|
| 20 |
+
# ============================ #
|
| 21 |
+
# Raw Material Optimization #
|
| 22 |
+
# ============================ #
|
| 23 |
+
with gr.TabItem('Raw Material Optimization', id=0):
|
| 24 |
+
with gr.Row():
|
| 25 |
+
with gr.Column():
|
| 26 |
+
|
| 27 |
+
# Inventory Optimization #
|
| 28 |
+
rm_md = gr.Markdown(**gr_args.rm_md)
|
| 29 |
+
|
| 30 |
+
with gr.Row():
|
| 31 |
+
|
| 32 |
+
# [ Load Demo Dataset ] #
|
| 33 |
+
rm_demo_data_btn = gr.Button(
|
| 34 |
+
**gr_args.rm_demo_data_btn)
|
| 35 |
+
|
| 36 |
+
rm_file = gr.File(**gr_args.rm_file)
|
| 37 |
+
|
| 38 |
+
# [Inventory Optimization Input] #
|
| 39 |
+
rm_input_df = gr.Dataframe(**gr_args.rm_input_df)
|
| 40 |
+
|
| 41 |
+
with gr.Row():
|
| 42 |
+
|
| 43 |
+
# [FG Storage Capacity] #
|
| 44 |
+
rm_storage_capacity = gr.Number(
|
| 45 |
+
**gr_args.rm_storage_capacity)
|
| 46 |
+
|
| 47 |
+
# [FG Budget] #
|
| 48 |
+
rm_budget_constraint = gr.Number(
|
| 49 |
+
**gr_args.rm_budget_constraint)
|
| 50 |
+
|
| 51 |
+
# [Optimize Raw Material Inventory] #
|
| 52 |
+
rm_btn = gr.Button(**gr_args.rm_btn)
|
| 53 |
+
|
| 54 |
+
gr.Markdown('# Raw Material Inventory Recommendations')
|
| 55 |
+
with gr.Row():
|
| 56 |
+
rm_total_capacity_usage_md = gr.Markdown()
|
| 57 |
+
rm_total_budget_usage_md = gr.Markdown()
|
| 58 |
+
|
| 59 |
+
rm_recom_df = gr.Dataframe()
|
| 60 |
+
|
| 61 |
+
rm_plot = gr.Plot()
|
| 62 |
+
|
| 63 |
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
| 64 |
+
# Raw Material Event Listeners #
|
| 65 |
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
| 66 |
+
rm_demo_data_btn.click(
|
| 67 |
+
app.rm_demo_data_btn__click,
|
| 68 |
+
[], [rm_input_df, rm_storage_capacity, rm_budget_constraint])
|
| 69 |
+
|
| 70 |
+
rm_file.upload(
|
| 71 |
+
app.rm_file__upload,
|
| 72 |
+
[rm_file], [rm_input_df])
|
| 73 |
+
|
| 74 |
+
rm_storage_capacity.change(
|
| 75 |
+
app.rm_storage_capacity__change,
|
| 76 |
+
[rm_storage_capacity], [])
|
| 77 |
+
|
| 78 |
+
rm_budget_constraint.change(
|
| 79 |
+
app.rm_budget_constraint__change,
|
| 80 |
+
[rm_budget_constraint], [])
|
| 81 |
+
|
| 82 |
+
rm_btn.click(
|
| 83 |
+
app.rm_btn__click,
|
| 84 |
+
[],
|
| 85 |
+
[rm_recom_df,
|
| 86 |
+
rm_total_capacity_usage_md,
|
| 87 |
+
rm_total_budget_usage_md,
|
| 88 |
+
rm_plot])
|
| 89 |
+
|
| 90 |
+
# ================ #
|
| 91 |
+
# WIP Optimization #
|
| 92 |
+
# ================ #
|
| 93 |
+
with gr.TabItem('WIP Optimization', id=1):
|
| 94 |
+
|
| 95 |
+
with gr.Row():
|
| 96 |
+
with gr.Column():
|
| 97 |
+
|
| 98 |
+
# Inventory Optimization #
|
| 99 |
+
wip_md = gr.Markdown(**gr_args.wip_md)
|
| 100 |
+
|
| 101 |
+
with gr.Row():
|
| 102 |
+
|
| 103 |
+
# [ Load Demo Dataset ] #
|
| 104 |
+
wip_demo_data_btn = gr.Button(
|
| 105 |
+
**gr_args.wip_demo_data_btn)
|
| 106 |
+
|
| 107 |
+
wip_file = gr.File(**gr_args.wip_file)
|
| 108 |
+
|
| 109 |
+
# [Inventory Optimization Input] #
|
| 110 |
+
wip_input_df = gr.Dataframe(**gr_args.wip_input_df)
|
| 111 |
+
|
| 112 |
+
with gr.Row():
|
| 113 |
+
|
| 114 |
+
# [FG Storage Capacity] #
|
| 115 |
+
wip_storage_capacity = gr.Number(
|
| 116 |
+
**gr_args.wip_storage_capacity)
|
| 117 |
+
|
| 118 |
+
# [FG Budget] #
|
| 119 |
+
wip_budget_constraint = gr.Number(
|
| 120 |
+
**gr_args.wip_budget_constraint)
|
| 121 |
+
|
| 122 |
+
# [Optimize Raw Material Inventory] #
|
| 123 |
+
wip_btn = gr.Button(**gr_args.wip_btn)
|
| 124 |
+
|
| 125 |
+
gr.Markdown('# WIP Inventory Recommendations')
|
| 126 |
+
with gr.Row():
|
| 127 |
+
wip_total_capacity_usage_md = gr.Markdown()
|
| 128 |
+
wip_total_budget_usage_md = gr.Markdown()
|
| 129 |
+
|
| 130 |
+
wip_recom_df = gr.Dataframe()
|
| 131 |
+
|
| 132 |
+
wip_plot = gr.Plot()
|
| 133 |
+
|
| 134 |
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
| 135 |
+
# WIP Event Listeners #
|
| 136 |
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
| 137 |
+
wip_demo_data_btn.click(
|
| 138 |
+
app.wip_demo_data_btn__click,
|
| 139 |
+
[], [wip_input_df, wip_storage_capacity, wip_budget_constraint])
|
| 140 |
+
|
| 141 |
+
wip_file.upload(
|
| 142 |
+
app.wip_file__upload,
|
| 143 |
+
[wip_file], [wip_input_df])
|
| 144 |
+
|
| 145 |
+
wip_storage_capacity.change(
|
| 146 |
+
app.wip_storage_capacity__change,
|
| 147 |
+
[wip_storage_capacity], [])
|
| 148 |
+
|
| 149 |
+
wip_budget_constraint.change(
|
| 150 |
+
app.wip_budget_constraint__change,
|
| 151 |
+
[wip_budget_constraint], [])
|
| 152 |
+
|
| 153 |
+
wip_btn.click(
|
| 154 |
+
app.wip_btn__click,
|
| 155 |
+
[],
|
| 156 |
+
[wip_recom_df,
|
| 157 |
+
wip_total_capacity_usage_md,
|
| 158 |
+
wip_total_budget_usage_md,
|
| 159 |
+
wip_plot])
|
| 160 |
+
|
| 161 |
+
# ============================ #
|
| 162 |
+
# Finishend Goods Optimization #
|
| 163 |
+
# ============================ #
|
| 164 |
+
with gr.TabItem('FG Optimization', id=2):
|
| 165 |
+
with gr.Row():
|
| 166 |
+
with gr.Column():
|
| 167 |
+
|
| 168 |
+
# Inventory Optimization #
|
| 169 |
+
inventory_md = gr.Markdown(**gr_args.inventory_md)
|
| 170 |
+
|
| 171 |
+
with gr.Row():
|
| 172 |
+
|
| 173 |
+
# [ Load Demo Dataset ] #
|
| 174 |
+
demo_data_btn = gr.Button(**gr_args.demo_data_btn)
|
| 175 |
+
|
| 176 |
+
inventory_file = gr.File(**gr_args.inventory_file)
|
| 177 |
+
|
| 178 |
+
# [Inventory Optimization Input] #
|
| 179 |
+
inventory_input_df = gr.Dataframe(**gr_args.inventory_input_df)
|
| 180 |
+
|
| 181 |
+
with gr.Row():
|
| 182 |
+
|
| 183 |
+
# [FG Storage Capacity] #
|
| 184 |
+
inventory_storage_capacity = gr.Number(
|
| 185 |
+
**gr_args.inventory_storage_capacity)
|
| 186 |
+
|
| 187 |
+
# [FG Budget] #
|
| 188 |
+
inventory_budget_constraint = gr.Number(
|
| 189 |
+
**gr_args.inventory_budget_constraint)
|
| 190 |
+
|
| 191 |
+
# [Optimize Inventory] #
|
| 192 |
+
inventory_btn = gr.Button(**gr_args.inventory_btn)
|
| 193 |
+
|
| 194 |
+
gr.Markdown('# Inventory Recommendations')
|
| 195 |
+
with gr.Row():
|
| 196 |
+
inv_total_profit_md = gr.Markdown()
|
| 197 |
+
inv_total_capacity_usage_md = gr.Markdown()
|
| 198 |
+
inv_total_budget_usage_md = gr.Markdown()
|
| 199 |
+
inv_total_margin_md = gr.Markdown()
|
| 200 |
+
|
| 201 |
+
inv_recom_df = gr.Dataframe()
|
| 202 |
+
|
| 203 |
+
inv_plot = gr.Plot()
|
| 204 |
+
|
| 205 |
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
| 206 |
+
# FG Optimization Event Listeners #
|
| 207 |
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
| 208 |
+
demo_data_btn.click(
|
| 209 |
+
app.demo_data_btn__click,
|
| 210 |
+
[], [inventory_input_df, inventory_storage_capacity, inventory_budget_constraint])
|
| 211 |
+
|
| 212 |
+
inventory_file.upload(
|
| 213 |
+
app.inventory_file__upload,
|
| 214 |
+
[inventory_file], [inventory_input_df])
|
| 215 |
+
|
| 216 |
+
inventory_storage_capacity.change(
|
| 217 |
+
app.inventory_storage_capacity__change,
|
| 218 |
+
[inventory_storage_capacity], [])
|
| 219 |
+
|
| 220 |
+
inventory_budget_constraint.change(
|
| 221 |
+
app.inventory_budget_constraint__change,
|
| 222 |
+
[inventory_budget_constraint], [])
|
| 223 |
+
|
| 224 |
+
inventory_btn.click(
|
| 225 |
+
app.inventory_btn__click,
|
| 226 |
+
[],
|
| 227 |
+
[inv_recom_df,
|
| 228 |
+
inv_total_profit_md,
|
| 229 |
+
inv_total_capacity_usage_md,
|
| 230 |
+
inv_total_budget_usage_md,
|
| 231 |
+
inv_total_margin_md,
|
| 232 |
+
inv_plot])
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
demo.launch()
|
gradio/calculator.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def calculator(num1, operation, num2):
|
| 4 |
+
if operation == "add":
|
| 5 |
+
return num1 + num2
|
| 6 |
+
elif operation == "subtract":
|
| 7 |
+
return num1 - num2
|
| 8 |
+
elif operation == "multiply":
|
| 9 |
+
return num1 * num2
|
| 10 |
+
elif operation == "divide":
|
| 11 |
+
if num2 == 0:
|
| 12 |
+
raise gr.Error("Cannot divide by zero!")
|
| 13 |
+
return num1 / num2
|
| 14 |
+
|
| 15 |
+
demo = gr.Interface(
|
| 16 |
+
calculator,
|
| 17 |
+
[
|
| 18 |
+
"number",
|
| 19 |
+
gr.Radio(["add", "subtract", "multiply", "divide"]),
|
| 20 |
+
"number"
|
| 21 |
+
],
|
| 22 |
+
"number",
|
| 23 |
+
examples=[
|
| 24 |
+
[5, "add", 3],
|
| 25 |
+
[4, "divide", 2],
|
| 26 |
+
[-4, "multiply", 2.5],
|
| 27 |
+
[0, "subtract", 1.2],
|
| 28 |
+
],
|
| 29 |
+
title="Toy Calculator",
|
| 30 |
+
description="Here's a sample toy calculator. Allows you to calculate things like $2+2=4$",
|
| 31 |
+
)
|
| 32 |
+
if __name__ == "__main__":
|
| 33 |
+
demo.launch()
|
gradio/hello.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import sys, os, io
|
| 3 |
+
import pandas as pd
|
| 4 |
+
sys.path.append(os.path.abspath('../src'))
|
| 5 |
+
|
| 6 |
+
from idsc.idsc_apis import idsc_apis
|
| 7 |
+
|
| 8 |
+
idsc = idsc_apis()
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def forecast(demand_table, product_table, storage_capacity):
|
| 12 |
+
demand_table_df = pd.read_csv(demand_table.name)
|
| 13 |
+
product_table_df = pd.read_csv(product_table.name)
|
| 14 |
+
|
| 15 |
+
res = idsc.product_mix(
|
| 16 |
+
demand_table_df.to_json(),
|
| 17 |
+
product_table_df.to_json(),
|
| 18 |
+
storage_capacity)
|
| 19 |
+
return res
|
| 20 |
+
|
| 21 |
+
def upload_file(file):
|
| 22 |
+
return file.name
|
| 23 |
+
|
| 24 |
+
def show():
|
| 25 |
+
return gr.update(visible=True)
|
| 26 |
+
|
| 27 |
+
# demo = gr.Interface(
|
| 28 |
+
# fn=forecast,
|
| 29 |
+
# inputs=[
|
| 30 |
+
# demand_table_upload_btn,
|
| 31 |
+
# product_table_upload_btn,
|
| 32 |
+
# storage_capacity_input],
|
| 33 |
+
# outputs="text")
|
| 34 |
+
|
| 35 |
+
with gr.Blocks() as demo:
|
| 36 |
+
demand_table_file = gr.File(visible=False)
|
| 37 |
+
demand_table_upload_btn = gr.UploadButton(
|
| 38 |
+
'Demand Table',
|
| 39 |
+
file_types=['.csv'])
|
| 40 |
+
|
| 41 |
+
product_table_file = gr.File()
|
| 42 |
+
product_table_upload_btn = gr.UploadButton(
|
| 43 |
+
'Product Table',
|
| 44 |
+
file_types=['.csv'])
|
| 45 |
+
|
| 46 |
+
storage_capacity_input = gr.Number(
|
| 47 |
+
label='Storage Capacity',
|
| 48 |
+
minimum=0)
|
| 49 |
+
|
| 50 |
+
optimize_inventory_btn = gr.Button('Optimize')
|
| 51 |
+
|
| 52 |
+
demand_table_upload_btn.upload(
|
| 53 |
+
upload_file,
|
| 54 |
+
demand_table_upload_btn,
|
| 55 |
+
demand_table_file)
|
| 56 |
+
|
| 57 |
+
demand_table_file.change(fn=show)
|
| 58 |
+
|
| 59 |
+
demo.launch()
|
notebooks/inventory.ipynb
ADDED
|
@@ -0,0 +1,1421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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+
"outputs": [],
|
| 9 |
+
"source": [
|
| 10 |
+
"import requests, yaml\n",
|
| 11 |
+
"import sys\n",
|
| 12 |
+
"import os\n",
|
| 13 |
+
"sys.path.append(os.path.abspath('../src'))\n",
|
| 14 |
+
"import pandas as pd\n",
|
| 15 |
+
"\n",
|
| 16 |
+
"from idsc.idsc_apis import idsc_apis"
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"cell_type": "code",
|
| 21 |
+
"execution_count": 34,
|
| 22 |
+
"id": "5c549960",
|
| 23 |
+
"metadata": {},
|
| 24 |
+
"outputs": [
|
| 25 |
+
{
|
| 26 |
+
"name": "stdout",
|
| 27 |
+
"output_type": "stream",
|
| 28 |
+
"text": [
|
| 29 |
+
"apikey still available, logged in\n"
|
| 30 |
+
]
|
| 31 |
+
}
|
| 32 |
+
],
|
| 33 |
+
"source": [
|
| 34 |
+
"idsc = idsc_apis()"
|
| 35 |
+
]
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"cell_type": "code",
|
| 39 |
+
"execution_count": 35,
|
| 40 |
+
"id": "258034d8-ab4f-49cb-b4eb-e61bda31babc",
|
| 41 |
+
"metadata": {},
|
| 42 |
+
"outputs": [],
|
| 43 |
+
"source": [
|
| 44 |
+
"demand_table = pd.read_csv('../data/mock/demand_table.csv')\n",
|
| 45 |
+
"product_table = pd.read_csv('../data/mock/product_table.csv')"
|
| 46 |
+
]
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"cell_type": "code",
|
| 50 |
+
"execution_count": 36,
|
| 51 |
+
"id": "afb53f04",
|
| 52 |
+
"metadata": {},
|
| 53 |
+
"outputs": [],
|
| 54 |
+
"source": [
|
| 55 |
+
"res = idsc.product_mix(demand_table.to_json(), product_table.to_json(), 100)"
|
| 56 |
+
]
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"cell_type": "code",
|
| 60 |
+
"execution_count": 51,
|
| 61 |
+
"id": "b33feb18",
|
| 62 |
+
"metadata": {},
|
| 63 |
+
"outputs": [
|
| 64 |
+
{
|
| 65 |
+
"data": {
|
| 66 |
+
"text/plain": [
|
| 67 |
+
"{'product_mix_result': {'White Bread': {'recommended_stock': 3},\n",
|
| 68 |
+
" 'Special Cake': {'recommended_stock': 26},\n",
|
| 69 |
+
" 'Wedding Cake': {'recommended_stock': 13}},\n",
|
| 70 |
+
" 'engine_code': 'optimax_product_mix',\n",
|
| 71 |
+
" 'probability_table': '{\"product\":{\"263\":\"Wedding Cake\",\"261\":\"Wedding Cake\",\"259\":\"Wedding Cake\",\"269\":\"Wedding Cake\",\"264\":\"Wedding Cake\",\"268\":\"Wedding Cake\",\"258\":\"Wedding Cake\",\"260\":\"Wedding Cake\",\"257\":\"Wedding Cake\",\"270\":\"Wedding Cake\",\"262\":\"Wedding Cake\",\"265\":\"Wedding Cake\",\"266\":\"Wedding Cake\",\"267\":\"Wedding Cake\",\"271\":\"Wedding Cake\",\"161\":\"Special Cake\",\"46\":\"White Bread\",\"256\":\"Wedding Cake\",\"255\":\"Wedding Cake\",\"275\":\"Wedding Cake\",\"272\":\"Wedding Cake\",\"34\":\"White Bread\",\"149\":\"Special Cake\",\"278\":\"Wedding Cake\",\"159\":\"Special Cake\",\"44\":\"White Bread\",\"35\":\"White Bread\",\"150\":\"Special Cake\",\"277\":\"Wedding Cake\",\"36\":\"White Bread\",\"151\":\"Special Cake\",\"253\":\"Wedding Cake\",\"43\":\"White Bread\",\"158\":\"Special Cake\",\"274\":\"Wedding Cake\",\"157\":\"Special Cake\",\"42\":\"White Bread\",\"162\":\"Special Cake\",\"47\":\"White Bread\",\"254\":\"Wedding Cake\",\"154\":\"Special Cake\",\"39\":\"White Bread\",\"276\":\"Wedding Cake\",\"163\":\"Special Cake\",\"48\":\"White Bread\",\"279\":\"Wedding Cake\",\"153\":\"Special Cake\",\"38\":\"White Bread\",\"152\":\"Special Cake\",\"37\":\"White Bread\",\"45\":\"White Bread\",\"160\":\"Special Cake\",\"164\":\"Special Cake\",\"49\":\"White Bread\",\"40\":\"White Bread\",\"155\":\"Special Cake\",\"41\":\"White Bread\",\"156\":\"Special Cake\",\"166\":\"Special Cake\",\"51\":\"White Bread\",\"273\":\"Wedding Cake\",\"82\":\"White Bread\",\"197\":\"Special Cake\",\"79\":\"White Bread\",\"194\":\"Special Cake\",\"81\":\"White Bread\",\"196\":\"Special Cake\",\"182\":\"Special Cake\",\"67\":\"White Bread\",\"52\":\"White Bread\",\"167\":\"Special Cake\",\"50\":\"White Bread\",\"165\":\"Special Cake\",\"280\":\"Wedding Cake\",\"80\":\"White Bread\",\"195\":\"Special Cake\",\"252\":\"Wedding Cake\",\"85\":\"White Bread\",\"200\":\"Special Cake\",\"199\":\"Special Cake\",\"84\":\"White Bread\",\"281\":\"Wedding Cake\",\"183\":\"Special Cake\",\"68\":\"White Bread\",\"251\":\"Wedding Cake\",\"181\":\"Special Cake\",\"66\":\"White Bread\",\"282\":\"Wedding Cake\",\"171\":\"Special Cake\",\"56\":\"White Bread\",\"33\":\"White Bread\",\"148\":\"Special Cake\",\"53\":\"White Bread\",\"168\":\"Special Cake\",\"173\":\"Special Cake\",\"58\":\"White Bread\",\"172\":\"Special Cake\",\"57\":\"White Bread\",\"60\":\"White Bread\",\"175\":\"Special Cake\",\"286\":\"Wedding Cake\",\"174\":\"Special Cake\",\"59\":\"White Bread\",\"198\":\"Special Cake\",\"83\":\"White Bread\",\"169\":\"Special Cake\",\"54\":\"White Bread\",\"86\":\"White Bread\",\"201\":\"Special Cake\",\"185\":\"Special Cake\",\"70\":\"White Bread\",\"184\":\"Special Cake\",\"69\":\"White Bread\",\"78\":\"White Bread\",\"193\":\"Special Cake\",\"250\":\"Wedding Cake\",\"71\":\"White Bread\",\"186\":\"Special Cake\",\"192\":\"Special Cake\",\"77\":\"White Bread\",\"191\":\"Special Cake\",\"76\":\"White Bread\",\"285\":\"Wedding Cake\",\"176\":\"Special Cake\",\"61\":\"White Bread\",\"249\":\"Wedding Cake\",\"74\":\"White Bread\",\"189\":\"Special Cake\",\"170\":\"Special Cake\",\"55\":\"White Bread\",\"190\":\"Special Cake\",\"75\":\"White Bread\",\"177\":\"Special Cake\",\"62\":\"White Bread\",\"283\":\"Wedding Cake\",\"188\":\"Special Cake\",\"73\":\"White Bread\",\"65\":\"White Bread\",\"180\":\"Special Cake\",\"187\":\"Special Cake\",\"72\":\"White Bread\",\"284\":\"Wedding Cake\",\"203\":\"Special Cake\",\"88\":\"White Bread\",\"63\":\"White Bread\",\"178\":\"Special Cake\",\"287\":\"Wedding Cake\",\"87\":\"White Bread\",\"202\":\"Special Cake\",\"32\":\"White Bread\",\"147\":\"Special Cake\",\"207\":\"Special Cake\",\"92\":\"White Bread\",\"290\":\"Wedding Cake\",\"90\":\"White Bread\",\"205\":\"Special Cake\",\"248\":\"Wedding Cake\",\"211\":\"Special Cake\",\"96\":\"White Bread\",\"89\":\"White Bread\",\"204\":\"Special Cake\",\"289\":\"Wedding Cake\",\"291\":\"Wedding Cake\",\"146\":\"Special Cake\",\"31\":\"White Bread\",\"64\":\"White Bread\",\"179\":\"Special Cake\",\"209\":\"Special Cake\",\"94\":\"White Bread\",\"288\":\"Wedding Cake\",\"224\":\"Special Cake\",\"109\":\"White Bread\",\"292\":\"Wedding Cake\",\"28\":\"White Bread\",\"143\":\"Special Cake\",\"30\":\"White Bread\",\"145\":\"Special Cake\",\"29\":\"White Bread\",\"144\":\"Special Cake\",\"208\":\"Special Cake\",\"93\":\"White Bread\",\"206\":\"Special Cake\",\"91\":\"White Bread\",\"223\":\"Special Cake\",\"108\":\"White Bread\",\"222\":\"Special Cake\",\"107\":\"White Bread\",\"220\":\"Special Cake\",\"105\":\"White Bread\",\"27\":\"White Bread\",\"142\":\"Special Cake\",\"245\":\"Wedding Cake\",\"95\":\"White Bread\",\"210\":\"Special Cake\",\"106\":\"White Bread\",\"221\":\"Special Cake\",\"26\":\"White Bread\",\"141\":\"Special Cake\",\"293\":\"Wedding Cake\",\"110\":\"White Bread\",\"225\":\"Special Cake\",\"112\":\"White Bread\",\"227\":\"Special Cake\",\"243\":\"Wedding Cake\",\"247\":\"Wedding Cake\",\"25\":\"White Bread\",\"140\":\"Special Cake\",\"244\":\"Wedding Cake\",\"294\":\"Wedding Cake\",\"212\":\"Special Cake\",\"97\":\"White Bread\",\"297\":\"Wedding Cake\",\"226\":\"Special Cake\",\"111\":\"White Bread\",\"298\":\"Wedding Cake\",\"246\":\"Wedding Cake\",\"104\":\"White Bread\",\"219\":\"Special Cake\",\"15\":\"White Bread\",\"130\":\"Special Cake\",\"295\":\"Wedding Cake\",\"296\":\"Wedding Cake\",\"237\":\"Wedding Cake\",\"113\":\"White Bread\",\"228\":\"Special Cake\",\"139\":\"Special Cake\",\"24\":\"White Bread\",\"218\":\"Special Cake\",\"103\":\"White Bread\",\"137\":\"Special Cake\",\"22\":\"White Bread\",\"299\":\"Wedding Cake\",\"131\":\"Special Cake\",\"16\":\"White Bread\",\"235\":\"Wedding Cake\",\"213\":\"Special Cake\",\"98\":\"White Bread\",\"120\":\"Special Cake\",\"5\":\"White Bread\",\"23\":\"White Bread\",\"138\":\"Special Cake\",\"7\":\"White Bread\",\"122\":\"Special Cake\",\"132\":\"Special Cake\",\"17\":\"White Bread\",\"129\":\"Special Cake\",\"14\":\"White Bread\",\"231\":\"Wedding Cake\",\"300\":\"Wedding Cake\",\"136\":\"Special Cake\",\"21\":\"White Bread\",\"242\":\"Wedding Cake\",\"8\":\"White Bread\",\"123\":\"Special Cake\",\"302\":\"Wedding Cake\",\"101\":\"White Bread\",\"216\":\"Special Cake\",\"9\":\"White Bread\",\"124\":\"Special Cake\",\"1\":\"White Bread\",\"116\":\"Special Cake\",\"233\":\"Wedding Cake\",\"234\":\"Wedding Cake\",\"303\":\"Wedding Cake\",\"13\":\"White Bread\",\"128\":\"Special Cake\",\"304\":\"Wedding Cake\",\"215\":\"Special Cake\",\"100\":\"White Bread\",\"20\":\"White Bread\",\"135\":\"Special Cake\",\"133\":\"Special Cake\",\"18\":\"White Bread\",\"3\":\"White Bread\",\"118\":\"Special Cake\",\"214\":\"Special Cake\",\"99\":\"White Bread\",\"232\":\"Wedding Cake\",\"217\":\"Special Cake\",\"102\":\"White Bread\",\"301\":\"Wedding Cake\",\"238\":\"Wedding Cake\",\"239\":\"Wedding Cake\",\"240\":\"Wedding Cake\",\"134\":\"Special Cake\",\"19\":\"White Bread\",\"4\":\"White Bread\",\"119\":\"Special Cake\",\"126\":\"Special Cake\",\"11\":\"White Bread\",\"117\":\"Special Cake\",\"2\":\"White Bread\",\"114\":\"White Bread\",\"229\":\"Special Cake\",\"236\":\"Wedding Cake\",\"241\":\"Wedding Cake\",\"121\":\"Special Cake\",\"6\":\"White Bread\",\"12\":\"White Bread\",\"127\":\"Special Cake\",\"125\":\"Special Cake\",\"10\":\"White Bread\"},\"demand\":{\"263\":33,\"261\":31,\"259\":29,\"269\":39,\"264\":34,\"268\":38,\"258\":28,\"260\":30,\"257\":27,\"270\":40,\"262\":32,\"265\":35,\"266\":36,\"267\":37,\"271\":41,\"161\":46,\"46\":46,\"256\":26,\"255\":25,\"275\":45,\"272\":42,\"34\":34,\"149\":34,\"278\":48,\"159\":44,\"44\":44,\"35\":35,\"150\":35,\"277\":47,\"36\":36,\"151\":36,\"253\":23,\"43\":43,\"158\":43,\"274\":44,\"157\":42,\"42\":42,\"162\":47,\"47\":47,\"254\":24,\"154\":39,\"39\":39,\"276\":46,\"163\":48,\"48\":48,\"279\":49,\"153\":38,\"38\":38,\"152\":37,\"37\":37,\"45\":45,\"160\":45,\"164\":49,\"49\":49,\"40\":40,\"155\":40,\"41\":41,\"156\":41,\"166\":51,\"51\":51,\"273\":43,\"82\":82,\"197\":82,\"79\":79,\"194\":79,\"81\":81,\"196\":81,\"182\":67,\"67\":67,\"52\":52,\"167\":52,\"50\":50,\"165\":50,\"280\":50,\"80\":80,\"195\":80,\"252\":22,\"85\":85,\"200\":85,\"199\":84,\"84\":84,\"281\":51,\"183\":68,\"68\":68,\"251\":21,\"181\":66,\"66\":66,\"282\":52,\"171\":56,\"56\":56,\"33\":33,\"148\":33,\"53\":53,\"168\":53,\"173\":58,\"58\":58,\"172\":57,\"57\":57,\"60\":60,\"175\":60,\"286\":56,\"174\":59,\"59\":59,\"198\":83,\"83\":83,\"169\":54,\"54\":54,\"86\":86,\"201\":86,\"185\":70,\"70\":70,\"184\":69,\"69\":69,\"78\":78,\"193\":78,\"250\":20,\"71\":71,\"186\":71,\"192\":77,\"77\":77,\"191\":76,\"76\":76,\"285\":55,\"176\":61,\"61\":61,\"249\":19,\"74\":74,\"189\":74,\"170\":55,\"55\":55,\"190\":75,\"75\":75,\"177\":62,\"62\":62,\"283\":53,\"188\":73,\"73\":73,\"65\":65,\"180\":65,\"187\":72,\"72\":72,\"284\":54,\"203\":88,\"88\":88,\"63\":63,\"178\":63,\"287\":57,\"87\":87,\"202\":87,\"32\":32,\"147\":32,\"207\":92,\"92\":92,\"290\":60,\"90\":90,\"205\":90,\"248\":18,\"211\":96,\"96\":96,\"89\":89,\"204\":89,\"289\":59,\"291\":61,\"146\":31,\"31\":31,\"64\":64,\"179\":64,\"209\":94,\"94\":94,\"288\":58,\"224\":109,\"109\":109,\"292\":62,\"28\":28,\"143\":28,\"30\":30,\"145\":30,\"29\":29,\"144\":29,\"208\":93,\"93\":93,\"206\":91,\"91\":91,\"223\":108,\"108\":108,\"222\":107,\"107\":107,\"220\":105,\"105\":105,\"27\":27,\"142\":27,\"245\":15,\"95\":95,\"210\":95,\"106\":106,\"221\":106,\"26\":26,\"141\":26,\"293\":63,\"110\":110,\"225\":110,\"112\":112,\"227\":112,\"243\":13,\"247\":17,\"25\":25,\"140\":25,\"244\":14,\"294\":64,\"212\":97,\"97\":97,\"297\":67,\"226\":111,\"111\":111,\"298\":68,\"246\":16,\"104\":104,\"219\":104,\"15\":15,\"130\":15,\"295\":65,\"296\":66,\"237\":7,\"113\":113,\"228\":113,\"139\":24,\"24\":24,\"218\":103,\"103\":103,\"137\":22,\"22\":22,\"299\":69,\"131\":16,\"16\":16,\"235\":5,\"213\":98,\"98\":98,\"120\":5,\"5\":5,\"23\":23,\"138\":23,\"7\":7,\"122\":7,\"132\":17,\"17\":17,\"129\":14,\"14\":14,\"231\":1,\"300\":70,\"136\":21,\"21\":21,\"242\":12,\"8\":8,\"123\":8,\"302\":72,\"101\":101,\"216\":101,\"9\":9,\"124\":9,\"1\":1,\"116\":1,\"233\":3,\"234\":4,\"303\":73,\"13\":13,\"128\":13,\"304\":74,\"215\":100,\"100\":100,\"20\":20,\"135\":20,\"133\":18,\"18\":18,\"3\":3,\"118\":3,\"214\":99,\"99\":99,\"232\":2,\"217\":102,\"102\":102,\"301\":71,\"238\":8,\"239\":9,\"240\":10,\"134\":19,\"19\":19,\"4\":4,\"119\":4,\"126\":11,\"11\":11,\"117\":2,\"2\":2,\"114\":114,\"229\":114,\"236\":6,\"241\":11,\"121\":6,\"6\":6,\"12\":12,\"127\":12,\"125\":10,\"10\":10},\"probability\":{\"263\":0.0368592173,\"261\":0.0359488332,\"259\":0.034826178,\"269\":0.0345176881,\"264\":0.0338754672,\"268\":0.0336984278,\"258\":0.0333003656,\"260\":0.032756232,\"257\":0.0325301611,\"270\":0.032197924,\"262\":0.0318970326,\"265\":0.0311347815,\"266\":0.030689652,\"267\":0.0290920836,\"271\":0.0283928783,\"161\":0.028135825,\"46\":0.028135825,\"256\":0.0280648941,\"255\":0.026794912,\"275\":0.0267789487,\"272\":0.0266978264,\"34\":0.02649434,\"149\":0.02649434,\"278\":0.0261790284,\"159\":0.0260993218,\"44\":0.0260993218,\"35\":0.0258797103,\"150\":0.0258797103,\"277\":0.0249885005,\"36\":0.0247542848,\"151\":0.0247542848,\"253\":0.0237528724,\"43\":0.0227409136,\"158\":0.0227409136,\"274\":0.0223511295,\"157\":0.0218458294,\"42\":0.0218458294,\"162\":0.0218256638,\"47\":0.0218256638,\"254\":0.0217967443,\"154\":0.0216395613,\"39\":0.0216395613,\"276\":0.0216095805,\"163\":0.0215321773,\"48\":0.0215321773,\"279\":0.0213346388,\"153\":0.0203048915,\"38\":0.0203048915,\"152\":0.020051612,\"37\":0.020051612,\"45\":0.0199892913,\"160\":0.0199892913,\"164\":0.0195399323,\"49\":0.0195399323,\"40\":0.019229393,\"155\":0.019229393,\"41\":0.0190548591,\"156\":0.0190548591,\"166\":0.018913738,\"51\":0.018913738,\"273\":0.0184784305,\"82\":0.0182737867,\"197\":0.0182737867,\"79\":0.0180723397,\"194\":0.0180723397,\"81\":0.0179847392,\"196\":0.0179847392,\"182\":0.0177538496,\"67\":0.0177538496,\"52\":0.017304322,\"167\":0.017304322,\"50\":0.0172683526,\"165\":0.0172683526,\"280\":0.017080318,\"80\":0.0165558467,\"195\":0.0165558467,\"252\":0.0164150156,\"85\":0.0163239057,\"200\":0.0163239057,\"199\":0.0155502511,\"84\":0.0155502511,\"281\":0.0155468033,\"183\":0.0153482999,\"68\":0.0153482999,\"251\":0.0150519811,\"181\":0.0149100957,\"66\":0.0149100957,\"282\":0.0145321593,\"171\":0.0145073305,\"56\":0.0145073305,\"33\":0.0143434204,\"148\":0.0143434204,\"53\":0.0139978926,\"168\":0.0139978926,\"173\":0.0137575929,\"58\":0.0137575929,\"172\":0.0133753577,\"57\":0.0133753577,\"60\":0.0132917234,\"175\":0.0132917234,\"286\":0.0128341354,\"174\":0.0125602164,\"59\":0.0125602164,\"198\":0.0122586994,\"83\":0.0122586994,\"169\":0.0121257892,\"54\":0.0121257892,\"86\":0.0121178443,\"201\":0.0121178443,\"185\":0.0117735274,\"70\":0.0117735274,\"184\":0.0117612458,\"69\":0.0117612458,\"78\":0.011635456,\"193\":0.011635456,\"250\":0.01154316,\"71\":0.0112493485,\"186\":0.0112493485,\"192\":0.0111785296,\"77\":0.0111785296,\"191\":0.0111410438,\"76\":0.0111410438,\"285\":0.0110507398,\"176\":0.0105914583,\"61\":0.0105914583,\"249\":0.0105420966,\"74\":0.0105078101,\"189\":0.0105078101,\"170\":0.0103408676,\"55\":0.0103408676,\"190\":0.0100856266,\"75\":0.0100856266,\"177\":0.0100635496,\"62\":0.0100635496,\"283\":0.0098274898,\"188\":0.009615686,\"73\":0.009615686,\"65\":0.0089209082,\"180\":0.0089209082,\"187\":0.0088669788,\"72\":0.0088669788,\"284\":0.008681397,\"203\":0.0085985317,\"88\":0.0085985317,\"63\":0.0083903575,\"178\":0.0083903575,\"287\":0.0079844742,\"87\":0.0075161459,\"202\":0.0075161459,\"32\":0.0065831021,\"147\":0.0065831021,\"207\":0.0063411487,\"92\":0.0063411487,\"290\":0.0061494519,\"90\":0.0060437383,\"205\":0.0060437383,\"248\":0.0057253414,\"211\":0.0057178973,\"96\":0.0057178973,\"89\":0.0056477112,\"204\":0.0056477112,\"289\":0.0055459619,\"291\":0.0054795932,\"146\":0.0054244868,\"31\":0.0054244868,\"64\":0.0053959746,\"179\":0.0053959746,\"209\":0.0051360659,\"94\":0.0051360659,\"288\":0.0050816214,\"224\":0.0048954825,\"109\":0.0048954825,\"292\":0.0047980717,\"28\":0.0045802571,\"143\":0.0045802571,\"30\":0.0044781409,\"145\":0.0044781409,\"29\":0.0043621607,\"144\":0.0043621607,\"208\":0.0043273171,\"93\":0.0043273171,\"206\":0.0041276299,\"91\":0.0041276299,\"223\":0.0040755787,\"108\":0.0040755787,\"222\":0.0039335012,\"107\":0.0039335012,\"220\":0.0038894774,\"105\":0.0038894774,\"27\":0.00385749,\"142\":0.00385749,\"245\":0.0036740912,\"95\":0.0036275468,\"210\":0.0036275468,\"106\":0.0035281844,\"221\":0.0035281844,\"26\":0.0033199252,\"141\":0.0033199252,\"293\":0.0032641712,\"110\":0.0031606894,\"225\":0.0031606894,\"112\":0.002931355,\"227\":0.002931355,\"243\":0.0029177054,\"247\":0.0027665343,\"25\":0.0026568393,\"140\":0.0026568393,\"244\":0.0026502146,\"294\":0.0025965544,\"212\":0.002554393,\"97\":0.002554393,\"297\":0.0022778517,\"226\":0.0022694948,\"111\":0.0022694948,\"298\":0.0022332029,\"246\":0.00198394,\"104\":0.0019647995,\"219\":0.0019647995,\"15\":0.0019036542,\"130\":0.0019036542,\"295\":0.0018337038,\"296\":0.0014691137,\"237\":0.0014035503,\"113\":0.0013588412,\"228\":0.0013588412,\"139\":0.0013444622,\"24\":0.0013444622,\"218\":0.001279575,\"103\":0.001279575,\"137\":0.0012722084,\"22\":0.0012722084,\"299\":0.0012112573,\"131\":0.0009974778,\"16\":0.0009974778,\"235\":0.0009420068,\"213\":0.000899227,\"98\":0.000899227,\"120\":0.0007732343,\"5\":0.0007732343,\"23\":0.0007673017,\"138\":0.0007673017,\"7\":0.000579398,\"122\":0.000579398,\"132\":0.0005463021,\"17\":0.0005463021,\"129\":0.0005379338,\"14\":0.0005379338,\"231\":0.0004810596,\"300\":0.0004541821,\"136\":0.0004143761,\"21\":0.0004143761,\"242\":0.0004077686,\"8\":0.000402153,\"123\":0.000402153,\"302\":0.0003903984,\"101\":0.0003871625,\"216\":0.0003871625,\"9\":0.0003653594,\"124\":0.0003653594,\"1\":0.0003608402,\"116\":0.0003608402,\"233\":0.0003515124,\"234\":0.0003474865,\"303\":0.0003399258,\"13\":0.0003227829,\"128\":0.0003227829,\"304\":0.0003183052,\"215\":0.0003102312,\"100\":0.0003102312,\"20\":0.0003036225,\"135\":0.0003036225,\"133\":0.0002644347,\"18\":0.0002644347,\"3\":0.0002636676,\"118\":0.0002636676,\"214\":0.0002458838,\"99\":0.0002458838,\"232\":0.0002280527,\"217\":0.0002082343,\"102\":0.0002082343,\"301\":0.0002049358,\"238\":0.0002048074,\"239\":0.0001971212,\"240\":0.0001920457,\"134\":0.0001910985,\"19\":0.0001910985,\"4\":0.0001887357,\"119\":0.0001887357,\"126\":0.0001747752,\"11\":0.0001747752,\"117\":0.0001710611,\"2\":0.0001710611,\"114\":0.0001586266,\"229\":0.0001586266,\"236\":0.0001076846,\"241\":0.0000884724,\"121\":0.0000860457,\"6\":0.0000860457,\"12\":0.0000617417,\"127\":0.0000617417,\"125\":0.0000430096,\"10\":0.0000430096}}',\n",
|
| 72 |
+
" 'plan_timestamp': '2023-08-15 16:24:11'}"
|
| 73 |
+
]
|
| 74 |
+
},
|
| 75 |
+
"execution_count": 51,
|
| 76 |
+
"metadata": {},
|
| 77 |
+
"output_type": "execute_result"
|
| 78 |
+
}
|
| 79 |
+
],
|
| 80 |
+
"source": [
|
| 81 |
+
"res"
|
| 82 |
+
]
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"cell_type": "code",
|
| 86 |
+
"execution_count": 37,
|
| 87 |
+
"id": "87f7d882",
|
| 88 |
+
"metadata": {},
|
| 89 |
+
"outputs": [],
|
| 90 |
+
"source": [
|
| 91 |
+
"res_df = pd.DataFrame(res['product_mix_result'])"
|
| 92 |
+
]
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"cell_type": "code",
|
| 96 |
+
"execution_count": 38,
|
| 97 |
+
"id": "93b21c64",
|
| 98 |
+
"metadata": {},
|
| 99 |
+
"outputs": [
|
| 100 |
+
{
|
| 101 |
+
"data": {
|
| 102 |
+
"text/html": [
|
| 103 |
+
"<div>\n",
|
| 104 |
+
"<style scoped>\n",
|
| 105 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 106 |
+
" vertical-align: middle;\n",
|
| 107 |
+
" }\n",
|
| 108 |
+
"\n",
|
| 109 |
+
" .dataframe tbody tr th {\n",
|
| 110 |
+
" vertical-align: top;\n",
|
| 111 |
+
" }\n",
|
| 112 |
+
"\n",
|
| 113 |
+
" .dataframe thead th {\n",
|
| 114 |
+
" text-align: right;\n",
|
| 115 |
+
" }\n",
|
| 116 |
+
"</style>\n",
|
| 117 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 118 |
+
" <thead>\n",
|
| 119 |
+
" <tr style=\"text-align: right;\">\n",
|
| 120 |
+
" <th></th>\n",
|
| 121 |
+
" <th>White Bread</th>\n",
|
| 122 |
+
" <th>Special Cake</th>\n",
|
| 123 |
+
" <th>Wedding Cake</th>\n",
|
| 124 |
+
" </tr>\n",
|
| 125 |
+
" </thead>\n",
|
| 126 |
+
" <tbody>\n",
|
| 127 |
+
" <tr>\n",
|
| 128 |
+
" <th>recommended_stock</th>\n",
|
| 129 |
+
" <td>3</td>\n",
|
| 130 |
+
" <td>26</td>\n",
|
| 131 |
+
" <td>13</td>\n",
|
| 132 |
+
" </tr>\n",
|
| 133 |
+
" </tbody>\n",
|
| 134 |
+
"</table>\n",
|
| 135 |
+
"</div>"
|
| 136 |
+
],
|
| 137 |
+
"text/plain": [
|
| 138 |
+
" White Bread Special Cake Wedding Cake\n",
|
| 139 |
+
"recommended_stock 3 26 13"
|
| 140 |
+
]
|
| 141 |
+
},
|
| 142 |
+
"execution_count": 38,
|
| 143 |
+
"metadata": {},
|
| 144 |
+
"output_type": "execute_result"
|
| 145 |
+
}
|
| 146 |
+
],
|
| 147 |
+
"source": [
|
| 148 |
+
"res_df"
|
| 149 |
+
]
|
| 150 |
+
},
|
| 151 |
+
{
|
| 152 |
+
"cell_type": "code",
|
| 153 |
+
"execution_count": 39,
|
| 154 |
+
"id": "c0e30697",
|
| 155 |
+
"metadata": {},
|
| 156 |
+
"outputs": [],
|
| 157 |
+
"source": [
|
| 158 |
+
"prob_table_df = pd.DataFrame(json.loads(res['probability_table']))"
|
| 159 |
+
]
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"cell_type": "code",
|
| 163 |
+
"execution_count": 40,
|
| 164 |
+
"id": "0e465d87",
|
| 165 |
+
"metadata": {},
|
| 166 |
+
"outputs": [
|
| 167 |
+
{
|
| 168 |
+
"data": {
|
| 169 |
+
"text/html": [
|
| 170 |
+
"<div>\n",
|
| 171 |
+
"<style scoped>\n",
|
| 172 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 173 |
+
" vertical-align: middle;\n",
|
| 174 |
+
" }\n",
|
| 175 |
+
"\n",
|
| 176 |
+
" .dataframe tbody tr th {\n",
|
| 177 |
+
" vertical-align: top;\n",
|
| 178 |
+
" }\n",
|
| 179 |
+
"\n",
|
| 180 |
+
" .dataframe thead th {\n",
|
| 181 |
+
" text-align: right;\n",
|
| 182 |
+
" }\n",
|
| 183 |
+
"</style>\n",
|
| 184 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 185 |
+
" <thead>\n",
|
| 186 |
+
" <tr style=\"text-align: right;\">\n",
|
| 187 |
+
" <th></th>\n",
|
| 188 |
+
" <th>product</th>\n",
|
| 189 |
+
" <th>demand</th>\n",
|
| 190 |
+
" <th>probability</th>\n",
|
| 191 |
+
" </tr>\n",
|
| 192 |
+
" </thead>\n",
|
| 193 |
+
" <tbody>\n",
|
| 194 |
+
" <tr>\n",
|
| 195 |
+
" <th>263</th>\n",
|
| 196 |
+
" <td>Wedding Cake</td>\n",
|
| 197 |
+
" <td>33</td>\n",
|
| 198 |
+
" <td>0.036859</td>\n",
|
| 199 |
+
" </tr>\n",
|
| 200 |
+
" <tr>\n",
|
| 201 |
+
" <th>261</th>\n",
|
| 202 |
+
" <td>Wedding Cake</td>\n",
|
| 203 |
+
" <td>31</td>\n",
|
| 204 |
+
" <td>0.035949</td>\n",
|
| 205 |
+
" </tr>\n",
|
| 206 |
+
" <tr>\n",
|
| 207 |
+
" <th>259</th>\n",
|
| 208 |
+
" <td>Wedding Cake</td>\n",
|
| 209 |
+
" <td>29</td>\n",
|
| 210 |
+
" <td>0.034826</td>\n",
|
| 211 |
+
" </tr>\n",
|
| 212 |
+
" <tr>\n",
|
| 213 |
+
" <th>269</th>\n",
|
| 214 |
+
" <td>Wedding Cake</td>\n",
|
| 215 |
+
" <td>39</td>\n",
|
| 216 |
+
" <td>0.034518</td>\n",
|
| 217 |
+
" </tr>\n",
|
| 218 |
+
" <tr>\n",
|
| 219 |
+
" <th>264</th>\n",
|
| 220 |
+
" <td>Wedding Cake</td>\n",
|
| 221 |
+
" <td>34</td>\n",
|
| 222 |
+
" <td>0.033875</td>\n",
|
| 223 |
+
" </tr>\n",
|
| 224 |
+
" <tr>\n",
|
| 225 |
+
" <th>...</th>\n",
|
| 226 |
+
" <td>...</td>\n",
|
| 227 |
+
" <td>...</td>\n",
|
| 228 |
+
" <td>...</td>\n",
|
| 229 |
+
" </tr>\n",
|
| 230 |
+
" <tr>\n",
|
| 231 |
+
" <th>6</th>\n",
|
| 232 |
+
" <td>White Bread</td>\n",
|
| 233 |
+
" <td>6</td>\n",
|
| 234 |
+
" <td>0.000086</td>\n",
|
| 235 |
+
" </tr>\n",
|
| 236 |
+
" <tr>\n",
|
| 237 |
+
" <th>12</th>\n",
|
| 238 |
+
" <td>White Bread</td>\n",
|
| 239 |
+
" <td>12</td>\n",
|
| 240 |
+
" <td>0.000062</td>\n",
|
| 241 |
+
" </tr>\n",
|
| 242 |
+
" <tr>\n",
|
| 243 |
+
" <th>127</th>\n",
|
| 244 |
+
" <td>Special Cake</td>\n",
|
| 245 |
+
" <td>12</td>\n",
|
| 246 |
+
" <td>0.000062</td>\n",
|
| 247 |
+
" </tr>\n",
|
| 248 |
+
" <tr>\n",
|
| 249 |
+
" <th>125</th>\n",
|
| 250 |
+
" <td>Special Cake</td>\n",
|
| 251 |
+
" <td>10</td>\n",
|
| 252 |
+
" <td>0.000043</td>\n",
|
| 253 |
+
" </tr>\n",
|
| 254 |
+
" <tr>\n",
|
| 255 |
+
" <th>10</th>\n",
|
| 256 |
+
" <td>White Bread</td>\n",
|
| 257 |
+
" <td>10</td>\n",
|
| 258 |
+
" <td>0.000043</td>\n",
|
| 259 |
+
" </tr>\n",
|
| 260 |
+
" </tbody>\n",
|
| 261 |
+
"</table>\n",
|
| 262 |
+
"<p>302 rows × 3 columns</p>\n",
|
| 263 |
+
"</div>"
|
| 264 |
+
],
|
| 265 |
+
"text/plain": [
|
| 266 |
+
" product demand probability\n",
|
| 267 |
+
"263 Wedding Cake 33 0.036859\n",
|
| 268 |
+
"261 Wedding Cake 31 0.035949\n",
|
| 269 |
+
"259 Wedding Cake 29 0.034826\n",
|
| 270 |
+
"269 Wedding Cake 39 0.034518\n",
|
| 271 |
+
"264 Wedding Cake 34 0.033875\n",
|
| 272 |
+
".. ... ... ...\n",
|
| 273 |
+
"6 White Bread 6 0.000086\n",
|
| 274 |
+
"12 White Bread 12 0.000062\n",
|
| 275 |
+
"127 Special Cake 12 0.000062\n",
|
| 276 |
+
"125 Special Cake 10 0.000043\n",
|
| 277 |
+
"10 White Bread 10 0.000043\n",
|
| 278 |
+
"\n",
|
| 279 |
+
"[302 rows x 3 columns]"
|
| 280 |
+
]
|
| 281 |
+
},
|
| 282 |
+
"execution_count": 40,
|
| 283 |
+
"metadata": {},
|
| 284 |
+
"output_type": "execute_result"
|
| 285 |
+
}
|
| 286 |
+
],
|
| 287 |
+
"source": [
|
| 288 |
+
"prob_table_df"
|
| 289 |
+
]
|
| 290 |
+
},
|
| 291 |
+
{
|
| 292 |
+
"cell_type": "code",
|
| 293 |
+
"execution_count": 47,
|
| 294 |
+
"id": "b6f4c718",
|
| 295 |
+
"metadata": {},
|
| 296 |
+
"outputs": [],
|
| 297 |
+
"source": [
|
| 298 |
+
"w = prob_table_df[prob_table_df['product']==\"Wedding Cake\"]"
|
| 299 |
+
]
|
| 300 |
+
},
|
| 301 |
+
{
|
| 302 |
+
"cell_type": "code",
|
| 303 |
+
"execution_count": 48,
|
| 304 |
+
"id": "c1816949",
|
| 305 |
+
"metadata": {},
|
| 306 |
+
"outputs": [],
|
| 307 |
+
"source": [
|
| 308 |
+
"import matplotlib.pyplot as plt "
|
| 309 |
+
]
|
| 310 |
+
},
|
| 311 |
+
{
|
| 312 |
+
"cell_type": "code",
|
| 313 |
+
"execution_count": 49,
|
| 314 |
+
"id": "2458d35e",
|
| 315 |
+
"metadata": {},
|
| 316 |
+
"outputs": [
|
| 317 |
+
{
|
| 318 |
+
"data": {
|
| 319 |
+
"text/html": [
|
| 320 |
+
"<div>\n",
|
| 321 |
+
"<style scoped>\n",
|
| 322 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 323 |
+
" vertical-align: middle;\n",
|
| 324 |
+
" }\n",
|
| 325 |
+
"\n",
|
| 326 |
+
" .dataframe tbody tr th {\n",
|
| 327 |
+
" vertical-align: top;\n",
|
| 328 |
+
" }\n",
|
| 329 |
+
"\n",
|
| 330 |
+
" .dataframe thead th {\n",
|
| 331 |
+
" text-align: right;\n",
|
| 332 |
+
" }\n",
|
| 333 |
+
"</style>\n",
|
| 334 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 335 |
+
" <thead>\n",
|
| 336 |
+
" <tr style=\"text-align: right;\">\n",
|
| 337 |
+
" <th></th>\n",
|
| 338 |
+
" <th>product</th>\n",
|
| 339 |
+
" <th>demand</th>\n",
|
| 340 |
+
" <th>probability</th>\n",
|
| 341 |
+
" </tr>\n",
|
| 342 |
+
" </thead>\n",
|
| 343 |
+
" <tbody>\n",
|
| 344 |
+
" <tr>\n",
|
| 345 |
+
" <th>263</th>\n",
|
| 346 |
+
" <td>Wedding Cake</td>\n",
|
| 347 |
+
" <td>33</td>\n",
|
| 348 |
+
" <td>0.036859</td>\n",
|
| 349 |
+
" </tr>\n",
|
| 350 |
+
" <tr>\n",
|
| 351 |
+
" <th>261</th>\n",
|
| 352 |
+
" <td>Wedding Cake</td>\n",
|
| 353 |
+
" <td>31</td>\n",
|
| 354 |
+
" <td>0.035949</td>\n",
|
| 355 |
+
" </tr>\n",
|
| 356 |
+
" <tr>\n",
|
| 357 |
+
" <th>259</th>\n",
|
| 358 |
+
" <td>Wedding Cake</td>\n",
|
| 359 |
+
" <td>29</td>\n",
|
| 360 |
+
" <td>0.034826</td>\n",
|
| 361 |
+
" </tr>\n",
|
| 362 |
+
" <tr>\n",
|
| 363 |
+
" <th>269</th>\n",
|
| 364 |
+
" <td>Wedding Cake</td>\n",
|
| 365 |
+
" <td>39</td>\n",
|
| 366 |
+
" <td>0.034518</td>\n",
|
| 367 |
+
" </tr>\n",
|
| 368 |
+
" <tr>\n",
|
| 369 |
+
" <th>264</th>\n",
|
| 370 |
+
" <td>Wedding Cake</td>\n",
|
| 371 |
+
" <td>34</td>\n",
|
| 372 |
+
" <td>0.033875</td>\n",
|
| 373 |
+
" </tr>\n",
|
| 374 |
+
" <tr>\n",
|
| 375 |
+
" <th>...</th>\n",
|
| 376 |
+
" <td>...</td>\n",
|
| 377 |
+
" <td>...</td>\n",
|
| 378 |
+
" <td>...</td>\n",
|
| 379 |
+
" </tr>\n",
|
| 380 |
+
" <tr>\n",
|
| 381 |
+
" <th>238</th>\n",
|
| 382 |
+
" <td>Wedding Cake</td>\n",
|
| 383 |
+
" <td>8</td>\n",
|
| 384 |
+
" <td>0.000205</td>\n",
|
| 385 |
+
" </tr>\n",
|
| 386 |
+
" <tr>\n",
|
| 387 |
+
" <th>239</th>\n",
|
| 388 |
+
" <td>Wedding Cake</td>\n",
|
| 389 |
+
" <td>9</td>\n",
|
| 390 |
+
" <td>0.000197</td>\n",
|
| 391 |
+
" </tr>\n",
|
| 392 |
+
" <tr>\n",
|
| 393 |
+
" <th>240</th>\n",
|
| 394 |
+
" <td>Wedding Cake</td>\n",
|
| 395 |
+
" <td>10</td>\n",
|
| 396 |
+
" <td>0.000192</td>\n",
|
| 397 |
+
" </tr>\n",
|
| 398 |
+
" <tr>\n",
|
| 399 |
+
" <th>236</th>\n",
|
| 400 |
+
" <td>Wedding Cake</td>\n",
|
| 401 |
+
" <td>6</td>\n",
|
| 402 |
+
" <td>0.000108</td>\n",
|
| 403 |
+
" </tr>\n",
|
| 404 |
+
" <tr>\n",
|
| 405 |
+
" <th>241</th>\n",
|
| 406 |
+
" <td>Wedding Cake</td>\n",
|
| 407 |
+
" <td>11</td>\n",
|
| 408 |
+
" <td>0.000088</td>\n",
|
| 409 |
+
" </tr>\n",
|
| 410 |
+
" </tbody>\n",
|
| 411 |
+
"</table>\n",
|
| 412 |
+
"<p>74 rows × 3 columns</p>\n",
|
| 413 |
+
"</div>"
|
| 414 |
+
],
|
| 415 |
+
"text/plain": [
|
| 416 |
+
" product demand probability\n",
|
| 417 |
+
"263 Wedding Cake 33 0.036859\n",
|
| 418 |
+
"261 Wedding Cake 31 0.035949\n",
|
| 419 |
+
"259 Wedding Cake 29 0.034826\n",
|
| 420 |
+
"269 Wedding Cake 39 0.034518\n",
|
| 421 |
+
"264 Wedding Cake 34 0.033875\n",
|
| 422 |
+
".. ... ... ...\n",
|
| 423 |
+
"238 Wedding Cake 8 0.000205\n",
|
| 424 |
+
"239 Wedding Cake 9 0.000197\n",
|
| 425 |
+
"240 Wedding Cake 10 0.000192\n",
|
| 426 |
+
"236 Wedding Cake 6 0.000108\n",
|
| 427 |
+
"241 Wedding Cake 11 0.000088\n",
|
| 428 |
+
"\n",
|
| 429 |
+
"[74 rows x 3 columns]"
|
| 430 |
+
]
|
| 431 |
+
},
|
| 432 |
+
"execution_count": 49,
|
| 433 |
+
"metadata": {},
|
| 434 |
+
"output_type": "execute_result"
|
| 435 |
+
}
|
| 436 |
+
],
|
| 437 |
+
"source": [
|
| 438 |
+
"w"
|
| 439 |
+
]
|
| 440 |
+
},
|
| 441 |
+
{
|
| 442 |
+
"cell_type": "code",
|
| 443 |
+
"execution_count": 50,
|
| 444 |
+
"id": "9b06145f",
|
| 445 |
+
"metadata": {},
|
| 446 |
+
"outputs": [
|
| 447 |
+
{
|
| 448 |
+
"data": {
|
| 449 |
+
"text/plain": [
|
| 450 |
+
"<matplotlib.collections.PathCollection at 0x12ba90350>"
|
| 451 |
+
]
|
| 452 |
+
},
|
| 453 |
+
"execution_count": 50,
|
| 454 |
+
"metadata": {},
|
| 455 |
+
"output_type": "execute_result"
|
| 456 |
+
},
|
| 457 |
+
{
|
| 458 |
+
"data": {
|
| 459 |
+
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjUAAAGdCAYAAADqsoKGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA/40lEQVR4nO3df3SU9Z3//deQX6NIIj80k1iEgN1CBItJKoaa2ruVYHC95S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ua2pqDEnG22+/bRiGOe+5L4KaANxxxx1GeXm5x7FJkyYZTz31VIyuKLL6BzU9PT2GzWYz1q1b5z52+fJlIysry9i8eXMMrjByWltbDUlGbW2tYRjJc+8jR440XnrppaS430uXLhlf/OIXjZqaGuPuu+92BzVmvffVq1cbX/7yl30+Z9Z7NgzDWL58uXHXXXf5fd7M997Xk08+aUycONHo6elJintm+WkQXV1dOnHihEpLSz2Ol5aW6vDhwzG6quhqamqSw+Hw+DPIyMjQ3Xffbbo/g46ODknSqFGjJJn/3ru7u/XKK6/o008/VXFxsenvV5K+973v6b777tM999zjcdzM93727Fnl5uYqLy9PDz30kM6fPy/J3Pe8Z88eFRUV6e///u9144036vbbb9eWLVvcz5v53l26urq0Y8cOPfbYY7JYLElxzwQ1g2hra1N3d7eys7M9jmdnZ8vhcMToqqLLdZ9m/zMwDEMVFRW66667NGXKFEnmvffTp0/ruuuuU0ZGhsrLy/Xaa68pPz/ftPfr8sorr+jkyZOqrKz0es6s9z59+nRt375d+/fv15YtW+RwODRjxgy1t7eb9p4l6fz586qqqtIXv/hF7d+/X+Xl5Vq8eLG2b98uybx/3329/vrr+stf/qJHH31UUnLcc1J16R4Ki8Xi8bNhGF7HzM7sfwbf//739cc//lG///3vvZ4z271/6UtfUn19vf7yl79o9+7dWrhwoWpra93Pm+1+JemDDz7Qk08+qQMHDshqtfodZ7Z7Lysrc//31KlTVVxcrIkTJ+rll1/WnXfeKcl89yxJPT09Kioq0o9//GNJ0u2336533nlHVVVVWrBggXucGe/dZevWrSorK1Nubq7HcTPfMzM1gxgzZoxSUlK8otjW1lavaNesXDslzPxn8E//9E/as2eP3n77bX3hC19wHzfrvaenp+uWW25RUVGRKisr9eUvf1k//elPTXu/knTixAm1traqsLBQqampSk1NVW1trV544QWlpqa678+M997X8OHDNXXqVJ09e9bUf985OTnKz8/3ODZ58mQ1NzdLMu//2y4XLlzQm2++qccff9x9zOz3LBHUDCo9PV2FhYWqqanxOF5TU6MZM2bE6KqiKy8vTzabzePPoKurS7W1tQn/Z2AYhr7//e/r1Vdf1VtvvaW8vDyP5818730ZhqHOzk5T3+83v/lNnT59WvX19e5HUVGR/vEf/1H19fWaMGGCae+9r87OTjU2NionJ8fUf99f/epXvcoz/M///I/GjRsnyfz/b//85z/XjTfeqPvuu899zOz3LIkt3YFwbeneunWr0dDQYCxZssQYPny48f7778f60sLm0qVLRl1dnVFXV2dIMp5//nmjrq7OvW193bp1RlZWlvHqq68ap0+fNubPn2+KbYCLFi0ysrKyjIMHD3psg/zss8/cY8x27ytWrDB+97vfGU1NTcYf//hHY+XKlcawYcOMAwcOGIZhvvsdSN/dT4Zhznv/53/+Z+PgwYPG+fPnjSNHjhh/+7d/a4wYMcL9+WXGezaM3m37qampxo9+9CPj7Nmzxi9/+Uvj2muvNXbs2OEeY9Z77+7uNm6++WZj+fLlXs+Z9Z5dCGoCtHHjRmPcuHFGenq6UVBQ4N7yaxZvv/22IcnrsXDhQsMwerc/rl692rDZbEZGRobxta99zTh9+nRsLzoMfN2zJOPnP/+5e4zZ7v2xxx5z/1u+4YYbjG9+85vugMYwzHe/A+kf1Jjx3l11SNLS0ozc3Fzj7/7u74x33nnH/bwZ79ll7969xpQpU4yMjAxj0qRJxs9+9jOP58167/v37zckGe+++67Xc2a9ZxeLYRhGTKaIAAAAwoicGgAAYAoENQAAwBQIagAAgCkQ1AAAAFMgqAEAAKZAUAMAAEyBoAYAAJgCQQ0AADAFghoAAGAKBDUAAMAUCGoAAIApENQAAABT+P8B66dE3hSYDvsAAAAASUVORK5CYII=",
|
| 460 |
+
"text/plain": [
|
| 461 |
+
"<Figure size 640x480 with 1 Axes>"
|
| 462 |
+
]
|
| 463 |
+
},
|
| 464 |
+
"metadata": {},
|
| 465 |
+
"output_type": "display_data"
|
| 466 |
+
}
|
| 467 |
+
],
|
| 468 |
+
"source": [
|
| 469 |
+
"plt.scatter(w['demand'], w['probability'])"
|
| 470 |
+
]
|
| 471 |
+
},
|
| 472 |
+
{
|
| 473 |
+
"cell_type": "code",
|
| 474 |
+
"execution_count": 43,
|
| 475 |
+
"id": "d1bf1d32-58e6-4d03-89ca-129ee7371cff",
|
| 476 |
+
"metadata": {},
|
| 477 |
+
"outputs": [
|
| 478 |
+
{
|
| 479 |
+
"data": {
|
| 480 |
+
"text/plain": [
|
| 481 |
+
"{'product': {'263': 'Wedding Cake',\n",
|
| 482 |
+
" '261': 'Wedding Cake',\n",
|
| 483 |
+
" '259': 'Wedding Cake',\n",
|
| 484 |
+
" '269': 'Wedding Cake',\n",
|
| 485 |
+
" '264': 'Wedding Cake',\n",
|
| 486 |
+
" '268': 'Wedding Cake',\n",
|
| 487 |
+
" '258': 'Wedding Cake',\n",
|
| 488 |
+
" '260': 'Wedding Cake',\n",
|
| 489 |
+
" '257': 'Wedding Cake',\n",
|
| 490 |
+
" '270': 'Wedding Cake',\n",
|
| 491 |
+
" '262': 'Wedding Cake',\n",
|
| 492 |
+
" '265': 'Wedding Cake',\n",
|
| 493 |
+
" '266': 'Wedding Cake',\n",
|
| 494 |
+
" '267': 'Wedding Cake',\n",
|
| 495 |
+
" '271': 'Wedding Cake',\n",
|
| 496 |
+
" '161': 'Special Cake',\n",
|
| 497 |
+
" '46': 'White Bread',\n",
|
| 498 |
+
" '256': 'Wedding Cake',\n",
|
| 499 |
+
" '255': 'Wedding Cake',\n",
|
| 500 |
+
" '275': 'Wedding Cake',\n",
|
| 501 |
+
" '272': 'Wedding Cake',\n",
|
| 502 |
+
" '34': 'White Bread',\n",
|
| 503 |
+
" '149': 'Special Cake',\n",
|
| 504 |
+
" '278': 'Wedding Cake',\n",
|
| 505 |
+
" '159': 'Special Cake',\n",
|
| 506 |
+
" '44': 'White Bread',\n",
|
| 507 |
+
" '35': 'White Bread',\n",
|
| 508 |
+
" '150': 'Special Cake',\n",
|
| 509 |
+
" '277': 'Wedding Cake',\n",
|
| 510 |
+
" '36': 'White Bread',\n",
|
| 511 |
+
" '151': 'Special Cake',\n",
|
| 512 |
+
" '253': 'Wedding Cake',\n",
|
| 513 |
+
" '43': 'White Bread',\n",
|
| 514 |
+
" '158': 'Special Cake',\n",
|
| 515 |
+
" '274': 'Wedding Cake',\n",
|
| 516 |
+
" '157': 'Special Cake',\n",
|
| 517 |
+
" '42': 'White Bread',\n",
|
| 518 |
+
" '162': 'Special Cake',\n",
|
| 519 |
+
" '47': 'White Bread',\n",
|
| 520 |
+
" '254': 'Wedding Cake',\n",
|
| 521 |
+
" '154': 'Special Cake',\n",
|
| 522 |
+
" '39': 'White Bread',\n",
|
| 523 |
+
" '276': 'Wedding Cake',\n",
|
| 524 |
+
" '163': 'Special Cake',\n",
|
| 525 |
+
" '48': 'White Bread',\n",
|
| 526 |
+
" '279': 'Wedding Cake',\n",
|
| 527 |
+
" '153': 'Special Cake',\n",
|
| 528 |
+
" '38': 'White Bread',\n",
|
| 529 |
+
" '152': 'Special Cake',\n",
|
| 530 |
+
" '37': 'White Bread',\n",
|
| 531 |
+
" '45': 'White Bread',\n",
|
| 532 |
+
" '160': 'Special Cake',\n",
|
| 533 |
+
" '164': 'Special Cake',\n",
|
| 534 |
+
" '49': 'White Bread',\n",
|
| 535 |
+
" '40': 'White Bread',\n",
|
| 536 |
+
" '155': 'Special Cake',\n",
|
| 537 |
+
" '41': 'White Bread',\n",
|
| 538 |
+
" '156': 'Special Cake',\n",
|
| 539 |
+
" '166': 'Special Cake',\n",
|
| 540 |
+
" '51': 'White Bread',\n",
|
| 541 |
+
" '273': 'Wedding Cake',\n",
|
| 542 |
+
" '82': 'White Bread',\n",
|
| 543 |
+
" '197': 'Special Cake',\n",
|
| 544 |
+
" '79': 'White Bread',\n",
|
| 545 |
+
" '194': 'Special Cake',\n",
|
| 546 |
+
" '81': 'White Bread',\n",
|
| 547 |
+
" '196': 'Special Cake',\n",
|
| 548 |
+
" '182': 'Special Cake',\n",
|
| 549 |
+
" '67': 'White Bread',\n",
|
| 550 |
+
" '52': 'White Bread',\n",
|
| 551 |
+
" '167': 'Special Cake',\n",
|
| 552 |
+
" '50': 'White Bread',\n",
|
| 553 |
+
" '165': 'Special Cake',\n",
|
| 554 |
+
" '280': 'Wedding Cake',\n",
|
| 555 |
+
" '80': 'White Bread',\n",
|
| 556 |
+
" '195': 'Special Cake',\n",
|
| 557 |
+
" '252': 'Wedding Cake',\n",
|
| 558 |
+
" '85': 'White Bread',\n",
|
| 559 |
+
" '200': 'Special Cake',\n",
|
| 560 |
+
" '199': 'Special Cake',\n",
|
| 561 |
+
" '84': 'White Bread',\n",
|
| 562 |
+
" '281': 'Wedding Cake',\n",
|
| 563 |
+
" '183': 'Special Cake',\n",
|
| 564 |
+
" '68': 'White Bread',\n",
|
| 565 |
+
" '251': 'Wedding Cake',\n",
|
| 566 |
+
" '181': 'Special Cake',\n",
|
| 567 |
+
" '66': 'White Bread',\n",
|
| 568 |
+
" '282': 'Wedding Cake',\n",
|
| 569 |
+
" '171': 'Special Cake',\n",
|
| 570 |
+
" '56': 'White Bread',\n",
|
| 571 |
+
" '33': 'White Bread',\n",
|
| 572 |
+
" '148': 'Special Cake',\n",
|
| 573 |
+
" '53': 'White Bread',\n",
|
| 574 |
+
" '168': 'Special Cake',\n",
|
| 575 |
+
" '173': 'Special Cake',\n",
|
| 576 |
+
" '58': 'White Bread',\n",
|
| 577 |
+
" '172': 'Special Cake',\n",
|
| 578 |
+
" '57': 'White Bread',\n",
|
| 579 |
+
" '60': 'White Bread',\n",
|
| 580 |
+
" '175': 'Special Cake',\n",
|
| 581 |
+
" '286': 'Wedding Cake',\n",
|
| 582 |
+
" '174': 'Special Cake',\n",
|
| 583 |
+
" '59': 'White Bread',\n",
|
| 584 |
+
" '198': 'Special Cake',\n",
|
| 585 |
+
" '83': 'White Bread',\n",
|
| 586 |
+
" '169': 'Special Cake',\n",
|
| 587 |
+
" '54': 'White Bread',\n",
|
| 588 |
+
" '86': 'White Bread',\n",
|
| 589 |
+
" '201': 'Special Cake',\n",
|
| 590 |
+
" '185': 'Special Cake',\n",
|
| 591 |
+
" '70': 'White Bread',\n",
|
| 592 |
+
" '184': 'Special Cake',\n",
|
| 593 |
+
" '69': 'White Bread',\n",
|
| 594 |
+
" '78': 'White Bread',\n",
|
| 595 |
+
" '193': 'Special Cake',\n",
|
| 596 |
+
" '250': 'Wedding Cake',\n",
|
| 597 |
+
" '71': 'White Bread',\n",
|
| 598 |
+
" '186': 'Special Cake',\n",
|
| 599 |
+
" '192': 'Special Cake',\n",
|
| 600 |
+
" '77': 'White Bread',\n",
|
| 601 |
+
" '191': 'Special Cake',\n",
|
| 602 |
+
" '76': 'White Bread',\n",
|
| 603 |
+
" '285': 'Wedding Cake',\n",
|
| 604 |
+
" '176': 'Special Cake',\n",
|
| 605 |
+
" '61': 'White Bread',\n",
|
| 606 |
+
" '249': 'Wedding Cake',\n",
|
| 607 |
+
" '74': 'White Bread',\n",
|
| 608 |
+
" '189': 'Special Cake',\n",
|
| 609 |
+
" '170': 'Special Cake',\n",
|
| 610 |
+
" '55': 'White Bread',\n",
|
| 611 |
+
" '190': 'Special Cake',\n",
|
| 612 |
+
" '75': 'White Bread',\n",
|
| 613 |
+
" '177': 'Special Cake',\n",
|
| 614 |
+
" '62': 'White Bread',\n",
|
| 615 |
+
" '283': 'Wedding Cake',\n",
|
| 616 |
+
" '188': 'Special Cake',\n",
|
| 617 |
+
" '73': 'White Bread',\n",
|
| 618 |
+
" '65': 'White Bread',\n",
|
| 619 |
+
" '180': 'Special Cake',\n",
|
| 620 |
+
" '187': 'Special Cake',\n",
|
| 621 |
+
" '72': 'White Bread',\n",
|
| 622 |
+
" '284': 'Wedding Cake',\n",
|
| 623 |
+
" '203': 'Special Cake',\n",
|
| 624 |
+
" '88': 'White Bread',\n",
|
| 625 |
+
" '63': 'White Bread',\n",
|
| 626 |
+
" '178': 'Special Cake',\n",
|
| 627 |
+
" '287': 'Wedding Cake',\n",
|
| 628 |
+
" '87': 'White Bread',\n",
|
| 629 |
+
" '202': 'Special Cake',\n",
|
| 630 |
+
" '32': 'White Bread',\n",
|
| 631 |
+
" '147': 'Special Cake',\n",
|
| 632 |
+
" '207': 'Special Cake',\n",
|
| 633 |
+
" '92': 'White Bread',\n",
|
| 634 |
+
" '290': 'Wedding Cake',\n",
|
| 635 |
+
" '90': 'White Bread',\n",
|
| 636 |
+
" '205': 'Special Cake',\n",
|
| 637 |
+
" '248': 'Wedding Cake',\n",
|
| 638 |
+
" '211': 'Special Cake',\n",
|
| 639 |
+
" '96': 'White Bread',\n",
|
| 640 |
+
" '89': 'White Bread',\n",
|
| 641 |
+
" '204': 'Special Cake',\n",
|
| 642 |
+
" '289': 'Wedding Cake',\n",
|
| 643 |
+
" '291': 'Wedding Cake',\n",
|
| 644 |
+
" '146': 'Special Cake',\n",
|
| 645 |
+
" '31': 'White Bread',\n",
|
| 646 |
+
" '64': 'White Bread',\n",
|
| 647 |
+
" '179': 'Special Cake',\n",
|
| 648 |
+
" '209': 'Special Cake',\n",
|
| 649 |
+
" '94': 'White Bread',\n",
|
| 650 |
+
" '288': 'Wedding Cake',\n",
|
| 651 |
+
" '224': 'Special Cake',\n",
|
| 652 |
+
" '109': 'White Bread',\n",
|
| 653 |
+
" '292': 'Wedding Cake',\n",
|
| 654 |
+
" '28': 'White Bread',\n",
|
| 655 |
+
" '143': 'Special Cake',\n",
|
| 656 |
+
" '30': 'White Bread',\n",
|
| 657 |
+
" '145': 'Special Cake',\n",
|
| 658 |
+
" '29': 'White Bread',\n",
|
| 659 |
+
" '144': 'Special Cake',\n",
|
| 660 |
+
" '208': 'Special Cake',\n",
|
| 661 |
+
" '93': 'White Bread',\n",
|
| 662 |
+
" '206': 'Special Cake',\n",
|
| 663 |
+
" '91': 'White Bread',\n",
|
| 664 |
+
" '223': 'Special Cake',\n",
|
| 665 |
+
" '108': 'White Bread',\n",
|
| 666 |
+
" '222': 'Special Cake',\n",
|
| 667 |
+
" '107': 'White Bread',\n",
|
| 668 |
+
" '220': 'Special Cake',\n",
|
| 669 |
+
" '105': 'White Bread',\n",
|
| 670 |
+
" '27': 'White Bread',\n",
|
| 671 |
+
" '142': 'Special Cake',\n",
|
| 672 |
+
" '245': 'Wedding Cake',\n",
|
| 673 |
+
" '95': 'White Bread',\n",
|
| 674 |
+
" '210': 'Special Cake',\n",
|
| 675 |
+
" '106': 'White Bread',\n",
|
| 676 |
+
" '221': 'Special Cake',\n",
|
| 677 |
+
" '26': 'White Bread',\n",
|
| 678 |
+
" '141': 'Special Cake',\n",
|
| 679 |
+
" '293': 'Wedding Cake',\n",
|
| 680 |
+
" '110': 'White Bread',\n",
|
| 681 |
+
" '225': 'Special Cake',\n",
|
| 682 |
+
" '112': 'White Bread',\n",
|
| 683 |
+
" '227': 'Special Cake',\n",
|
| 684 |
+
" '243': 'Wedding Cake',\n",
|
| 685 |
+
" '247': 'Wedding Cake',\n",
|
| 686 |
+
" '25': 'White Bread',\n",
|
| 687 |
+
" '140': 'Special Cake',\n",
|
| 688 |
+
" '244': 'Wedding Cake',\n",
|
| 689 |
+
" '294': 'Wedding Cake',\n",
|
| 690 |
+
" '212': 'Special Cake',\n",
|
| 691 |
+
" '97': 'White Bread',\n",
|
| 692 |
+
" '297': 'Wedding Cake',\n",
|
| 693 |
+
" '226': 'Special Cake',\n",
|
| 694 |
+
" '111': 'White Bread',\n",
|
| 695 |
+
" '298': 'Wedding Cake',\n",
|
| 696 |
+
" '246': 'Wedding Cake',\n",
|
| 697 |
+
" '104': 'White Bread',\n",
|
| 698 |
+
" '219': 'Special Cake',\n",
|
| 699 |
+
" '15': 'White Bread',\n",
|
| 700 |
+
" '130': 'Special Cake',\n",
|
| 701 |
+
" '295': 'Wedding Cake',\n",
|
| 702 |
+
" '296': 'Wedding Cake',\n",
|
| 703 |
+
" '237': 'Wedding Cake',\n",
|
| 704 |
+
" '113': 'White Bread',\n",
|
| 705 |
+
" '228': 'Special Cake',\n",
|
| 706 |
+
" '139': 'Special Cake',\n",
|
| 707 |
+
" '24': 'White Bread',\n",
|
| 708 |
+
" '218': 'Special Cake',\n",
|
| 709 |
+
" '103': 'White Bread',\n",
|
| 710 |
+
" '137': 'Special Cake',\n",
|
| 711 |
+
" '22': 'White Bread',\n",
|
| 712 |
+
" '299': 'Wedding Cake',\n",
|
| 713 |
+
" '131': 'Special Cake',\n",
|
| 714 |
+
" '16': 'White Bread',\n",
|
| 715 |
+
" '235': 'Wedding Cake',\n",
|
| 716 |
+
" '213': 'Special Cake',\n",
|
| 717 |
+
" '98': 'White Bread',\n",
|
| 718 |
+
" '120': 'Special Cake',\n",
|
| 719 |
+
" '5': 'White Bread',\n",
|
| 720 |
+
" '23': 'White Bread',\n",
|
| 721 |
+
" '138': 'Special Cake',\n",
|
| 722 |
+
" '7': 'White Bread',\n",
|
| 723 |
+
" '122': 'Special Cake',\n",
|
| 724 |
+
" '132': 'Special Cake',\n",
|
| 725 |
+
" '17': 'White Bread',\n",
|
| 726 |
+
" '129': 'Special Cake',\n",
|
| 727 |
+
" '14': 'White Bread',\n",
|
| 728 |
+
" '231': 'Wedding Cake',\n",
|
| 729 |
+
" '300': 'Wedding Cake',\n",
|
| 730 |
+
" '136': 'Special Cake',\n",
|
| 731 |
+
" '21': 'White Bread',\n",
|
| 732 |
+
" '242': 'Wedding Cake',\n",
|
| 733 |
+
" '8': 'White Bread',\n",
|
| 734 |
+
" '123': 'Special Cake',\n",
|
| 735 |
+
" '302': 'Wedding Cake',\n",
|
| 736 |
+
" '101': 'White Bread',\n",
|
| 737 |
+
" '216': 'Special Cake',\n",
|
| 738 |
+
" '9': 'White Bread',\n",
|
| 739 |
+
" '124': 'Special Cake',\n",
|
| 740 |
+
" '1': 'White Bread',\n",
|
| 741 |
+
" '116': 'Special Cake',\n",
|
| 742 |
+
" '233': 'Wedding Cake',\n",
|
| 743 |
+
" '234': 'Wedding Cake',\n",
|
| 744 |
+
" '303': 'Wedding Cake',\n",
|
| 745 |
+
" '13': 'White Bread',\n",
|
| 746 |
+
" '128': 'Special Cake',\n",
|
| 747 |
+
" '304': 'Wedding Cake',\n",
|
| 748 |
+
" '215': 'Special Cake',\n",
|
| 749 |
+
" '100': 'White Bread',\n",
|
| 750 |
+
" '20': 'White Bread',\n",
|
| 751 |
+
" '135': 'Special Cake',\n",
|
| 752 |
+
" '133': 'Special Cake',\n",
|
| 753 |
+
" '18': 'White Bread',\n",
|
| 754 |
+
" '3': 'White Bread',\n",
|
| 755 |
+
" '118': 'Special Cake',\n",
|
| 756 |
+
" '214': 'Special Cake',\n",
|
| 757 |
+
" '99': 'White Bread',\n",
|
| 758 |
+
" '232': 'Wedding Cake',\n",
|
| 759 |
+
" '217': 'Special Cake',\n",
|
| 760 |
+
" '102': 'White Bread',\n",
|
| 761 |
+
" '301': 'Wedding Cake',\n",
|
| 762 |
+
" '238': 'Wedding Cake',\n",
|
| 763 |
+
" '239': 'Wedding Cake',\n",
|
| 764 |
+
" '240': 'Wedding Cake',\n",
|
| 765 |
+
" '134': 'Special Cake',\n",
|
| 766 |
+
" '19': 'White Bread',\n",
|
| 767 |
+
" '4': 'White Bread',\n",
|
| 768 |
+
" '119': 'Special Cake',\n",
|
| 769 |
+
" '126': 'Special Cake',\n",
|
| 770 |
+
" '11': 'White Bread',\n",
|
| 771 |
+
" '117': 'Special Cake',\n",
|
| 772 |
+
" '2': 'White Bread',\n",
|
| 773 |
+
" '114': 'White Bread',\n",
|
| 774 |
+
" '229': 'Special Cake',\n",
|
| 775 |
+
" '236': 'Wedding Cake',\n",
|
| 776 |
+
" '241': 'Wedding Cake',\n",
|
| 777 |
+
" '121': 'Special Cake',\n",
|
| 778 |
+
" '6': 'White Bread',\n",
|
| 779 |
+
" '12': 'White Bread',\n",
|
| 780 |
+
" '127': 'Special Cake',\n",
|
| 781 |
+
" '125': 'Special Cake',\n",
|
| 782 |
+
" '10': 'White Bread'},\n",
|
| 783 |
+
" 'demand': {'263': 33,\n",
|
| 784 |
+
" '261': 31,\n",
|
| 785 |
+
" '259': 29,\n",
|
| 786 |
+
" '269': 39,\n",
|
| 787 |
+
" '264': 34,\n",
|
| 788 |
+
" '268': 38,\n",
|
| 789 |
+
" '258': 28,\n",
|
| 790 |
+
" '260': 30,\n",
|
| 791 |
+
" '257': 27,\n",
|
| 792 |
+
" '270': 40,\n",
|
| 793 |
+
" '262': 32,\n",
|
| 794 |
+
" '265': 35,\n",
|
| 795 |
+
" '266': 36,\n",
|
| 796 |
+
" '267': 37,\n",
|
| 797 |
+
" '271': 41,\n",
|
| 798 |
+
" '161': 46,\n",
|
| 799 |
+
" '46': 46,\n",
|
| 800 |
+
" '256': 26,\n",
|
| 801 |
+
" '255': 25,\n",
|
| 802 |
+
" '275': 45,\n",
|
| 803 |
+
" '272': 42,\n",
|
| 804 |
+
" '34': 34,\n",
|
| 805 |
+
" '149': 34,\n",
|
| 806 |
+
" '278': 48,\n",
|
| 807 |
+
" '159': 44,\n",
|
| 808 |
+
" '44': 44,\n",
|
| 809 |
+
" '35': 35,\n",
|
| 810 |
+
" '150': 35,\n",
|
| 811 |
+
" '277': 47,\n",
|
| 812 |
+
" '36': 36,\n",
|
| 813 |
+
" '151': 36,\n",
|
| 814 |
+
" '253': 23,\n",
|
| 815 |
+
" '43': 43,\n",
|
| 816 |
+
" '158': 43,\n",
|
| 817 |
+
" '274': 44,\n",
|
| 818 |
+
" '157': 42,\n",
|
| 819 |
+
" '42': 42,\n",
|
| 820 |
+
" '162': 47,\n",
|
| 821 |
+
" '47': 47,\n",
|
| 822 |
+
" '254': 24,\n",
|
| 823 |
+
" '154': 39,\n",
|
| 824 |
+
" '39': 39,\n",
|
| 825 |
+
" '276': 46,\n",
|
| 826 |
+
" '163': 48,\n",
|
| 827 |
+
" '48': 48,\n",
|
| 828 |
+
" '279': 49,\n",
|
| 829 |
+
" '153': 38,\n",
|
| 830 |
+
" '38': 38,\n",
|
| 831 |
+
" '152': 37,\n",
|
| 832 |
+
" '37': 37,\n",
|
| 833 |
+
" '45': 45,\n",
|
| 834 |
+
" '160': 45,\n",
|
| 835 |
+
" '164': 49,\n",
|
| 836 |
+
" '49': 49,\n",
|
| 837 |
+
" '40': 40,\n",
|
| 838 |
+
" '155': 40,\n",
|
| 839 |
+
" '41': 41,\n",
|
| 840 |
+
" '156': 41,\n",
|
| 841 |
+
" '166': 51,\n",
|
| 842 |
+
" '51': 51,\n",
|
| 843 |
+
" '273': 43,\n",
|
| 844 |
+
" '82': 82,\n",
|
| 845 |
+
" '197': 82,\n",
|
| 846 |
+
" '79': 79,\n",
|
| 847 |
+
" '194': 79,\n",
|
| 848 |
+
" '81': 81,\n",
|
| 849 |
+
" '196': 81,\n",
|
| 850 |
+
" '182': 67,\n",
|
| 851 |
+
" '67': 67,\n",
|
| 852 |
+
" '52': 52,\n",
|
| 853 |
+
" '167': 52,\n",
|
| 854 |
+
" '50': 50,\n",
|
| 855 |
+
" '165': 50,\n",
|
| 856 |
+
" '280': 50,\n",
|
| 857 |
+
" '80': 80,\n",
|
| 858 |
+
" '195': 80,\n",
|
| 859 |
+
" '252': 22,\n",
|
| 860 |
+
" '85': 85,\n",
|
| 861 |
+
" '200': 85,\n",
|
| 862 |
+
" '199': 84,\n",
|
| 863 |
+
" '84': 84,\n",
|
| 864 |
+
" '281': 51,\n",
|
| 865 |
+
" '183': 68,\n",
|
| 866 |
+
" '68': 68,\n",
|
| 867 |
+
" '251': 21,\n",
|
| 868 |
+
" '181': 66,\n",
|
| 869 |
+
" '66': 66,\n",
|
| 870 |
+
" '282': 52,\n",
|
| 871 |
+
" '171': 56,\n",
|
| 872 |
+
" '56': 56,\n",
|
| 873 |
+
" '33': 33,\n",
|
| 874 |
+
" '148': 33,\n",
|
| 875 |
+
" '53': 53,\n",
|
| 876 |
+
" '168': 53,\n",
|
| 877 |
+
" '173': 58,\n",
|
| 878 |
+
" '58': 58,\n",
|
| 879 |
+
" '172': 57,\n",
|
| 880 |
+
" '57': 57,\n",
|
| 881 |
+
" '60': 60,\n",
|
| 882 |
+
" '175': 60,\n",
|
| 883 |
+
" '286': 56,\n",
|
| 884 |
+
" '174': 59,\n",
|
| 885 |
+
" '59': 59,\n",
|
| 886 |
+
" '198': 83,\n",
|
| 887 |
+
" '83': 83,\n",
|
| 888 |
+
" '169': 54,\n",
|
| 889 |
+
" '54': 54,\n",
|
| 890 |
+
" '86': 86,\n",
|
| 891 |
+
" '201': 86,\n",
|
| 892 |
+
" '185': 70,\n",
|
| 893 |
+
" '70': 70,\n",
|
| 894 |
+
" '184': 69,\n",
|
| 895 |
+
" '69': 69,\n",
|
| 896 |
+
" '78': 78,\n",
|
| 897 |
+
" '193': 78,\n",
|
| 898 |
+
" '250': 20,\n",
|
| 899 |
+
" '71': 71,\n",
|
| 900 |
+
" '186': 71,\n",
|
| 901 |
+
" '192': 77,\n",
|
| 902 |
+
" '77': 77,\n",
|
| 903 |
+
" '191': 76,\n",
|
| 904 |
+
" '76': 76,\n",
|
| 905 |
+
" '285': 55,\n",
|
| 906 |
+
" '176': 61,\n",
|
| 907 |
+
" '61': 61,\n",
|
| 908 |
+
" '249': 19,\n",
|
| 909 |
+
" '74': 74,\n",
|
| 910 |
+
" '189': 74,\n",
|
| 911 |
+
" '170': 55,\n",
|
| 912 |
+
" '55': 55,\n",
|
| 913 |
+
" '190': 75,\n",
|
| 914 |
+
" '75': 75,\n",
|
| 915 |
+
" '177': 62,\n",
|
| 916 |
+
" '62': 62,\n",
|
| 917 |
+
" '283': 53,\n",
|
| 918 |
+
" '188': 73,\n",
|
| 919 |
+
" '73': 73,\n",
|
| 920 |
+
" '65': 65,\n",
|
| 921 |
+
" '180': 65,\n",
|
| 922 |
+
" '187': 72,\n",
|
| 923 |
+
" '72': 72,\n",
|
| 924 |
+
" '284': 54,\n",
|
| 925 |
+
" '203': 88,\n",
|
| 926 |
+
" '88': 88,\n",
|
| 927 |
+
" '63': 63,\n",
|
| 928 |
+
" '178': 63,\n",
|
| 929 |
+
" '287': 57,\n",
|
| 930 |
+
" '87': 87,\n",
|
| 931 |
+
" '202': 87,\n",
|
| 932 |
+
" '32': 32,\n",
|
| 933 |
+
" '147': 32,\n",
|
| 934 |
+
" '207': 92,\n",
|
| 935 |
+
" '92': 92,\n",
|
| 936 |
+
" '290': 60,\n",
|
| 937 |
+
" '90': 90,\n",
|
| 938 |
+
" '205': 90,\n",
|
| 939 |
+
" '248': 18,\n",
|
| 940 |
+
" '211': 96,\n",
|
| 941 |
+
" '96': 96,\n",
|
| 942 |
+
" '89': 89,\n",
|
| 943 |
+
" '204': 89,\n",
|
| 944 |
+
" '289': 59,\n",
|
| 945 |
+
" '291': 61,\n",
|
| 946 |
+
" '146': 31,\n",
|
| 947 |
+
" '31': 31,\n",
|
| 948 |
+
" '64': 64,\n",
|
| 949 |
+
" '179': 64,\n",
|
| 950 |
+
" '209': 94,\n",
|
| 951 |
+
" '94': 94,\n",
|
| 952 |
+
" '288': 58,\n",
|
| 953 |
+
" '224': 109,\n",
|
| 954 |
+
" '109': 109,\n",
|
| 955 |
+
" '292': 62,\n",
|
| 956 |
+
" '28': 28,\n",
|
| 957 |
+
" '143': 28,\n",
|
| 958 |
+
" '30': 30,\n",
|
| 959 |
+
" '145': 30,\n",
|
| 960 |
+
" '29': 29,\n",
|
| 961 |
+
" '144': 29,\n",
|
| 962 |
+
" '208': 93,\n",
|
| 963 |
+
" '93': 93,\n",
|
| 964 |
+
" '206': 91,\n",
|
| 965 |
+
" '91': 91,\n",
|
| 966 |
+
" '223': 108,\n",
|
| 967 |
+
" '108': 108,\n",
|
| 968 |
+
" '222': 107,\n",
|
| 969 |
+
" '107': 107,\n",
|
| 970 |
+
" '220': 105,\n",
|
| 971 |
+
" '105': 105,\n",
|
| 972 |
+
" '27': 27,\n",
|
| 973 |
+
" '142': 27,\n",
|
| 974 |
+
" '245': 15,\n",
|
| 975 |
+
" '95': 95,\n",
|
| 976 |
+
" '210': 95,\n",
|
| 977 |
+
" '106': 106,\n",
|
| 978 |
+
" '221': 106,\n",
|
| 979 |
+
" '26': 26,\n",
|
| 980 |
+
" '141': 26,\n",
|
| 981 |
+
" '293': 63,\n",
|
| 982 |
+
" '110': 110,\n",
|
| 983 |
+
" '225': 110,\n",
|
| 984 |
+
" '112': 112,\n",
|
| 985 |
+
" '227': 112,\n",
|
| 986 |
+
" '243': 13,\n",
|
| 987 |
+
" '247': 17,\n",
|
| 988 |
+
" '25': 25,\n",
|
| 989 |
+
" '140': 25,\n",
|
| 990 |
+
" '244': 14,\n",
|
| 991 |
+
" '294': 64,\n",
|
| 992 |
+
" '212': 97,\n",
|
| 993 |
+
" '97': 97,\n",
|
| 994 |
+
" '297': 67,\n",
|
| 995 |
+
" '226': 111,\n",
|
| 996 |
+
" '111': 111,\n",
|
| 997 |
+
" '298': 68,\n",
|
| 998 |
+
" '246': 16,\n",
|
| 999 |
+
" '104': 104,\n",
|
| 1000 |
+
" '219': 104,\n",
|
| 1001 |
+
" '15': 15,\n",
|
| 1002 |
+
" '130': 15,\n",
|
| 1003 |
+
" '295': 65,\n",
|
| 1004 |
+
" '296': 66,\n",
|
| 1005 |
+
" '237': 7,\n",
|
| 1006 |
+
" '113': 113,\n",
|
| 1007 |
+
" '228': 113,\n",
|
| 1008 |
+
" '139': 24,\n",
|
| 1009 |
+
" '24': 24,\n",
|
| 1010 |
+
" '218': 103,\n",
|
| 1011 |
+
" '103': 103,\n",
|
| 1012 |
+
" '137': 22,\n",
|
| 1013 |
+
" '22': 22,\n",
|
| 1014 |
+
" '299': 69,\n",
|
| 1015 |
+
" '131': 16,\n",
|
| 1016 |
+
" '16': 16,\n",
|
| 1017 |
+
" '235': 5,\n",
|
| 1018 |
+
" '213': 98,\n",
|
| 1019 |
+
" '98': 98,\n",
|
| 1020 |
+
" '120': 5,\n",
|
| 1021 |
+
" '5': 5,\n",
|
| 1022 |
+
" '23': 23,\n",
|
| 1023 |
+
" '138': 23,\n",
|
| 1024 |
+
" '7': 7,\n",
|
| 1025 |
+
" '122': 7,\n",
|
| 1026 |
+
" '132': 17,\n",
|
| 1027 |
+
" '17': 17,\n",
|
| 1028 |
+
" '129': 14,\n",
|
| 1029 |
+
" '14': 14,\n",
|
| 1030 |
+
" '231': 1,\n",
|
| 1031 |
+
" '300': 70,\n",
|
| 1032 |
+
" '136': 21,\n",
|
| 1033 |
+
" '21': 21,\n",
|
| 1034 |
+
" '242': 12,\n",
|
| 1035 |
+
" '8': 8,\n",
|
| 1036 |
+
" '123': 8,\n",
|
| 1037 |
+
" '302': 72,\n",
|
| 1038 |
+
" '101': 101,\n",
|
| 1039 |
+
" '216': 101,\n",
|
| 1040 |
+
" '9': 9,\n",
|
| 1041 |
+
" '124': 9,\n",
|
| 1042 |
+
" '1': 1,\n",
|
| 1043 |
+
" '116': 1,\n",
|
| 1044 |
+
" '233': 3,\n",
|
| 1045 |
+
" '234': 4,\n",
|
| 1046 |
+
" '303': 73,\n",
|
| 1047 |
+
" '13': 13,\n",
|
| 1048 |
+
" '128': 13,\n",
|
| 1049 |
+
" '304': 74,\n",
|
| 1050 |
+
" '215': 100,\n",
|
| 1051 |
+
" '100': 100,\n",
|
| 1052 |
+
" '20': 20,\n",
|
| 1053 |
+
" '135': 20,\n",
|
| 1054 |
+
" '133': 18,\n",
|
| 1055 |
+
" '18': 18,\n",
|
| 1056 |
+
" '3': 3,\n",
|
| 1057 |
+
" '118': 3,\n",
|
| 1058 |
+
" '214': 99,\n",
|
| 1059 |
+
" '99': 99,\n",
|
| 1060 |
+
" '232': 2,\n",
|
| 1061 |
+
" '217': 102,\n",
|
| 1062 |
+
" '102': 102,\n",
|
| 1063 |
+
" '301': 71,\n",
|
| 1064 |
+
" '238': 8,\n",
|
| 1065 |
+
" '239': 9,\n",
|
| 1066 |
+
" '240': 10,\n",
|
| 1067 |
+
" '134': 19,\n",
|
| 1068 |
+
" '19': 19,\n",
|
| 1069 |
+
" '4': 4,\n",
|
| 1070 |
+
" '119': 4,\n",
|
| 1071 |
+
" '126': 11,\n",
|
| 1072 |
+
" '11': 11,\n",
|
| 1073 |
+
" '117': 2,\n",
|
| 1074 |
+
" '2': 2,\n",
|
| 1075 |
+
" '114': 114,\n",
|
| 1076 |
+
" '229': 114,\n",
|
| 1077 |
+
" '236': 6,\n",
|
| 1078 |
+
" '241': 11,\n",
|
| 1079 |
+
" '121': 6,\n",
|
| 1080 |
+
" '6': 6,\n",
|
| 1081 |
+
" '12': 12,\n",
|
| 1082 |
+
" '127': 12,\n",
|
| 1083 |
+
" '125': 10,\n",
|
| 1084 |
+
" '10': 10},\n",
|
| 1085 |
+
" 'probability': {'263': 0.0368592173,\n",
|
| 1086 |
+
" '261': 0.0359488332,\n",
|
| 1087 |
+
" '259': 0.034826178,\n",
|
| 1088 |
+
" '269': 0.0345176881,\n",
|
| 1089 |
+
" '264': 0.0338754672,\n",
|
| 1090 |
+
" '268': 0.0336984278,\n",
|
| 1091 |
+
" '258': 0.0333003656,\n",
|
| 1092 |
+
" '260': 0.032756232,\n",
|
| 1093 |
+
" '257': 0.0325301611,\n",
|
| 1094 |
+
" '270': 0.032197924,\n",
|
| 1095 |
+
" '262': 0.0318970326,\n",
|
| 1096 |
+
" '265': 0.0311347815,\n",
|
| 1097 |
+
" '266': 0.030689652,\n",
|
| 1098 |
+
" '267': 0.0290920836,\n",
|
| 1099 |
+
" '271': 0.0283928783,\n",
|
| 1100 |
+
" '161': 0.028135825,\n",
|
| 1101 |
+
" '46': 0.028135825,\n",
|
| 1102 |
+
" '256': 0.0280648941,\n",
|
| 1103 |
+
" '255': 0.026794912,\n",
|
| 1104 |
+
" '275': 0.0267789487,\n",
|
| 1105 |
+
" '272': 0.0266978264,\n",
|
| 1106 |
+
" '34': 0.02649434,\n",
|
| 1107 |
+
" '149': 0.02649434,\n",
|
| 1108 |
+
" '278': 0.0261790284,\n",
|
| 1109 |
+
" '159': 0.0260993218,\n",
|
| 1110 |
+
" '44': 0.0260993218,\n",
|
| 1111 |
+
" '35': 0.0258797103,\n",
|
| 1112 |
+
" '150': 0.0258797103,\n",
|
| 1113 |
+
" '277': 0.0249885005,\n",
|
| 1114 |
+
" '36': 0.0247542848,\n",
|
| 1115 |
+
" '151': 0.0247542848,\n",
|
| 1116 |
+
" '253': 0.0237528724,\n",
|
| 1117 |
+
" '43': 0.0227409136,\n",
|
| 1118 |
+
" '158': 0.0227409136,\n",
|
| 1119 |
+
" '274': 0.0223511295,\n",
|
| 1120 |
+
" '157': 0.0218458294,\n",
|
| 1121 |
+
" '42': 0.0218458294,\n",
|
| 1122 |
+
" '162': 0.0218256638,\n",
|
| 1123 |
+
" '47': 0.0218256638,\n",
|
| 1124 |
+
" '254': 0.0217967443,\n",
|
| 1125 |
+
" '154': 0.0216395613,\n",
|
| 1126 |
+
" '39': 0.0216395613,\n",
|
| 1127 |
+
" '276': 0.0216095805,\n",
|
| 1128 |
+
" '163': 0.0215321773,\n",
|
| 1129 |
+
" '48': 0.0215321773,\n",
|
| 1130 |
+
" '279': 0.0213346388,\n",
|
| 1131 |
+
" '153': 0.0203048915,\n",
|
| 1132 |
+
" '38': 0.0203048915,\n",
|
| 1133 |
+
" '152': 0.020051612,\n",
|
| 1134 |
+
" '37': 0.020051612,\n",
|
| 1135 |
+
" '45': 0.0199892913,\n",
|
| 1136 |
+
" '160': 0.0199892913,\n",
|
| 1137 |
+
" '164': 0.0195399323,\n",
|
| 1138 |
+
" '49': 0.0195399323,\n",
|
| 1139 |
+
" '40': 0.019229393,\n",
|
| 1140 |
+
" '155': 0.019229393,\n",
|
| 1141 |
+
" '41': 0.0190548591,\n",
|
| 1142 |
+
" '156': 0.0190548591,\n",
|
| 1143 |
+
" '166': 0.018913738,\n",
|
| 1144 |
+
" '51': 0.018913738,\n",
|
| 1145 |
+
" '273': 0.0184784305,\n",
|
| 1146 |
+
" '82': 0.0182737867,\n",
|
| 1147 |
+
" '197': 0.0182737867,\n",
|
| 1148 |
+
" '79': 0.0180723397,\n",
|
| 1149 |
+
" '194': 0.0180723397,\n",
|
| 1150 |
+
" '81': 0.0179847392,\n",
|
| 1151 |
+
" '196': 0.0179847392,\n",
|
| 1152 |
+
" '182': 0.0177538496,\n",
|
| 1153 |
+
" '67': 0.0177538496,\n",
|
| 1154 |
+
" '52': 0.017304322,\n",
|
| 1155 |
+
" '167': 0.017304322,\n",
|
| 1156 |
+
" '50': 0.0172683526,\n",
|
| 1157 |
+
" '165': 0.0172683526,\n",
|
| 1158 |
+
" '280': 0.017080318,\n",
|
| 1159 |
+
" '80': 0.0165558467,\n",
|
| 1160 |
+
" '195': 0.0165558467,\n",
|
| 1161 |
+
" '252': 0.0164150156,\n",
|
| 1162 |
+
" '85': 0.0163239057,\n",
|
| 1163 |
+
" '200': 0.0163239057,\n",
|
| 1164 |
+
" '199': 0.0155502511,\n",
|
| 1165 |
+
" '84': 0.0155502511,\n",
|
| 1166 |
+
" '281': 0.0155468033,\n",
|
| 1167 |
+
" '183': 0.0153482999,\n",
|
| 1168 |
+
" '68': 0.0153482999,\n",
|
| 1169 |
+
" '251': 0.0150519811,\n",
|
| 1170 |
+
" '181': 0.0149100957,\n",
|
| 1171 |
+
" '66': 0.0149100957,\n",
|
| 1172 |
+
" '282': 0.0145321593,\n",
|
| 1173 |
+
" '171': 0.0145073305,\n",
|
| 1174 |
+
" '56': 0.0145073305,\n",
|
| 1175 |
+
" '33': 0.0143434204,\n",
|
| 1176 |
+
" '148': 0.0143434204,\n",
|
| 1177 |
+
" '53': 0.0139978926,\n",
|
| 1178 |
+
" '168': 0.0139978926,\n",
|
| 1179 |
+
" '173': 0.0137575929,\n",
|
| 1180 |
+
" '58': 0.0137575929,\n",
|
| 1181 |
+
" '172': 0.0133753577,\n",
|
| 1182 |
+
" '57': 0.0133753577,\n",
|
| 1183 |
+
" '60': 0.0132917234,\n",
|
| 1184 |
+
" '175': 0.0132917234,\n",
|
| 1185 |
+
" '286': 0.0128341354,\n",
|
| 1186 |
+
" '174': 0.0125602164,\n",
|
| 1187 |
+
" '59': 0.0125602164,\n",
|
| 1188 |
+
" '198': 0.0122586994,\n",
|
| 1189 |
+
" '83': 0.0122586994,\n",
|
| 1190 |
+
" '169': 0.0121257892,\n",
|
| 1191 |
+
" '54': 0.0121257892,\n",
|
| 1192 |
+
" '86': 0.0121178443,\n",
|
| 1193 |
+
" '201': 0.0121178443,\n",
|
| 1194 |
+
" '185': 0.0117735274,\n",
|
| 1195 |
+
" '70': 0.0117735274,\n",
|
| 1196 |
+
" '184': 0.0117612458,\n",
|
| 1197 |
+
" '69': 0.0117612458,\n",
|
| 1198 |
+
" '78': 0.011635456,\n",
|
| 1199 |
+
" '193': 0.011635456,\n",
|
| 1200 |
+
" '250': 0.01154316,\n",
|
| 1201 |
+
" '71': 0.0112493485,\n",
|
| 1202 |
+
" '186': 0.0112493485,\n",
|
| 1203 |
+
" '192': 0.0111785296,\n",
|
| 1204 |
+
" '77': 0.0111785296,\n",
|
| 1205 |
+
" '191': 0.0111410438,\n",
|
| 1206 |
+
" '76': 0.0111410438,\n",
|
| 1207 |
+
" '285': 0.0110507398,\n",
|
| 1208 |
+
" '176': 0.0105914583,\n",
|
| 1209 |
+
" '61': 0.0105914583,\n",
|
| 1210 |
+
" '249': 0.0105420966,\n",
|
| 1211 |
+
" '74': 0.0105078101,\n",
|
| 1212 |
+
" '189': 0.0105078101,\n",
|
| 1213 |
+
" '170': 0.0103408676,\n",
|
| 1214 |
+
" '55': 0.0103408676,\n",
|
| 1215 |
+
" '190': 0.0100856266,\n",
|
| 1216 |
+
" '75': 0.0100856266,\n",
|
| 1217 |
+
" '177': 0.0100635496,\n",
|
| 1218 |
+
" '62': 0.0100635496,\n",
|
| 1219 |
+
" '283': 0.0098274898,\n",
|
| 1220 |
+
" '188': 0.009615686,\n",
|
| 1221 |
+
" '73': 0.009615686,\n",
|
| 1222 |
+
" '65': 0.0089209082,\n",
|
| 1223 |
+
" '180': 0.0089209082,\n",
|
| 1224 |
+
" '187': 0.0088669788,\n",
|
| 1225 |
+
" '72': 0.0088669788,\n",
|
| 1226 |
+
" '284': 0.008681397,\n",
|
| 1227 |
+
" '203': 0.0085985317,\n",
|
| 1228 |
+
" '88': 0.0085985317,\n",
|
| 1229 |
+
" '63': 0.0083903575,\n",
|
| 1230 |
+
" '178': 0.0083903575,\n",
|
| 1231 |
+
" '287': 0.0079844742,\n",
|
| 1232 |
+
" '87': 0.0075161459,\n",
|
| 1233 |
+
" '202': 0.0075161459,\n",
|
| 1234 |
+
" '32': 0.0065831021,\n",
|
| 1235 |
+
" '147': 0.0065831021,\n",
|
| 1236 |
+
" '207': 0.0063411487,\n",
|
| 1237 |
+
" '92': 0.0063411487,\n",
|
| 1238 |
+
" '290': 0.0061494519,\n",
|
| 1239 |
+
" '90': 0.0060437383,\n",
|
| 1240 |
+
" '205': 0.0060437383,\n",
|
| 1241 |
+
" '248': 0.0057253414,\n",
|
| 1242 |
+
" '211': 0.0057178973,\n",
|
| 1243 |
+
" '96': 0.0057178973,\n",
|
| 1244 |
+
" '89': 0.0056477112,\n",
|
| 1245 |
+
" '204': 0.0056477112,\n",
|
| 1246 |
+
" '289': 0.0055459619,\n",
|
| 1247 |
+
" '291': 0.0054795932,\n",
|
| 1248 |
+
" '146': 0.0054244868,\n",
|
| 1249 |
+
" '31': 0.0054244868,\n",
|
| 1250 |
+
" '64': 0.0053959746,\n",
|
| 1251 |
+
" '179': 0.0053959746,\n",
|
| 1252 |
+
" '209': 0.0051360659,\n",
|
| 1253 |
+
" '94': 0.0051360659,\n",
|
| 1254 |
+
" '288': 0.0050816214,\n",
|
| 1255 |
+
" '224': 0.0048954825,\n",
|
| 1256 |
+
" '109': 0.0048954825,\n",
|
| 1257 |
+
" '292': 0.0047980717,\n",
|
| 1258 |
+
" '28': 0.0045802571,\n",
|
| 1259 |
+
" '143': 0.0045802571,\n",
|
| 1260 |
+
" '30': 0.0044781409,\n",
|
| 1261 |
+
" '145': 0.0044781409,\n",
|
| 1262 |
+
" '29': 0.0043621607,\n",
|
| 1263 |
+
" '144': 0.0043621607,\n",
|
| 1264 |
+
" '208': 0.0043273171,\n",
|
| 1265 |
+
" '93': 0.0043273171,\n",
|
| 1266 |
+
" '206': 0.0041276299,\n",
|
| 1267 |
+
" '91': 0.0041276299,\n",
|
| 1268 |
+
" '223': 0.0040755787,\n",
|
| 1269 |
+
" '108': 0.0040755787,\n",
|
| 1270 |
+
" '222': 0.0039335012,\n",
|
| 1271 |
+
" '107': 0.0039335012,\n",
|
| 1272 |
+
" '220': 0.0038894774,\n",
|
| 1273 |
+
" '105': 0.0038894774,\n",
|
| 1274 |
+
" '27': 0.00385749,\n",
|
| 1275 |
+
" '142': 0.00385749,\n",
|
| 1276 |
+
" '245': 0.0036740912,\n",
|
| 1277 |
+
" '95': 0.0036275468,\n",
|
| 1278 |
+
" '210': 0.0036275468,\n",
|
| 1279 |
+
" '106': 0.0035281844,\n",
|
| 1280 |
+
" '221': 0.0035281844,\n",
|
| 1281 |
+
" '26': 0.0033199252,\n",
|
| 1282 |
+
" '141': 0.0033199252,\n",
|
| 1283 |
+
" '293': 0.0032641712,\n",
|
| 1284 |
+
" '110': 0.0031606894,\n",
|
| 1285 |
+
" '225': 0.0031606894,\n",
|
| 1286 |
+
" '112': 0.002931355,\n",
|
| 1287 |
+
" '227': 0.002931355,\n",
|
| 1288 |
+
" '243': 0.0029177054,\n",
|
| 1289 |
+
" '247': 0.0027665343,\n",
|
| 1290 |
+
" '25': 0.0026568393,\n",
|
| 1291 |
+
" '140': 0.0026568393,\n",
|
| 1292 |
+
" '244': 0.0026502146,\n",
|
| 1293 |
+
" '294': 0.0025965544,\n",
|
| 1294 |
+
" '212': 0.002554393,\n",
|
| 1295 |
+
" '97': 0.002554393,\n",
|
| 1296 |
+
" '297': 0.0022778517,\n",
|
| 1297 |
+
" '226': 0.0022694948,\n",
|
| 1298 |
+
" '111': 0.0022694948,\n",
|
| 1299 |
+
" '298': 0.0022332029,\n",
|
| 1300 |
+
" '246': 0.00198394,\n",
|
| 1301 |
+
" '104': 0.0019647995,\n",
|
| 1302 |
+
" '219': 0.0019647995,\n",
|
| 1303 |
+
" '15': 0.0019036542,\n",
|
| 1304 |
+
" '130': 0.0019036542,\n",
|
| 1305 |
+
" '295': 0.0018337038,\n",
|
| 1306 |
+
" '296': 0.0014691137,\n",
|
| 1307 |
+
" '237': 0.0014035503,\n",
|
| 1308 |
+
" '113': 0.0013588412,\n",
|
| 1309 |
+
" '228': 0.0013588412,\n",
|
| 1310 |
+
" '139': 0.0013444622,\n",
|
| 1311 |
+
" '24': 0.0013444622,\n",
|
| 1312 |
+
" '218': 0.001279575,\n",
|
| 1313 |
+
" '103': 0.001279575,\n",
|
| 1314 |
+
" '137': 0.0012722084,\n",
|
| 1315 |
+
" '22': 0.0012722084,\n",
|
| 1316 |
+
" '299': 0.0012112573,\n",
|
| 1317 |
+
" '131': 0.0009974778,\n",
|
| 1318 |
+
" '16': 0.0009974778,\n",
|
| 1319 |
+
" '235': 0.0009420068,\n",
|
| 1320 |
+
" '213': 0.000899227,\n",
|
| 1321 |
+
" '98': 0.000899227,\n",
|
| 1322 |
+
" '120': 0.0007732343,\n",
|
| 1323 |
+
" '5': 0.0007732343,\n",
|
| 1324 |
+
" '23': 0.0007673017,\n",
|
| 1325 |
+
" '138': 0.0007673017,\n",
|
| 1326 |
+
" '7': 0.000579398,\n",
|
| 1327 |
+
" '122': 0.000579398,\n",
|
| 1328 |
+
" '132': 0.0005463021,\n",
|
| 1329 |
+
" '17': 0.0005463021,\n",
|
| 1330 |
+
" '129': 0.0005379338,\n",
|
| 1331 |
+
" '14': 0.0005379338,\n",
|
| 1332 |
+
" '231': 0.0004810596,\n",
|
| 1333 |
+
" '300': 0.0004541821,\n",
|
| 1334 |
+
" '136': 0.0004143761,\n",
|
| 1335 |
+
" '21': 0.0004143761,\n",
|
| 1336 |
+
" '242': 0.0004077686,\n",
|
| 1337 |
+
" '8': 0.000402153,\n",
|
| 1338 |
+
" '123': 0.000402153,\n",
|
| 1339 |
+
" '302': 0.0003903984,\n",
|
| 1340 |
+
" '101': 0.0003871625,\n",
|
| 1341 |
+
" '216': 0.0003871625,\n",
|
| 1342 |
+
" '9': 0.0003653594,\n",
|
| 1343 |
+
" '124': 0.0003653594,\n",
|
| 1344 |
+
" '1': 0.0003608402,\n",
|
| 1345 |
+
" '116': 0.0003608402,\n",
|
| 1346 |
+
" '233': 0.0003515124,\n",
|
| 1347 |
+
" '234': 0.0003474865,\n",
|
| 1348 |
+
" '303': 0.0003399258,\n",
|
| 1349 |
+
" '13': 0.0003227829,\n",
|
| 1350 |
+
" '128': 0.0003227829,\n",
|
| 1351 |
+
" '304': 0.0003183052,\n",
|
| 1352 |
+
" '215': 0.0003102312,\n",
|
| 1353 |
+
" '100': 0.0003102312,\n",
|
| 1354 |
+
" '20': 0.0003036225,\n",
|
| 1355 |
+
" '135': 0.0003036225,\n",
|
| 1356 |
+
" '133': 0.0002644347,\n",
|
| 1357 |
+
" '18': 0.0002644347,\n",
|
| 1358 |
+
" '3': 0.0002636676,\n",
|
| 1359 |
+
" '118': 0.0002636676,\n",
|
| 1360 |
+
" '214': 0.0002458838,\n",
|
| 1361 |
+
" '99': 0.0002458838,\n",
|
| 1362 |
+
" '232': 0.0002280527,\n",
|
| 1363 |
+
" '217': 0.0002082343,\n",
|
| 1364 |
+
" '102': 0.0002082343,\n",
|
| 1365 |
+
" '301': 0.0002049358,\n",
|
| 1366 |
+
" '238': 0.0002048074,\n",
|
| 1367 |
+
" '239': 0.0001971212,\n",
|
| 1368 |
+
" '240': 0.0001920457,\n",
|
| 1369 |
+
" '134': 0.0001910985,\n",
|
| 1370 |
+
" '19': 0.0001910985,\n",
|
| 1371 |
+
" '4': 0.0001887357,\n",
|
| 1372 |
+
" '119': 0.0001887357,\n",
|
| 1373 |
+
" '126': 0.0001747752,\n",
|
| 1374 |
+
" '11': 0.0001747752,\n",
|
| 1375 |
+
" '117': 0.0001710611,\n",
|
| 1376 |
+
" '2': 0.0001710611,\n",
|
| 1377 |
+
" '114': 0.0001586266,\n",
|
| 1378 |
+
" '229': 0.0001586266,\n",
|
| 1379 |
+
" '236': 0.0001076846,\n",
|
| 1380 |
+
" '241': 8.84724e-05,\n",
|
| 1381 |
+
" '121': 8.60457e-05,\n",
|
| 1382 |
+
" '6': 8.60457e-05,\n",
|
| 1383 |
+
" '12': 6.17417e-05,\n",
|
| 1384 |
+
" '127': 6.17417e-05,\n",
|
| 1385 |
+
" '125': 4.30096e-05,\n",
|
| 1386 |
+
" '10': 4.30096e-05}}"
|
| 1387 |
+
]
|
| 1388 |
+
},
|
| 1389 |
+
"execution_count": 43,
|
| 1390 |
+
"metadata": {},
|
| 1391 |
+
"output_type": "execute_result"
|
| 1392 |
+
}
|
| 1393 |
+
],
|
| 1394 |
+
"source": [
|
| 1395 |
+
"import json\n",
|
| 1396 |
+
"json.loads(res['probability_table'])"
|
| 1397 |
+
]
|
| 1398 |
+
}
|
| 1399 |
+
],
|
| 1400 |
+
"metadata": {
|
| 1401 |
+
"kernelspec": {
|
| 1402 |
+
"display_name": "timeseries",
|
| 1403 |
+
"language": "python",
|
| 1404 |
+
"name": "timeseries"
|
| 1405 |
+
},
|
| 1406 |
+
"language_info": {
|
| 1407 |
+
"codemirror_mode": {
|
| 1408 |
+
"name": "ipython",
|
| 1409 |
+
"version": 3
|
| 1410 |
+
},
|
| 1411 |
+
"file_extension": ".py",
|
| 1412 |
+
"mimetype": "text/x-python",
|
| 1413 |
+
"name": "python",
|
| 1414 |
+
"nbconvert_exporter": "python",
|
| 1415 |
+
"pygments_lexer": "ipython3",
|
| 1416 |
+
"version": "3.11.4"
|
| 1417 |
+
}
|
| 1418 |
+
},
|
| 1419 |
+
"nbformat": 4,
|
| 1420 |
+
"nbformat_minor": 5
|
| 1421 |
+
}
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
python-dotenv
|
src/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
src/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# from apis.idsc_login import get_idsc_apikey
|
src/__pycache__/GradioApp.cpython-310.pyc
ADDED
|
Binary file (1.1 kB). View file
|
|
|
src/__pycache__/GradioFns.cpython-310.pyc
ADDED
|
Binary file (469 Bytes). View file
|
|
|
src/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (178 Bytes). View file
|
|
|
src/__pycache__/gr_args.cpython-310.pyc
ADDED
|
Binary file (1.27 kB). View file
|
|
|
src/apis/__init__.py
ADDED
|
File without changes
|
src/apis/idsc_login.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests, yaml, datetime
|
| 2 |
+
|
| 3 |
+
def load_idsc_config():
|
| 4 |
+
with open('../configs/idsc_config', 'r') as file:
|
| 5 |
+
config = yaml.save_load(file)
|
| 6 |
+
return config
|
| 7 |
+
|
| 8 |
+
def save_idsc_config(config):
|
| 9 |
+
with open('../configs/idsc_config', 'w') as file:
|
| 10 |
+
yaml.dump(config, file, default_flow_style=False)
|
| 11 |
+
|
| 12 |
+
def get_idsc_apikey():
|
| 13 |
+
config = load_idsc_config()
|
| 14 |
+
expire = config.expire
|
| 15 |
+
expire_date = datetime.strptime(expire)
|
| 16 |
+
now = datetime.now()
|
| 17 |
+
|
| 18 |
+
if expire_date < now:
|
| 19 |
+
return config.apikey
|
| 20 |
+
|
| 21 |
+
new_expire = (now + datetime.timedelta(days=3)).strftime()
|
| 22 |
+
config.apikey = idsc_login()
|
| 23 |
+
config.expire = new_expire
|
| 24 |
+
save_idsc_config(config)
|
| 25 |
+
|
| 26 |
+
def idsc_login(email, password):
|
| 27 |
+
|
| 28 |
+
json = {"email": email,
|
| 29 |
+
"pwd": password}
|
| 30 |
+
|
| 31 |
+
login_resp = requests.post(
|
| 32 |
+
'https://idsc.com.sg/user/login',
|
| 33 |
+
json=json )
|
| 34 |
+
|
| 35 |
+
if login_resp.status_code == 200:
|
| 36 |
+
apikey = login_resp.json()["API_key"]
|
| 37 |
+
return apikey
|
| 38 |
+
else:
|
| 39 |
+
raise Exception(login_resp.json())
|
| 40 |
+
|
src/apis/inventory.py
ADDED
|
File without changes
|
src/demo_data/example_inventory.csv
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
SKU,demand,price,cost,space_per_unit,budgetary_cost,replenishment_rate
|
| 2 |
+
Item_A,1262,50,11,1.5,10,0.1
|
| 3 |
+
Item_B,68,120,19,3,20,0.1
|
| 4 |
+
Item_C,179,60,9.5,5,10,0.1
|
| 5 |
+
Item_D,516,10,8,2,8,0.1
|
| 6 |
+
Item_E,563,30,13,1,15,0.1
|
src/demo_data/example_rm.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
SKU,demand,price,cost,space_per_unit,budgetary_cost,replenishment_rate
|
| 2 |
+
Raw Material A,5000,2,1.1,0.5,1,0.1
|
| 3 |
+
Raw Material B,3000,3,1.9,0.2,2,0.1
|
src/demo_data/example_wip.csv
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
SKU,demand,price,cost,space_per_unit,replenishment_rate,budgetary_cost
|
| 2 |
+
Item C,500,3,2,1,0.1,2
|
| 3 |
+
Item B,2000,4,2,2,0.1,2
|
| 4 |
+
Item A,1500,5,3,3,0.1,3
|
src/gr/GradioApp.py
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pandas as pd
|
| 3 |
+
from ..idsc.idsc_apis import IDSC_API
|
| 4 |
+
import matplotlib.pyplot as plt
|
| 5 |
+
from .GradioFns import GradioFns
|
| 6 |
+
|
| 7 |
+
fns = GradioFns()
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class GradioApp():
|
| 11 |
+
def __init__(self):
|
| 12 |
+
# [Constents] #
|
| 13 |
+
self.inventory_input_demo_path = 'src/demo_data/example_inventory.csv'
|
| 14 |
+
self.rm_input_demo_path = 'src/demo_data/example_rm.csv'
|
| 15 |
+
self.wip_input_demo_path = 'src/demo_data/example_wip.csv'
|
| 16 |
+
|
| 17 |
+
self.idsc = IDSC_API()
|
| 18 |
+
|
| 19 |
+
# [Inventory Values] #
|
| 20 |
+
self.inventory_input_df__value = pd.DataFrame()
|
| 21 |
+
self.inv_recom_df__value = pd.DataFrame()
|
| 22 |
+
|
| 23 |
+
self.inventory_storage_capacity__value = 0
|
| 24 |
+
self.inventory_budget_constraint__value = 0
|
| 25 |
+
|
| 26 |
+
self.inv_total_profit_md__val = 0
|
| 27 |
+
self.inv_total_capacity_usage_md__val = 0
|
| 28 |
+
self.inv_total_budget_usage_md__val = 0
|
| 29 |
+
self.inv_total_margin_md__val = 0
|
| 30 |
+
|
| 31 |
+
self.inv_plot__fig = plt.plot()
|
| 32 |
+
|
| 33 |
+
# [Raw Inventory Values] #
|
| 34 |
+
self.rm_input_df__value = pd.DataFrame()
|
| 35 |
+
self.rm_recom_df__value = pd.DataFrame()
|
| 36 |
+
|
| 37 |
+
self.rm_storage_capacity__value = 0
|
| 38 |
+
self.rm_budget_constraint__value = 0
|
| 39 |
+
|
| 40 |
+
self.rm_total_capacity_usage_md__val = 0
|
| 41 |
+
self.rm_total_budget_usage_md__val = 0
|
| 42 |
+
|
| 43 |
+
# [WIP Inventory Values] #
|
| 44 |
+
self.wip_input_df__value = pd.DataFrame()
|
| 45 |
+
self.wip_recom_df__value = pd.DataFrame()
|
| 46 |
+
|
| 47 |
+
self.wip_storage_capacity__value = 0
|
| 48 |
+
self.wip_budget_constraint__value = 0
|
| 49 |
+
|
| 50 |
+
self.wip_total_capacity_usage_md__val = 0
|
| 51 |
+
self.wip_total_budget_usage_md__val = 0
|
| 52 |
+
|
| 53 |
+
# =============== #
|
| 54 |
+
# Event Listeners #
|
| 55 |
+
# =============== #
|
| 56 |
+
|
| 57 |
+
def demo_data_btn__click(self):
|
| 58 |
+
print('Load inventory input demo.')
|
| 59 |
+
self.inventory_input_df__value = pd.read_csv(
|
| 60 |
+
self.inventory_input_demo_path)
|
| 61 |
+
self.inventory_storage_capacity__value = 5000
|
| 62 |
+
self.inventory_budget_constraint__value = 25000
|
| 63 |
+
return (
|
| 64 |
+
self.update__inventory_input_df(),
|
| 65 |
+
self.update__inventory_storage_capacity(),
|
| 66 |
+
self.update__inventory_budget_constraint())
|
| 67 |
+
|
| 68 |
+
def inventory_file__upload(self, file):
|
| 69 |
+
self.inventory_input_df__value = pd.read_csv(file.name)
|
| 70 |
+
return self.update__inventory_input_df()
|
| 71 |
+
|
| 72 |
+
def inventory_storage_capacity__change(self, value):
|
| 73 |
+
self.inventory_storage_capacity__value = value
|
| 74 |
+
|
| 75 |
+
def inventory_budget_constraint__change(self, value):
|
| 76 |
+
self.inventory_budget_constraint__value = value
|
| 77 |
+
|
| 78 |
+
def inventory_btn__click(self):
|
| 79 |
+
inventory_input_df = self.inventory_input_df__value
|
| 80 |
+
|
| 81 |
+
self.idsc.product_mix(
|
| 82 |
+
inventory_input_df.to_json(),
|
| 83 |
+
self.inventory_storage_capacity__value,
|
| 84 |
+
self.inventory_budget_constraint__value)
|
| 85 |
+
|
| 86 |
+
self.__update_inventory_res()
|
| 87 |
+
|
| 88 |
+
return (
|
| 89 |
+
self.update__inv_recom_df(),
|
| 90 |
+
self.update__inv_total_profit_md(),
|
| 91 |
+
self.update__inv_total_capacity_usage_md(),
|
| 92 |
+
self.update__inv_total_budget_usage_md(),
|
| 93 |
+
self.update__inv_total_margin_md(),
|
| 94 |
+
self.update__inv_plot())
|
| 95 |
+
|
| 96 |
+
def __update_inventory_res(self):
|
| 97 |
+
if self.idsc.product_mix__res:
|
| 98 |
+
# API call success
|
| 99 |
+
res = self.idsc.product_mix__res
|
| 100 |
+
print(res)
|
| 101 |
+
self.inv_recom_df__value = fns.format__inv_recom_df(
|
| 102 |
+
self.idsc.get_product_mix_recommendations_df(),
|
| 103 |
+
self.inventory_input_df__value)
|
| 104 |
+
|
| 105 |
+
self.inv_total_profit_md__val = res['total_profit']
|
| 106 |
+
self.inv_total_capacity_usage_md__val = res['total_capacity_usage']
|
| 107 |
+
self.inv_total_budget_usage_md__val = res['total_budget_usage']
|
| 108 |
+
self.inv_total_margin_md__val = \
|
| 109 |
+
round((res['total_profit'] - res['total_budget_usage']
|
| 110 |
+
) / res['total_profit'] * 100, 2)
|
| 111 |
+
|
| 112 |
+
self.inv_plot__fig = fns.plot__inv_res(
|
| 113 |
+
res,
|
| 114 |
+
self.inventory_storage_capacity__value,
|
| 115 |
+
self.inventory_budget_constraint__value,
|
| 116 |
+
self.inv_recom_df__value)
|
| 117 |
+
|
| 118 |
+
else:
|
| 119 |
+
self.inv_recom_df__value = pd.DataFrame()
|
| 120 |
+
|
| 121 |
+
self.inv_total_profit_md__val = '-'
|
| 122 |
+
self.inv_total_capacity_usage_md__val = '-'
|
| 123 |
+
self.inv_total_budget_usage_md__val = '-'
|
| 124 |
+
self.inv_total_margin_md__val = '-'
|
| 125 |
+
|
| 126 |
+
self.inv_plot__fig = plt.plot()
|
| 127 |
+
|
| 128 |
+
# ======== #
|
| 129 |
+
# Updaters #
|
| 130 |
+
# ======== #
|
| 131 |
+
|
| 132 |
+
def update__inventory_input_df(self):
|
| 133 |
+
return gr.Dataframe.update(
|
| 134 |
+
value=self.inventory_input_df__value)
|
| 135 |
+
|
| 136 |
+
def update__inv_recom_df(self):
|
| 137 |
+
return gr.Dataframe.update(
|
| 138 |
+
value=self.inv_recom_df__value)
|
| 139 |
+
|
| 140 |
+
def update__inventory_storage_capacity(self):
|
| 141 |
+
return gr.Number.update(
|
| 142 |
+
value=self.inventory_storage_capacity__value)
|
| 143 |
+
|
| 144 |
+
def update__inventory_budget_constraint(self):
|
| 145 |
+
return gr.Number.update(
|
| 146 |
+
value=self.inventory_budget_constraint__value)
|
| 147 |
+
|
| 148 |
+
def update__inv_total_profit_md(self):
|
| 149 |
+
return gr.Markdown.update(
|
| 150 |
+
value=f'### Total Profit: \n # {self.inv_total_profit_md__val:,}')
|
| 151 |
+
|
| 152 |
+
def update__inv_total_capacity_usage_md(self):
|
| 153 |
+
return gr.Markdown.update(
|
| 154 |
+
value=f'### Total Capacity Usage: \n # {self.inv_total_capacity_usage_md__val:,}')
|
| 155 |
+
|
| 156 |
+
def update__inv_total_budget_usage_md(self):
|
| 157 |
+
return gr.Markdown.update(
|
| 158 |
+
value=f'### Total Budget Usage: \n # {self.inv_total_budget_usage_md__val:,}')
|
| 159 |
+
|
| 160 |
+
def update__inv_total_margin_md(self):
|
| 161 |
+
return gr.Markdown.update(
|
| 162 |
+
value=f'### Total Margin: \n # {self.inv_total_margin_md__val}%')
|
| 163 |
+
|
| 164 |
+
def update__inv_plot(self):
|
| 165 |
+
return gr.Plot.update(value=self.inv_plot__fig)
|
| 166 |
+
|
| 167 |
+
# ============================ #
|
| 168 |
+
# Raw Material Event Listeners #
|
| 169 |
+
# ============================ #
|
| 170 |
+
|
| 171 |
+
def rm_demo_data_btn__click(self):
|
| 172 |
+
print('Load raw material input demo.')
|
| 173 |
+
self.rm_input_df__value = pd.read_csv(
|
| 174 |
+
self.rm_input_demo_path)
|
| 175 |
+
self.rm_storage_capacity__value = 4000
|
| 176 |
+
self.rm_budget_constraint__value = 10000
|
| 177 |
+
return (
|
| 178 |
+
self.update__rm_input_df(),
|
| 179 |
+
self.update__rm_storage_capacity(),
|
| 180 |
+
self.update__rm_budget_constraint())
|
| 181 |
+
|
| 182 |
+
def rm_file__upload(self, file):
|
| 183 |
+
self.rm_input_df__value = pd.read_csv(file.name)
|
| 184 |
+
return self.update__rm_input_df()
|
| 185 |
+
|
| 186 |
+
def rm_storage_capacity__change(self, value):
|
| 187 |
+
self.rm_storage_capacity__value = value
|
| 188 |
+
|
| 189 |
+
def rm_budget_constraint__change(self, value):
|
| 190 |
+
self.rm_budget_constraint__value = value
|
| 191 |
+
|
| 192 |
+
def rm_btn__click(self):
|
| 193 |
+
self.idsc.product_mix(
|
| 194 |
+
self.rm_input_df__value.to_json(),
|
| 195 |
+
self.rm_storage_capacity__value,
|
| 196 |
+
self.rm_budget_constraint__value)
|
| 197 |
+
|
| 198 |
+
self.__update_rm_res()
|
| 199 |
+
|
| 200 |
+
return (
|
| 201 |
+
self.update__rm_recom_df(),
|
| 202 |
+
self.update__rm_total_capacity_usage_md(),
|
| 203 |
+
self.update__rm_total_budget_usage_md(),
|
| 204 |
+
self.update__rm_plot())
|
| 205 |
+
|
| 206 |
+
def __update_rm_res(self):
|
| 207 |
+
if self.idsc.product_mix__res:
|
| 208 |
+
res = self.idsc.product_mix__res
|
| 209 |
+
|
| 210 |
+
self.rm_recom_df__value = fns.format__inv_recom_df(
|
| 211 |
+
self.idsc.get_product_mix_recommendations_df(),
|
| 212 |
+
self.rm_input_df__value
|
| 213 |
+
)
|
| 214 |
+
self.rm_total_capacity_usage_md__val = res['total_capacity_usage']
|
| 215 |
+
self.rm_total_budget_usage_md__val = res['total_budget_usage']
|
| 216 |
+
|
| 217 |
+
self.rm_plot__fig = fns.plot__rm_res(
|
| 218 |
+
res,
|
| 219 |
+
self.rm_storage_capacity__value,
|
| 220 |
+
self.rm_budget_constraint__value,
|
| 221 |
+
self.rm_recom_df__value)
|
| 222 |
+
|
| 223 |
+
else:
|
| 224 |
+
self.rm_recom_df__value = pd.DataFrame()
|
| 225 |
+
self.rm_total_capacity_usage_md__val = '-'
|
| 226 |
+
self.rm_total_budget_usage_md__val = '-'
|
| 227 |
+
|
| 228 |
+
self.rm_plot__fig = plt.plot()
|
| 229 |
+
|
| 230 |
+
# ===================== #
|
| 231 |
+
# Raw Material Updaters #
|
| 232 |
+
# ===================== #
|
| 233 |
+
|
| 234 |
+
def update__rm_input_df(self):
|
| 235 |
+
|
| 236 |
+
df = self.rm_input_df__value.rename(
|
| 237 |
+
columns={'price': 'transfer price'})
|
| 238 |
+
# df = df.drop(columns=['replenishment_rate'])
|
| 239 |
+
|
| 240 |
+
return gr.Dataframe.update(
|
| 241 |
+
value=df)
|
| 242 |
+
|
| 243 |
+
def update__rm_recom_df(self):
|
| 244 |
+
df = self.rm_recom_df__value.rename(
|
| 245 |
+
columns={'price': 'transfer price'})
|
| 246 |
+
df = df.drop(columns=['potential_lost_sales', 'expected_sales',
|
| 247 |
+
'soldout_probability', 'revenue', 'margin (%)'])
|
| 248 |
+
return gr.Dataframe.update(
|
| 249 |
+
value=df)
|
| 250 |
+
|
| 251 |
+
def update__rm_storage_capacity(self):
|
| 252 |
+
return gr.Number.update(
|
| 253 |
+
value=self.rm_storage_capacity__value)
|
| 254 |
+
|
| 255 |
+
def update__rm_budget_constraint(self):
|
| 256 |
+
return gr.Number.update(
|
| 257 |
+
value=self.rm_budget_constraint__value)
|
| 258 |
+
|
| 259 |
+
def update__rm_total_capacity_usage_md(self):
|
| 260 |
+
return gr.Markdown.update(
|
| 261 |
+
value=f'### Total Capacity Usage: \n # {self.rm_total_capacity_usage_md__val:,}')
|
| 262 |
+
|
| 263 |
+
def update__rm_total_budget_usage_md(self):
|
| 264 |
+
return gr.Markdown.update(
|
| 265 |
+
value=f'### Total Budget Usage: \n # {self.rm_total_budget_usage_md__val:,}')
|
| 266 |
+
|
| 267 |
+
def update__rm_plot(self):
|
| 268 |
+
return gr.Plot.update(value=self.rm_plot__fig)
|
| 269 |
+
|
| 270 |
+
# =================== #
|
| 271 |
+
# WIP Event Listeners #
|
| 272 |
+
# =================== #
|
| 273 |
+
|
| 274 |
+
def wip_demo_data_btn__click(self):
|
| 275 |
+
print('Load raw material input demo.')
|
| 276 |
+
self.wip_input_df__value = pd.read_csv(
|
| 277 |
+
self.wip_input_demo_path)
|
| 278 |
+
self.wip_storage_capacity__value = 13000
|
| 279 |
+
self.wip_budget_constraint__value = 14000
|
| 280 |
+
|
| 281 |
+
return (
|
| 282 |
+
self.update__wip_input_df(),
|
| 283 |
+
self.update__wip_storage_capacity(),
|
| 284 |
+
self.update__wip_budget_constraint())
|
| 285 |
+
|
| 286 |
+
def wip_file__upload(self, file):
|
| 287 |
+
self.wip_input_df__value = pd.read_csv(file.name)
|
| 288 |
+
return self.update__wip_input_df()
|
| 289 |
+
|
| 290 |
+
def wip_storage_capacity__change(self, value):
|
| 291 |
+
self.wip_storage_capacity__value = value
|
| 292 |
+
|
| 293 |
+
def wip_budget_constraint__change(self, value):
|
| 294 |
+
self.wip_budget_constraint__value = value
|
| 295 |
+
|
| 296 |
+
def wip_btn__click(self):
|
| 297 |
+
|
| 298 |
+
self.idsc.product_mix(
|
| 299 |
+
self.wip_input_df__value.to_json(),
|
| 300 |
+
self.wip_storage_capacity__value,
|
| 301 |
+
self.wip_budget_constraint__value)
|
| 302 |
+
|
| 303 |
+
self.__update_wip_res()
|
| 304 |
+
|
| 305 |
+
return (
|
| 306 |
+
self.update__wip_recom_df(),
|
| 307 |
+
self.update__wip_total_capacity_usage_md(),
|
| 308 |
+
self.update__wip_total_budget_usage_md(),
|
| 309 |
+
self.update__wip_plot())
|
| 310 |
+
|
| 311 |
+
def __update_wip_res(self):
|
| 312 |
+
if self.idsc.product_mix__res:
|
| 313 |
+
res = self.idsc.product_mix__res
|
| 314 |
+
|
| 315 |
+
print('__update_wip_res')
|
| 316 |
+
print(res)
|
| 317 |
+
|
| 318 |
+
self.wip_recom_df__value = fns.format__inv_recom_df(
|
| 319 |
+
self.idsc.get_product_mix_recommendations_df(),
|
| 320 |
+
self.wip_input_df__value
|
| 321 |
+
)
|
| 322 |
+
self.wip_total_capacity_usage_md__val = res['total_capacity_usage']
|
| 323 |
+
self.wip_total_budget_usage_md__val = res['total_budget_usage']
|
| 324 |
+
|
| 325 |
+
self.wip_plot__fig = fns.plot__wip_res(
|
| 326 |
+
res,
|
| 327 |
+
self.wip_storage_capacity__value,
|
| 328 |
+
self.wip_budget_constraint__value,
|
| 329 |
+
self.wip_recom_df__value)
|
| 330 |
+
|
| 331 |
+
else:
|
| 332 |
+
self.wip_recom_df__value = pd.DataFrame()
|
| 333 |
+
self.wip_total_capacity_usage_md__val = '-'
|
| 334 |
+
self.wip_total_budget_usage_md__val = '-'
|
| 335 |
+
|
| 336 |
+
self.wip_plot__fig = plt.plot()
|
| 337 |
+
|
| 338 |
+
# ============ #
|
| 339 |
+
# WIP Updaters #
|
| 340 |
+
# ============ #
|
| 341 |
+
|
| 342 |
+
def update__wip_input_df(self):
|
| 343 |
+
|
| 344 |
+
df = self.wip_input_df__value.rename(
|
| 345 |
+
columns={'price': 'transfer price'})
|
| 346 |
+
# df = df.drop(columns=['replenishment_rate', 'budgetary_cost'])
|
| 347 |
+
|
| 348 |
+
return gr.Dataframe.update(
|
| 349 |
+
value=df)
|
| 350 |
+
|
| 351 |
+
def update__wip_recom_df(self):
|
| 352 |
+
df = self.wip_recom_df__value.rename(
|
| 353 |
+
columns={'price': 'transfer price', 'inventory_level': 'WIP'})
|
| 354 |
+
df = df.drop(columns=['potential_lost_sales', 'expected_sales',
|
| 355 |
+
'soldout_probability', 'revenue', 'margin (%)'])
|
| 356 |
+
return gr.Dataframe.update(
|
| 357 |
+
value=df)
|
| 358 |
+
|
| 359 |
+
def update__wip_storage_capacity(self):
|
| 360 |
+
return gr.Number.update(
|
| 361 |
+
value=self.wip_storage_capacity__value)
|
| 362 |
+
|
| 363 |
+
def update__wip_budget_constraint(self):
|
| 364 |
+
return gr.Number.update(
|
| 365 |
+
value=self.wip_budget_constraint__value)
|
| 366 |
+
|
| 367 |
+
def update__wip_total_capacity_usage_md(self):
|
| 368 |
+
return gr.Markdown.update(
|
| 369 |
+
value=f'### Total Capacity Usage: \n # {self.wip_total_capacity_usage_md__val:,}')
|
| 370 |
+
|
| 371 |
+
def update__wip_total_budget_usage_md(self):
|
| 372 |
+
return gr.Markdown.update(
|
| 373 |
+
value=f'### Total Budget Usage: \n # {self.wip_total_budget_usage_md__val:,}')
|
| 374 |
+
|
| 375 |
+
def update__wip_plot(self):
|
| 376 |
+
return gr.Plot.update(value=self.wip_plot__fig)
|
src/gr/GradioFns.py
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import matplotlib.pyplot as plt
|
| 2 |
+
|
| 3 |
+
plt.rcParams['font.size'] = '18'
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class GradioFns():
|
| 7 |
+
def __init__(self) -> None:
|
| 8 |
+
pass
|
| 9 |
+
|
| 10 |
+
def format__inv_recom_df(self, inv_recom_df, inv_input_df):
|
| 11 |
+
inv_recom_df_cp = inv_recom_df.copy()
|
| 12 |
+
|
| 13 |
+
inv_recom_df_cp['revenue'] = 0
|
| 14 |
+
inv_recom_df_cp['cost'] = 0
|
| 15 |
+
# inv_recom_df_cp['margin'] = 0
|
| 16 |
+
inv_recom_df_cp['margin (%)'] = 0
|
| 17 |
+
inv_recom_df_cp['space_usage'] = 0
|
| 18 |
+
|
| 19 |
+
for i, row in inv_recom_df_cp.iterrows():
|
| 20 |
+
# print('row', row)
|
| 21 |
+
sku = row['SKU']
|
| 22 |
+
|
| 23 |
+
cost = float(inv_input_df[inv_input_df['SKU'] == sku]['cost'])
|
| 24 |
+
price = float(inv_input_df[inv_input_df['SKU'] == sku]['price'])
|
| 25 |
+
space = float(inv_input_df[inv_input_df['SKU']
|
| 26 |
+
== sku]['space_per_unit'])
|
| 27 |
+
margin = float(row['expected_sales'] * (price - cost))
|
| 28 |
+
|
| 29 |
+
revenue = row['expected_sales'] * price
|
| 30 |
+
|
| 31 |
+
inv_recom_df_cp.at[i, 'revenue'] = revenue
|
| 32 |
+
inv_recom_df_cp.at[i, 'cost'] = row['expected_sales'] * cost
|
| 33 |
+
|
| 34 |
+
# inv_recom_df_cp.at[i, 'margin'] = margin
|
| 35 |
+
|
| 36 |
+
if revenue > 0:
|
| 37 |
+
inv_recom_df_cp.at[i, 'margin (%)'] = round(
|
| 38 |
+
(margin / revenue) * 100, 2)
|
| 39 |
+
inv_recom_df_cp.at[i,
|
| 40 |
+
'space_usage'] = row['expected_sales'] * space
|
| 41 |
+
|
| 42 |
+
return inv_recom_df_cp
|
| 43 |
+
|
| 44 |
+
def plot__inv_res(self, inv_res, storage, budget, inv_recom_df):
|
| 45 |
+
|
| 46 |
+
fig, ax = plt.subplots(1, 3, figsize=(24, 7))
|
| 47 |
+
|
| 48 |
+
space_left = storage - inv_res['total_capacity_usage']
|
| 49 |
+
|
| 50 |
+
space_left = 0 if space_left < 0 else space_left
|
| 51 |
+
|
| 52 |
+
space_labels = [
|
| 53 |
+
f'{row["SKU"]}\n{row["space_usage"]}' for idx, row in inv_recom_df.iterrows()]
|
| 54 |
+
|
| 55 |
+
ax[0].pie([space_left] + inv_recom_df['space_usage'].tolist(),
|
| 56 |
+
labels=[
|
| 57 |
+
f'Storage Left\n{ int(space_left)}'] + space_labels,
|
| 58 |
+
autopct='%.0f%%')
|
| 59 |
+
|
| 60 |
+
cost_left = budget - inv_res['total_budget_usage']
|
| 61 |
+
cost_left = 0 if cost_left < 0 else cost_left
|
| 62 |
+
cost_labels = [
|
| 63 |
+
f'{row["SKU"]}\n{row["cost"]}' for idx, row in inv_recom_df.iterrows()]
|
| 64 |
+
|
| 65 |
+
ax[1].pie([cost_left] + inv_recom_df['cost'].tolist(),
|
| 66 |
+
labels=[f'Budget Left\n{int(cost_left)}'] + cost_labels,
|
| 67 |
+
autopct='%.0f%%')
|
| 68 |
+
ax[2].bar(inv_recom_df['SKU'],
|
| 69 |
+
inv_recom_df['inventory_level'], width=0.3)
|
| 70 |
+
|
| 71 |
+
ax[0].set_title('Forecasted Storage Space Usage')
|
| 72 |
+
ax[1].set_title('Costs')
|
| 73 |
+
ax[2].set_title('Forecasted Inventory Level')
|
| 74 |
+
|
| 75 |
+
fig.tight_layout()
|
| 76 |
+
return fig
|
| 77 |
+
|
| 78 |
+
def plot__rm_res(self, inv_res, storage, budget, inv_recom_df):
|
| 79 |
+
|
| 80 |
+
fig, ax = plt.subplots(1, 3, figsize=(24, 7))
|
| 81 |
+
|
| 82 |
+
space_left = storage - inv_res['total_capacity_usage']
|
| 83 |
+
|
| 84 |
+
space_left = 0 if space_left < 0 else space_left
|
| 85 |
+
|
| 86 |
+
space_labels = [
|
| 87 |
+
f'{row["SKU"]}\n{row["space_usage"]}' for idx, row in inv_recom_df.iterrows()]
|
| 88 |
+
|
| 89 |
+
ax[0].pie([space_left] + inv_recom_df['space_usage'].tolist(),
|
| 90 |
+
labels=[
|
| 91 |
+
f'Storage Left\n{ int(space_left)}'] + space_labels,
|
| 92 |
+
autopct='%.0f%%')
|
| 93 |
+
|
| 94 |
+
cost_left = budget - inv_res['total_budget_usage']
|
| 95 |
+
cost_left = 0 if cost_left < 0 else cost_left
|
| 96 |
+
cost_labels = [
|
| 97 |
+
f'{row["SKU"]}\n{row["cost"]}' for idx, row in inv_recom_df.iterrows()]
|
| 98 |
+
|
| 99 |
+
ax[1].pie([cost_left] + inv_recom_df['cost'].tolist(),
|
| 100 |
+
labels=[f'Budget Left\n{int(cost_left)}'] + cost_labels,
|
| 101 |
+
autopct='%.0f%%')
|
| 102 |
+
ax[2].bar(inv_recom_df['SKU'],
|
| 103 |
+
inv_recom_df['inventory_level'], width=0.3)
|
| 104 |
+
|
| 105 |
+
ax[0].set_title('Forecasted Storage Space Usage')
|
| 106 |
+
ax[1].set_title('Raw Material Costs')
|
| 107 |
+
ax[2].set_title('Forecasted Raw Material Inventory Level')
|
| 108 |
+
|
| 109 |
+
fig.tight_layout()
|
| 110 |
+
return fig
|
| 111 |
+
|
| 112 |
+
def plot__wip_res(self, inv_res, storage, budget, inv_recom_df):
|
| 113 |
+
|
| 114 |
+
fig, ax = plt.subplots(1, 3, figsize=(24, 7))
|
| 115 |
+
|
| 116 |
+
space_left = storage - inv_res['total_capacity_usage']
|
| 117 |
+
|
| 118 |
+
space_left = 0 if space_left < 0 else space_left
|
| 119 |
+
|
| 120 |
+
space_labels = [
|
| 121 |
+
f'{row["SKU"]}\n{row["space_usage"]}' for idx, row in inv_recom_df.iterrows()]
|
| 122 |
+
|
| 123 |
+
ax[0].pie([space_left] + inv_recom_df['space_usage'].tolist(),
|
| 124 |
+
labels=[
|
| 125 |
+
f'Capacity Left\n{ int(space_left)}'] + space_labels,
|
| 126 |
+
autopct='%.0f%%')
|
| 127 |
+
|
| 128 |
+
cost_left = budget - inv_res['total_budget_usage']
|
| 129 |
+
cost_left = 0 if cost_left < 0 else cost_left
|
| 130 |
+
cost_labels = [
|
| 131 |
+
f'{row["SKU"]}\n{row["cost"]}' for idx, row in inv_recom_df.iterrows()]
|
| 132 |
+
|
| 133 |
+
ax[1].pie([cost_left] + inv_recom_df['cost'].tolist(),
|
| 134 |
+
labels=[f'Budget Left\n{int(cost_left)}'] + cost_labels,
|
| 135 |
+
autopct='%.0f%%')
|
| 136 |
+
ax[2].bar(inv_recom_df['SKU'],
|
| 137 |
+
inv_recom_df['inventory_level'], width=0.3)
|
| 138 |
+
|
| 139 |
+
ax[0].set_title('Forecasted WIP Capacity Usage')
|
| 140 |
+
ax[1].set_title('WIP Costs')
|
| 141 |
+
ax[2].set_title('WIP Level')
|
| 142 |
+
|
| 143 |
+
fig.tight_layout()
|
| 144 |
+
return fig
|
src/gr/__init__.py
ADDED
|
File without changes
|
src/gr/__pycache__/GradioApp.cpython-310.pyc
ADDED
|
Binary file (10.7 kB). View file
|
|
|
src/gr/__pycache__/GradioFns.cpython-310.pyc
ADDED
|
Binary file (3.34 kB). View file
|
|
|
src/gr/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (181 Bytes). View file
|
|
|
src/gr/__pycache__/gr_args.cpython-310.pyc
ADDED
|
Binary file (2.23 kB). View file
|
|
|
src/gr/gr_args.py
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
|
| 3 |
+
main_block = {
|
| 4 |
+
'css': '''
|
| 5 |
+
footer {visibility: hidden}
|
| 6 |
+
|
| 7 |
+
/* Modify the forecast button size */
|
| 8 |
+
.btn {width: 260px !important; margin: auto !important}
|
| 9 |
+
'''
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
inventory_md = {
|
| 13 |
+
'value': """
|
| 14 |
+
# Finishend Goods Optimization
|
| 15 |
+
- Data must contains column 'SKU', 'demand', 'price', 'cost', 'space_per_unit', 'budgetary_cost'
|
| 16 |
+
- Optional column : 'replenishment_rate'
|
| 17 |
+
- Fill in "Finishend Goods Storage Capacity" and "Finished Goods Budget" before Optimize Inventory
|
| 18 |
+
"""
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
rm_md = {
|
| 22 |
+
'value': """
|
| 23 |
+
# Raw Material Optimization
|
| 24 |
+
Optimize raw material purchasing based on the allocated storage space and purchase budget.
|
| 25 |
+
"""
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
wip_md = {
|
| 29 |
+
'value': """
|
| 30 |
+
# WIP Optimization
|
| 31 |
+
Optimize working in progress items based on the production space and production budget.
|
| 32 |
+
"""
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
demo_data_btn = {
|
| 37 |
+
'value': 'Load Demo Dataset',
|
| 38 |
+
'elem_classes': 'btn'
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
rm_demo_data_btn = {
|
| 42 |
+
'value': 'Load Demo Dataset',
|
| 43 |
+
'elem_classes': 'btn'
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
wip_demo_data_btn = {
|
| 47 |
+
'value': 'Load Demo Dataset',
|
| 48 |
+
'elem_classes': 'btn'
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
inventory_btn = {
|
| 52 |
+
'value': 'Optimize Inventory',
|
| 53 |
+
'elem_classes': 'btn',
|
| 54 |
+
'variant': 'primary',
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
rm_btn = {
|
| 58 |
+
'value': 'Optimize Raw Material Inventory',
|
| 59 |
+
'elem_classes': 'btn',
|
| 60 |
+
'variant': 'primary',
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
wip_btn = {
|
| 64 |
+
'value': 'Optimize WIP Inventory',
|
| 65 |
+
'elem_classes': 'btn',
|
| 66 |
+
'variant': 'primary',
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
#
|
| 70 |
+
# File Inputs
|
| 71 |
+
|
| 72 |
+
inventory_file = {
|
| 73 |
+
'file_types': ['.csv'],
|
| 74 |
+
'label': 'Finishend Goods Demand Data'
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
rm_file = {
|
| 78 |
+
'file_types': ['.csv'],
|
| 79 |
+
'label': 'Raw Material Demand Data'
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
wip_file = {
|
| 83 |
+
'file_types': ['.csv'],
|
| 84 |
+
'label': 'Working In Progress Data'
|
| 85 |
+
}
|
| 86 |
+
# ======= #
|
| 87 |
+
# Numbers #
|
| 88 |
+
# ======= #
|
| 89 |
+
inventory_storage_capacity = {
|
| 90 |
+
'label': 'FG Storage Capacity',
|
| 91 |
+
'interactive': True}
|
| 92 |
+
|
| 93 |
+
inventory_budget_constraint = {
|
| 94 |
+
'label': 'FG Budget',
|
| 95 |
+
'interactive': True}
|
| 96 |
+
|
| 97 |
+
rm_storage_capacity = {
|
| 98 |
+
'label': 'Raw Material Storage Capacity',
|
| 99 |
+
'interactive': True}
|
| 100 |
+
|
| 101 |
+
rm_budget_constraint = {
|
| 102 |
+
'label': 'Raw Material Budget',
|
| 103 |
+
'interactive': True}
|
| 104 |
+
|
| 105 |
+
wip_storage_capacity = {
|
| 106 |
+
'label': 'WIP Capacity',
|
| 107 |
+
'interactive': True}
|
| 108 |
+
|
| 109 |
+
wip_budget_constraint = {
|
| 110 |
+
'label': 'WIP Budget',
|
| 111 |
+
'interactive': True}
|
| 112 |
+
|
| 113 |
+
# =========== #
|
| 114 |
+
# Data Frames #
|
| 115 |
+
# =========== #
|
| 116 |
+
inventory_input_df = {
|
| 117 |
+
'value': pd.DataFrame(columns=['SKU', 'demand', 'price', 'cost', 'space_per_unit', 'budgetary_cost']),
|
| 118 |
+
'label': 'Inventory Optimization Input',
|
| 119 |
+
'height': 300,
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
rm_input_df = {
|
| 123 |
+
'value': pd.DataFrame(columns=['SKU', 'demand', 'price', 'cost']),
|
| 124 |
+
'label': 'Inventory Optimization Input',
|
| 125 |
+
'height': 300,
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
wip_input_df = {
|
| 129 |
+
'value': pd.DataFrame(columns=['SKU', 'demand', 'space_per_unit']),
|
| 130 |
+
'label': 'Inventory Optimization Input',
|
| 131 |
+
'height': 300,
|
| 132 |
+
}
|
src/idsc/__pycache__/idsc_apis.cpython-310.pyc
ADDED
|
Binary file (3.48 kB). View file
|
|
|
src/idsc/idsc_apis.py
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import yaml
|
| 2 |
+
import requests
|
| 3 |
+
import os
|
| 4 |
+
import pandas as pd
|
| 5 |
+
|
| 6 |
+
from datetime import datetime, timedelta
|
| 7 |
+
from dotenv import load_dotenv
|
| 8 |
+
load_dotenv()
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class IDSC_API():
|
| 12 |
+
'''
|
| 13 |
+
Wrapper class for all IDSC apis
|
| 14 |
+
'''
|
| 15 |
+
|
| 16 |
+
def __init__(self):
|
| 17 |
+
__location__ = os.path.realpath(
|
| 18 |
+
os.path.join(os.getcwd(), os.path.dirname(__file__)))
|
| 19 |
+
|
| 20 |
+
self.config_path = os.path.join(__location__, 'idsc_config.yaml')
|
| 21 |
+
self.logged_in = False
|
| 22 |
+
self.timeformat = '%m/%d/%Y, %H:%M:%S'
|
| 23 |
+
with open(self.config_path, 'r') as file:
|
| 24 |
+
self.config = yaml.safe_load(file)
|
| 25 |
+
|
| 26 |
+
self.expire = self.config['apikey_expire']
|
| 27 |
+
self.apikey = self.config['apikey']
|
| 28 |
+
|
| 29 |
+
self.login()
|
| 30 |
+
|
| 31 |
+
self.product_mix__res = None # Save product_mix api response
|
| 32 |
+
|
| 33 |
+
def login(self):
|
| 34 |
+
|
| 35 |
+
now = datetime.now()
|
| 36 |
+
expire_date = datetime.strptime(self.expire, self.timeformat)
|
| 37 |
+
|
| 38 |
+
if now >= expire_date:
|
| 39 |
+
print('apikey expired, requesting new one.')
|
| 40 |
+
self.apikey = self.fetch_apikey()
|
| 41 |
+
self.update_config()
|
| 42 |
+
else:
|
| 43 |
+
print('apikey still available, logged in')
|
| 44 |
+
|
| 45 |
+
self.logged_in = True
|
| 46 |
+
|
| 47 |
+
def fetch_apikey(self):
|
| 48 |
+
# print(os.environ)
|
| 49 |
+
json = {
|
| 50 |
+
# "email": self.config['email'],
|
| 51 |
+
# "pwd": self.config['password']
|
| 52 |
+
'email': os.getenv('IDSC_ACC'),
|
| 53 |
+
'pwd': os.getenv('IDSC_PASS')
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
print('IDSC Logging in ...')
|
| 57 |
+
login_resp = requests.post(
|
| 58 |
+
'https://idsc.com.sg/user/login',
|
| 59 |
+
json=json)
|
| 60 |
+
|
| 61 |
+
if login_resp.status_code == 200:
|
| 62 |
+
apikey = login_resp.json()["API_key"]
|
| 63 |
+
return apikey
|
| 64 |
+
else:
|
| 65 |
+
raise Exception(login_resp.json())
|
| 66 |
+
|
| 67 |
+
def update_config(self):
|
| 68 |
+
now = datetime.now()
|
| 69 |
+
expire = (now + timedelta(days=3)).strftime(self.timeformat)
|
| 70 |
+
self.config['apikey'] = self.apikey
|
| 71 |
+
self.config['apikey_expire'] = expire
|
| 72 |
+
with open(self.config_path, 'w') as f:
|
| 73 |
+
yaml.dump(self.config, f, default_flow_style=False)
|
| 74 |
+
|
| 75 |
+
# =========== #
|
| 76 |
+
# Product mix #
|
| 77 |
+
# =========== #
|
| 78 |
+
|
| 79 |
+
def product_mix(
|
| 80 |
+
self,
|
| 81 |
+
product_data,
|
| 82 |
+
storage_capacity,
|
| 83 |
+
budget_constraint):
|
| 84 |
+
|
| 85 |
+
endpint = 'https://idsc.com.sg/optimax/product-mix/product-mix'
|
| 86 |
+
json = {'product_data': product_data,
|
| 87 |
+
'storage_capacity': storage_capacity,
|
| 88 |
+
'budget_constraint': budget_constraint
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
print('storage_capacity', storage_capacity)
|
| 92 |
+
print('budget_constraint', budget_constraint)
|
| 93 |
+
|
| 94 |
+
self.login()
|
| 95 |
+
|
| 96 |
+
headers = {'api-key': self.apikey}
|
| 97 |
+
|
| 98 |
+
res = requests.post(endpint, json=json, headers=headers)
|
| 99 |
+
|
| 100 |
+
parsed_res = self._parse_response(res)
|
| 101 |
+
|
| 102 |
+
self.product_mix__res = parsed_res
|
| 103 |
+
|
| 104 |
+
return self.product_mix__res
|
| 105 |
+
|
| 106 |
+
def _parse_response(self, res):
|
| 107 |
+
if res.status_code != 200:
|
| 108 |
+
print(f'API call failed. {res.text}')
|
| 109 |
+
return False
|
| 110 |
+
return res.json()
|
| 111 |
+
|
| 112 |
+
def get_product_mix_recommendations_df(self):
|
| 113 |
+
|
| 114 |
+
try:
|
| 115 |
+
recommendations = self.product_mix__res['product_mix_recommendations']
|
| 116 |
+
except Exception:
|
| 117 |
+
return None
|
| 118 |
+
|
| 119 |
+
df_arr = []
|
| 120 |
+
for k, v in recommendations.items():
|
| 121 |
+
df = pd.DataFrame(v, index=[k])
|
| 122 |
+
df['SKU'] = k
|
| 123 |
+
|
| 124 |
+
# Make sure expected sales is always integer
|
| 125 |
+
df['expected_sales'] = int(df['expected_sales'])
|
| 126 |
+
|
| 127 |
+
# Rearrange the order, so 'SKU' columns is the first
|
| 128 |
+
cols = df.columns.tolist()
|
| 129 |
+
cols = cols[-1:] + cols[:-1]
|
| 130 |
+
df = df[cols]
|
| 131 |
+
|
| 132 |
+
df_arr.append(df)
|
| 133 |
+
|
| 134 |
+
return pd.concat(df_arr, ignore_index=True)
|
src/idsc/idsc_config.yaml
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
apikey: f83c59b23ab2afbbabad60b305e00b16a46d0920
|
| 2 |
+
apikey_expire: 11/17/2023, 15:27:25
|