├── .github ├── ISSUE_TEMPLATE │ ├── backend.md │ ├── bug_report.md │ ├── devops.md │ ├── documetations.md │ ├── frontend.md │ └── general-questions.md ├── actions │ └── unit_test_ci_gallery │ │ └── action.yml └── workflows │ ├── cd_gallery.yml │ ├── cd_gallery_dev.yml │ ├── cd_manufacturing_analytics.yml │ ├── cd_manufacturing_analytics_dev.yml │ ├── cd_visualizations_consumer_analytics.yml │ ├── cd_visualizations_consumer_analytics_dev.yml │ └── new_cards.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── SUPPORT.md ├── gallery ├── Dockerfile ├── README.md ├── app │ ├── app.py │ ├── azuredeploy.json │ ├── azuredeploy.parameters.json │ ├── demo_configs │ │ ├── .order │ │ ├── consumer_analytics.yml │ │ ├── kg_search.yml │ │ ├── manufacturing_energy_optimisation.yml │ │ ├── use_case_10.yml │ │ ├── use_case_11.yml │ │ ├── use_case_12.yml │ │ ├── use_case_4.yml │ │ ├── use_case_5.yml │ │ ├── use_case_6.yml │ │ ├── use_case_7.yml │ │ ├── use_case_8.yml │ │ ├── use_case_9.yml │ │ └── verseagility.yml │ ├── requirements.txt │ ├── static │ │ ├── assets │ │ │ ├── apple-touch-icon.png │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── favicon.ico │ │ │ └── img │ │ │ │ ├── azure_icon_white.png │ │ │ │ ├── demo_screenshots │ │ │ │ ├── consumer_analytics.png │ │ │ │ ├── kg_search.png │ │ │ │ ├── manufacturing_energy_optimization.png │ │ │ │ ├── placeholder_screenshot.png │ │ │ │ └── verseagility.png │ │ │ │ ├── demo_thumbnails │ │ │ │ ├── consumer_analytics.png │ │ │ │ ├── kg_search.png │ │ │ │ ├── manufacturing_energy_optimization.png │ │ │ │ ├── use_case_10.jpg │ │ │ │ ├── use_case_3.jpg │ │ │ │ ├── use_case_4.jpg │ │ │ │ ├── use_case_5.jpg │ │ │ │ ├── use_case_6.jpg │ │ │ │ ├── use_case_7.jpg │ │ │ │ ├── use_case_8.jpg │ │ │ │ ├── use_case_9.jpg │ │ │ │ └── verseagility.png │ │ │ │ ├── ds_toolkit_logo.png │ │ │ │ ├── ds_toolkit_logo_invert.png │ │ │ │ ├── ds_toolkit_logo_square.png │ │ │ │ └── portrait_black.png │ │ ├── css │ │ │ ├── custom.css │ │ │ ├── fonts │ │ │ │ └── segoe │ │ │ │ │ ├── bold │ │ │ │ │ ├── segoeuib.eot │ │ │ │ │ ├── segoeuib.svg │ │ │ │ │ ├── segoeuib.ttf │ │ │ │ │ └── segoeuib.woff │ │ │ │ │ ├── light │ │ │ │ │ ├── segoeuil.eot │ │ │ │ │ ├── segoeuil.svg │ │ │ │ │ ├── segoeuil.ttf │ │ │ │ │ └── segoeuil.woff │ │ │ │ │ ├── semibold │ │ │ │ │ ├── seguisb.eot │ │ │ │ │ ├── seguisb.svg │ │ │ │ │ ├── seguisb.ttf │ │ │ │ │ └── seguisb.woff │ │ │ │ │ └── ui │ │ │ │ │ ├── segoeui.eot │ │ │ │ │ ├── segoeui.svg │ │ │ │ │ ├── segoeui.ttf │ │ │ │ │ └── segoeui.woff │ │ │ └── styles.css │ │ └── js │ │ │ └── scripts.js │ └── templates │ │ ├── base.html │ │ ├── gallery.html │ │ └── use_case.html ├── docs │ └── .gitkeep └── tests │ └── test_use_cases.py └── visualizations ├── consumer_analytics ├── Dockerfile ├── README.md ├── app │ ├── app.py │ ├── azuredeploy.json │ ├── azuredeploy.parameters.json │ ├── cached_data │ │ ├── churn_probability.json │ │ └── clv_data.json │ ├── requirements.txt │ ├── static │ │ ├── assets │ │ │ ├── apple-touch-icon.png │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── favicon.ico │ │ │ └── img │ │ │ │ ├── add_to_cart.png │ │ │ │ ├── add_to_cart.svg │ │ │ │ ├── customer_leaving.svg │ │ │ │ ├── ds_toolkit_logo.png │ │ │ │ ├── ds_toolkit_logo_invert.png │ │ │ │ ├── ds_toolkit_logo_square.png │ │ │ │ └── successful_purchase.svg │ │ ├── css │ │ │ └── styles.css │ │ └── js │ │ │ └── scripts.js │ └── templates │ │ ├── base.html │ │ ├── customer_analytics.html │ │ └── home.html └── docs │ └── .gitkeep └── manufacturing_analytics ├── Dockerfile ├── README.md ├── app ├── azuredeploy.json ├── config_data.toml ├── dashboard.py ├── datasets │ └── energy_consumption.csv ├── ds-toolkit-logo.png ├── list_models.pkl ├── notebooks │ ├── Data - generation.ipynb │ └── Model - training.ipynb └── requirements.txt └── docs └── .gitkeep /.github/ISSUE_TEMPLATE/backend.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Backend 3 | about: Tasks related to the backend 4 | title: "[BACKEND] **Add title**" 5 | labels: backend 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the task* 11 | A clear and concise description of what you want to happen. 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/devops.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Devops 3 | about: Tasks related to automation 4 | title: "[DEVOPS] **Add title**" 5 | labels: devops 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the task* 11 | A clear and concise description of what you want to happen. 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documetations.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation 3 | about: Tasks related to documentation 4 | title: "[DOC] **Add title**" 5 | labels: documentation 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the task* 11 | A clear and concise description of what you want to happen. 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/frontend.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Frontend 3 | about: Tasks related to the Frontend 4 | title: "[FRONTEND] **Add title**" 5 | labels: frontend 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Task description** 11 | A clear and concise description of the task 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general-questions.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: General Questions 3 | about: Ask your questions 4 | title: '' 5 | labels: question 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/actions/unit_test_ci_gallery/action.yml: -------------------------------------------------------------------------------- 1 | name: [Unit Test] Continuous Integration for gallery 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 7 | - uses: actions/checkout@v3 8 | - name: Set up Python 3.9 9 | uses: actions/setup-python@v4 10 | with: 11 | python-version: '3.9' 12 | 13 | - name: Install dependencies 14 | run: | 15 | python -m pip install --upgrade pip 16 | pip install flake8 pytest requests 17 | pip install -r gallery/app/requirements.txt 18 | 19 | - name: Test gallery 20 | run: | 21 | pytest -v ./gallery/tests/ --doctest-modules --junitxml=junit/test-results-gallery.xml 22 | 23 | - name: Upload gallery pytest test results 24 | uses: actions/upload-artifact@v3 25 | with: 26 | name: pytest-results-gallery 27 | path: junit/test-results-gallery.xml 28 | # Use always() to always run this step to publish test results when there are test failures 29 | if: ${{ always() }} -------------------------------------------------------------------------------- /.github/workflows/cd_gallery.yml: -------------------------------------------------------------------------------- 1 | name: Docker Gallery [PRO] 2 | on: 3 | push: 4 | paths: 5 | - gallery/** 6 | branches: 7 | - main 8 | jobs: 9 | Unit-Test: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v3 14 | - name: Install dependencies 15 | run: | 16 | python -m pip install --upgrade pip 17 | - name: Set up Python 3.9 18 | uses: actions/setup-python@v4 19 | with: 20 | python-version: '3.9' 21 | - name: Install dependencies 22 | run: | 23 | pip install flake8 pytest requests 24 | pip install -r ./gallery/app/requirements.txt 25 | - name: Test gallery 26 | run: | 27 | pytest -v gallery/tests/ --doctest-modules --junitxml=junit/test-results-gallery.xml 28 | - name: Upload gallery pytest test results 29 | uses: actions/upload-artifact@v3 30 | with: 31 | name: pytest-results-gallery 32 | path: junit/test-results-gallery.xml 33 | if: ${{ always() }} 34 | 35 | Build_and_Push: 36 | environment: production 37 | needs: 38 | - Unit-Test 39 | runs-on: ubuntu-latest 40 | steps: 41 | - name: Checkout 42 | uses: actions/checkout@v3 43 | - name: Set up Docker Buildx 44 | uses: docker/setup-buildx-action@v1 45 | - name: Log in to registry 46 | uses: docker/login-action@v1 47 | with: 48 | registry: ${{ secrets.REGISTRY_LOGIN_SERVER }} 49 | username: ${{ secrets.REGISTRY_USERNAME }} 50 | password: ${{ secrets.REGISTRY_PASSWORD }} 51 | - name: Install dependencies 52 | run: | 53 | python -m pip install --upgrade pip 54 | - name: Build and push 55 | uses: docker/build-push-action@v2 56 | with: 57 | context: ./gallery 58 | file: ./gallery/Dockerfile 59 | builder: ${{ steps.buildx.outputs.name }} 60 | push: true 61 | tags: acrdstoolkitdemowepro.azurecr.io/dstoolkitaiux:latest -------------------------------------------------------------------------------- /.github/workflows/cd_gallery_dev.yml: -------------------------------------------------------------------------------- 1 | name: Docker Gallery [DEV] 2 | on: 3 | push: 4 | paths: 5 | - gallery/** 6 | branches: 7 | - develop 8 | # workflow_dispatch: 9 | jobs: 10 | Unit-Test: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v3 15 | - name: Install dependencies 16 | run: | 17 | python -m pip install --upgrade pip 18 | - name: Set up Python 3.9 19 | uses: actions/setup-python@v4 20 | with: 21 | python-version: '3.9' 22 | - name: Install dependencies 23 | run: | 24 | pip install flake8 pytest requests 25 | pip install -r ./gallery/app/requirements.txt 26 | - name: Test gallery 27 | run: | 28 | pytest -v gallery/tests/ --doctest-modules --junitxml=junit/test-results-gallery.xml 29 | - name: Upload gallery pytest test results 30 | uses: actions/upload-artifact@v3 31 | with: 32 | name: pytest-results-gallery 33 | path: junit/test-results-gallery.xml 34 | if: ${{ always() }} 35 | 36 | Build_and_Push: 37 | environment: dev 38 | needs: 39 | - Unit-Test 40 | runs-on: ubuntu-latest 41 | steps: 42 | - name: Checkout 43 | uses: actions/checkout@v3 44 | - name: Set up Docker Buildx 45 | uses: docker/setup-buildx-action@v1 46 | - name: Log in to registry 47 | uses: docker/login-action@v1 48 | with: 49 | registry: ${{ secrets.REGISTRY_LOGIN_SERVER_DEV }} 50 | username: ${{ secrets.REGISTRY_USERNAME_DEV }} 51 | password: ${{ secrets.REGISTRY_PASSWORD_DEV }} 52 | - name: Install dependencies 53 | run: | 54 | python -m pip install --upgrade pip 55 | - name: Build and push 56 | uses: docker/build-push-action@v2 57 | with: 58 | context: ./gallery 59 | file: ./gallery/Dockerfile 60 | builder: ${{ steps.buildx.outputs.name }} 61 | push: true 62 | tags: acrdstoolkitdemodev.azurecr.io/dstoolkitaiux:latest -------------------------------------------------------------------------------- /.github/workflows/cd_manufacturing_analytics.yml: -------------------------------------------------------------------------------- 1 | name: Docker Manufacturing [PRO] 2 | on: 3 | push: 4 | paths: 5 | - 'visualizations/manufacturing_analytics/**' 6 | branches: 7 | - "main" 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | jobs: 13 | 14 | Build_Push: 15 | environment: production 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v3 21 | 22 | - name: Set up Docker Buildx 23 | uses: docker/setup-buildx-action@v1 24 | 25 | - name: Log in to registry 26 | uses: docker/login-action@v1 27 | with: 28 | registry: ${{ secrets.REGISTRY_LOGIN_SERVER }} 29 | username: ${{ secrets.REGISTRY_USERNAME }} 30 | password: ${{ secrets.REGISTRY_PASSWORD }} 31 | 32 | - name: Install dependencies 33 | run: | 34 | python -m pip install --upgrade pip 35 | 36 | - name: Build and push 37 | uses: docker/build-push-action@v2 38 | with: 39 | context: ./visualizations/manufacturing_analytics 40 | file: ./visualizations/manufacturing_analytics/Dockerfile 41 | builder: ${{ steps.buildx.outputs.name }} 42 | push: true 43 | tags: acrdstoolkitdemowepro.azurecr.io/viz-manufacturing:latest 44 | -------------------------------------------------------------------------------- /.github/workflows/cd_manufacturing_analytics_dev.yml: -------------------------------------------------------------------------------- 1 | name: Docker Manufacturing [DEV] 2 | on: 3 | push: 4 | paths: 5 | - 'visualizations/manufacturing_analytics/**' 6 | branches: 7 | - develop 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | jobs: 12 | 13 | Build_Push: 14 | environment: dev 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v3 20 | 21 | - name: Set up Docker Buildx 22 | uses: docker/setup-buildx-action@v1 23 | 24 | - name: Log in to registry 25 | uses: docker/login-action@v1 26 | with: 27 | registry: ${{ secrets.REGISTRY_LOGIN_SERVER_DEV }} 28 | username: ${{ secrets.REGISTRY_USERNAME_DEV }} 29 | password: ${{ secrets.REGISTRY_PASSWORD_DEV }} 30 | 31 | - name: Install dependencies 32 | run: | 33 | python -m pip install --upgrade pip 34 | 35 | - name: Build and push 36 | uses: docker/build-push-action@v2 37 | with: 38 | context: ./visualizations/manufacturing_analytics 39 | file: ./visualizations/manufacturing_analytics/Dockerfile 40 | builder: ${{ steps.buildx.outputs.name }} 41 | push: true 42 | tags: acrdstoolkitdemowedev.azurecr.io/viz-manufacturing:latest -------------------------------------------------------------------------------- /.github/workflows/cd_visualizations_consumer_analytics.yml: -------------------------------------------------------------------------------- 1 | name: Docker Visualizations [PRO] 2 | on: 3 | push: 4 | paths: 5 | - 'visualizations/consumer_analytics/**' 6 | branches: 7 | - "main" 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | jobs: 13 | 14 | Build_Push: 15 | environment: production 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v3 21 | 22 | - name: Set up Docker Buildx 23 | uses: docker/setup-buildx-action@v1 24 | 25 | - name: Log in to registry 26 | uses: docker/login-action@v1 27 | with: 28 | registry: ${{ secrets.REGISTRY_LOGIN_SERVER }} 29 | username: ${{ secrets.REGISTRY_USERNAME }} 30 | password: ${{ secrets.REGISTRY_PASSWORD }} 31 | 32 | - name: Install dependencies 33 | run: | 34 | python -m pip install --upgrade pip 35 | 36 | - name: Build and push 37 | uses: docker/build-push-action@v2 38 | with: 39 | context: ./visualizations/consumer_analytics 40 | file: ./visualizations/consumer_analytics/Dockerfile 41 | builder: ${{ steps.buildx.outputs.name }} 42 | push: true 43 | tags: acrdstoolkitdemowepro.azurecr.io/viz-consumer:latest 44 | -------------------------------------------------------------------------------- /.github/workflows/cd_visualizations_consumer_analytics_dev.yml: -------------------------------------------------------------------------------- 1 | name: Docker Visualizations [DEV] 2 | on: 3 | push: 4 | paths: 5 | - 'visualizations/consumer_analytics/**' 6 | branches: 7 | - develop 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | jobs: 13 | 14 | Build_Push: 15 | environment: dev 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v3 21 | 22 | - name: Set up Docker Buildx 23 | uses: docker/setup-buildx-action@v1 24 | 25 | - name: Log in to registry 26 | uses: docker/login-action@v1 27 | with: 28 | registry: ${{ secrets.REGISTRY_LOGIN_SERVER_DEV }} 29 | username: ${{ secrets.REGISTRY_USERNAME_DEV }} 30 | password: ${{ secrets.REGISTRY_PASSWORD_DEV }} 31 | 32 | - name: Install dependencies 33 | run: | 34 | python -m pip install --upgrade pip 35 | 36 | - name: Build and push 37 | uses: docker/build-push-action@v2 38 | with: 39 | context: ./visualizations/consumer_analytics 40 | file: ./visualizations/consumer_analytics/Dockerfile 41 | builder: ${{ steps.buildx.outputs.name }} 42 | push: true 43 | tags: acrdstoolkitdemowedev.azurecr.io/viz-consumer:latest 44 | -------------------------------------------------------------------------------- /.github/workflows/new_cards.yml: -------------------------------------------------------------------------------- 1 | name: Add New Card to Projects 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | jobs: 7 | createCard: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Create or Update Project Card 11 | uses: peter-evans/create-or-update-project-card@v2 12 | with: 13 | project-name: backlog 14 | column-name: To do 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | 352 | # junit test results 353 | junit/ 354 | test-results-*.xml 355 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Project 2 | 3 | Welcome to the AI Gallery. This repo hosts multiple demos for AI use-cases across multiple industries. The purpose of this repository is to collect, share, and improve demos developped for AI products/solutions/services which have been proven impactful. 4 | 5 | ## 🚀 Adding your demo to the gallery 6 | 7 | Currently, the onboarding process of new demos handles demos that are self hosted in your own project subscription. In other words, if your demo can be accessed via an URL, you can follow the steps below. If you need to host your demos in Azure, you may contact one of the contributor and we will help you onboard it. 8 | 9 | This repository is fully config driven, making it easy to add your own demo in here. 10 | 11 | To add your UI demo, the steps you need to take are: 12 | 13 | 1. Create your own branch: "your-name"/"your-demo" 14 | 2. Add a thumbnail of your UI (600 pixels x 400 pixels) to `gallery/app/static/assets/img/demo_thumbnails` 15 | 3. Add a screenshot of your UI (1600 pixels x 900 pixels) to `gallery/app/static/assets/img/demo_screenshots` 16 | 4. Add a new yaml file to `gallery/app/demo_configs`, following the yaml structure of the other demo configs as described below 17 | 5. Add the name of the `yml` file to the `gallery/app/demo_configs/.order` file in the position you'd like it to appear 18 | 6. Create a pull request from your branch to "develop" branch. Once accepted, you will be able to view your demo here: https://dev.ds-toolkit.com. 19 | 7. If your demos is working correctly and all the information is correct, create a new pull request from "develop" to "main" to push the demo to the main page. 20 | 21 | ### yml file structure 22 | 23 | | yml key | Description of Value | 24 | |-------------------------|------------------------------------------------------------------------------------------------| 25 | | name | Descriptive name of your demo | 26 | | tagline | Short tagline to be shown on the gallery front page | 27 | | authors | Update yml file structure doc | 28 | | business_problem | The business problem that your accelerator seeks to solve as a string or list of bullet points | 29 | | business_value | The value provided to the business in using this accelerator | 30 | | accelerator_description | A description of your accelerator and how it solves the business problem | 31 | | value | The value provided to the user/data scientist that is using this accelerator | 32 | | architecture | Bulleted list of technologies this accelerator leverages | 33 | | images | Filenames of the screenshot and thumbnail for your demo to be shown in the gallery | 34 | | links | Links to the demo, source code and [optionally] ARM template to deploy the solution | 35 | 36 | 37 | ## 🔔 (Coming Soon) 38 | 39 | - We are working on the infrastructure to enable you to host your demo on our subscription (MSFT employees only for now). With this feature, you will only have to provide your app folder and a docker image. 40 | 41 | ## Contributing 42 | 43 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 44 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 45 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. 46 | 47 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide 48 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions 49 | provided by the bot. You will only need to do this once across all repos using our CLA. 50 | 51 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 52 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 53 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 54 | 55 | ## Trademarks 56 | 57 | This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft 58 | trademarks or logos is subject to and must follow 59 | [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). 60 | Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. 61 | Any use of third-party trademarks or logos are subject to those third-party's policies. 62 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). 40 | 41 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # TODO: The maintainer of this repo has not yet edited this file 2 | 3 | **REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? 4 | 5 | - **No CSS support:** Fill out this template with information about how to file issues and get help. 6 | - **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. 7 | - **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. 8 | 9 | *Then remove this first heading from this SUPPORT.MD file before publishing your repo.* 10 | 11 | # Support 12 | 13 | ## How to file issues and get help 14 | 15 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing 16 | issues before filing new issues to avoid duplicates. For new issues, file your bug or 17 | feature request as a new Issue. 18 | 19 | For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE 20 | FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER 21 | CHANNEL. WHERE WILL YOU HELP PEOPLE?**. 22 | 23 | ## Microsoft Support Policy 24 | 25 | Support for this **PROJECT or PRODUCT** is limited to the resources listed above. 26 | -------------------------------------------------------------------------------- /gallery/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9 2 | 3 | ADD app/requirements.txt ./ 4 | RUN pip install -r requirements.txt 5 | RUN pip install gunicorn 6 | 7 | COPY app app 8 | 9 | WORKDIR /app 10 | 11 | ENV PORT 8080 12 | EXPOSE 8080 13 | 14 | ENTRYPOINT ["gunicorn", "--timeout", "600", "--access-logfile", "'-'", "--error-logfile", "'-'", "app:app"] 15 | -------------------------------------------------------------------------------- /gallery/README.md: -------------------------------------------------------------------------------- 1 | # Front-end page 2 | 3 | This folder contains the configuration files for all the demos and the web app for the AI-gallery landing page. 4 | 5 | # Adding your demo to the gallery 6 | 7 | This application is fully config driven, making it easy to add your own demo in here. 8 | 9 | To add your UI demo, the steps you need to take are: 10 | - Create your own branch: "your-name"/"your-demo" 11 | - Add a thumbnail of your UI (600 pixels x 400 pixels) to `static/assets/img/demo_thumbnails` 12 | - Add a screenshot of your UI (1600 pixels x 900 pixels) to `static/assets/img/demo_screenshots` 13 | - Add a new yaml file to `demo_configs`, following the yaml structure of the other demo configs as described below 14 | - Add the name of the `yml` file to the `demo_configs/.order` file in the position you'd like it to appear 15 | - Create a pull request 16 | 17 | ## yml file structure 18 | 19 | | yml key | Description of Value | 20 | |-------------------------|------------------------------------------------------------------------------------------------| 21 | | name | Descriptive name of your demo | 22 | | tagline | Short tagline to be shown on the gallery front page | 23 | | authors | The name and github alias of the author(s) | 24 | | business_problem | The business problem that your accelerator seeks to solve as a string or list of bullet points | 25 | | business_value | The value provided to the business in using this accelerator | 26 | | accelerator_description | A description of your accelerator and how it solves the business problem | 27 | | value | The value provided to the user/data scientist that is using this accelerator | 28 | | architecture | Bulleted list of technologies this accelerator leverages | 29 | | images | Filenames of the screenshot and thumbnail for your demo to be shown in the gallery | 30 | | links | Links to the demo, source code and [optionally] ARM template to deploy the solution | 31 | 32 | 33 | -------------------------------------------------------------------------------- /gallery/app/app.py: -------------------------------------------------------------------------------- 1 | import os 2 | import urllib 3 | 4 | import yaml 5 | from flask import Flask, redirect, render_template, url_for 6 | 7 | 8 | app = Flask(__name__) 9 | __here__ = os.path.dirname(__file__) 10 | DEMO_CONFIG_PATH = os.path.join(__here__, 'demo_configs') 11 | DEMO_CONFIG_ORDER = os.path.join(DEMO_CONFIG_PATH, '.order') 12 | 13 | 14 | @app.route('/', methods=['GET']) 15 | def home(): 16 | return redirect(url_for('gallery')) 17 | 18 | 19 | @app.route('/gallery', methods=['GET']) 20 | def gallery(): 21 | with open(DEMO_CONFIG_ORDER, 'r') as f: 22 | demo_config_order = f.read().splitlines() 23 | demo_configs = [] 24 | for demo_config_filename in demo_config_order: 25 | filepath = os.path.join(DEMO_CONFIG_PATH, demo_config_filename + '.yml') 26 | with open(filepath, 'r') as f: 27 | single_demo_config = yaml.safe_load(f) 28 | single_demo_config['filename'] = demo_config_filename 29 | demo_configs.append(single_demo_config) 30 | data = { 31 | 'demo_configs': demo_configs 32 | } 33 | return render_template('gallery.html', data=data) 34 | 35 | 36 | @app.route('/use-case/', methods=['GET']) 37 | def use_case(use_case_name): 38 | use_case_config_filename = use_case_name + '.yml' 39 | filepath = os.path.join(DEMO_CONFIG_PATH, use_case_config_filename) 40 | with open(filepath, 'r') as f: 41 | demo_config = yaml.safe_load(f) 42 | if demo_config['links'].get('arm_template'): 43 | demo_config['links']['arm_template'] = ( 44 | "https://portal.azure.com/#create/Microsoft.Template/uri/" 45 | + urllib.parse.quote_plus(demo_config['links']['arm_template']) 46 | ) 47 | data = { 48 | 'demo_config': demo_config 49 | } 50 | return render_template('use_case.html', data=data) 51 | 52 | 53 | def main(): 54 | app.run(host='0.0.0.0', port=5000, debug=True) 55 | 56 | 57 | if __name__ == '__main__': 58 | main() 59 | -------------------------------------------------------------------------------- /gallery/app/azuredeploy.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "webAppName": { 6 | "type": "string", 7 | "defaultValue": "[concat('webApp-', uniqueString(resourceGroup().id))]", 8 | "minLength": 2, 9 | "metadata": { 10 | "description": "Web app name." 11 | } 12 | }, 13 | "location": { 14 | "type": "string", 15 | "defaultValue": "[resourceGroup().location]", 16 | "metadata": { 17 | "description": "Location for all resources." 18 | } 19 | }, 20 | "sku": { 21 | "type": "string", 22 | "allowedValues": [ 23 | "F1", 24 | "D1", 25 | "B1", 26 | "B2", 27 | "B3", 28 | "S1", 29 | "S2", 30 | "S3", 31 | "P1", 32 | "P2", 33 | "P3", 34 | "P4" 35 | ], 36 | "defaultValue": "B1", 37 | "metadata": { 38 | "description": "The SKU of App Service Plan." 39 | } 40 | }, 41 | "linuxFxVersion": { 42 | "type": "string", 43 | "defaultValue": "PYTHON|3.7", 44 | "metadata": { 45 | "description": "The Runtime stack of current web app" 46 | } 47 | }, 48 | "repoUrl": { 49 | "type": "string", 50 | "defaultValue": "https://github.com/dstoolkit-ai-ux/tree/gallery-dev/gallery/app", 51 | "metadata": { 52 | "description": "Git Repo URL" 53 | } 54 | }, 55 | "repoBranch": { 56 | "type": "string", 57 | "defaultValue": "gallery-dev", 58 | "metadata": { 59 | "description": "Git Repo branch to deploy" 60 | } 61 | } 62 | }, 63 | "variables": { 64 | "appServicePlanPortalName": "[concat('AppServicePlan-', parameters('webAppName'))]" 65 | }, 66 | "resources": [ 67 | { 68 | "type": "Microsoft.Web/serverfarms", 69 | "apiVersion": "2020-06-01", 70 | "name": "[variables('appServicePlanPortalName')]", 71 | "location": "[parameters('location')]", 72 | "sku": { 73 | "name": "[parameters('sku')]" 74 | }, 75 | "kind": "linux", 76 | "properties": { 77 | "reserved": true 78 | } 79 | }, 80 | { 81 | "type": "Microsoft.Web/sites", 82 | "apiVersion": "2020-06-01", 83 | "name": "[parameters('webAppName')]", 84 | "location": "[parameters('location')]", 85 | 86 | "dependsOn": [ 87 | "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]" 88 | ], 89 | "properties": { 90 | "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]", 91 | "siteConfig": { 92 | "linuxFxVersion": "[parameters('linuxFxVersion')]" 93 | } 94 | }, 95 | "resources": [ 96 | { 97 | "type": "sourcecontrols", 98 | "apiVersion": "2020-06-01", 99 | "name": "web", 100 | "location": "[parameters('location')]", 101 | "dependsOn": [ 102 | "[resourceId('Microsoft.Web/sites', parameters('webAppName'))]" 103 | ], 104 | "properties": { 105 | "repoUrl": "[parameters('repoUrl')]", 106 | "branch": "[parameters('repoBranch')]", 107 | "isManualIntegration": true 108 | } 109 | } 110 | ] 111 | } 112 | ] 113 | } -------------------------------------------------------------------------------- /gallery/app/azuredeploy.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.1", 4 | "parameters": { 5 | "webAppName": { 6 | "value": "ds-toolkit-ai-ux-web-app" 7 | }, 8 | "sku": { 9 | "value": "B1" 10 | }, 11 | "linuxFxVersion": { 12 | "value": "PYTHON|3.7" 13 | }, 14 | "repoUrl": { 15 | "value": "https://github.com/microsoft/dstoolkit-ai-ux.git" 16 | }, 17 | "repoBranch": { 18 | "value": "gallery-dev" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /gallery/app/demo_configs/.order: -------------------------------------------------------------------------------- 1 | manufacturing_energy_optimisation 2 | consumer_analytics 3 | verseagility 4 | kg_search 5 | use_case_4 6 | use_case_5 7 | use_case_6 8 | use_case_7 9 | use_case_8 10 | use_case_9 11 | use_case_10 12 | use_case_11 13 | use_case_12 14 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/consumer_analytics.yml: -------------------------------------------------------------------------------- 1 | name: "Consumer Analytics" 2 | tagline: "Analyse customer lifetime value and customer churn rates" 3 | authors: 4 | - name: "Benjamin Keen" 5 | github_alias: "benalexkeen" 6 | business_problem: It can be difficult to determine how much you spend on marketing when targeting customers. In this accelerator you can learn more about your customers with regards to how likely they are to churn and what their customer lifetime value will be. As the churn probability of a customer increases, consider marketing intervention to prevent customer churn. 7 | business_value: 8 | - New insights into customer spending habits 9 | - More effective apportioning of marketing budgets 10 | accelerator_description: This is a self service tool to allow you to upload your own customer data or use sample data to see customer insights with an interactive tool to allow you to determine customer lifetime value given a customer's spending habits 11 | modeling_approach_and_training: This is a simple flask application that wraps python's lifetimes library. It uses a Beta-Geometric to determine customer churn and combines this with a Gamma-Gamma model of monetary value to determine Customer Lifetime Value. Models are trained as data is uploaded and currently there is no caching of data. 12 | value: 13 | - Easy and immediate insights into customers 14 | - Deploy to your own subscription to ensure your data never leaves your tenant 15 | data: The data required for this accelerator is the frequency (number of transactions), the recency in weeks (how recently did they last purchase), the time since their first purchase in weeks, and the average monetary value of their transactions. 16 | architecture: 17 | - Azure App Services 18 | - flask 19 | images: 20 | screenshot_filename: "consumer_analytics.png" 21 | thumbnail_filename: "consumer_analytics.png" 22 | links: 23 | demo: "http://demos.dstoolkit-gallery.com/consumer" 24 | source_code: 'https://github.com/microsoft/dstoolkit-ai-ux/tree/main/visualizations/consumer_analytics' 25 | arm_template: 'https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/main/visualizations/consumer_analytics/app/azuredeploy.json' 26 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/kg_search.yml: -------------------------------------------------------------------------------- 1 | name: "Knowledge Graph Enabled Search" 2 | tagline: "Enrich the organic results of a general purpose search engine with a domain-specific knowledge graph" 3 | authors: 4 | - name: "Andy He" 5 | github_alias: "andyhemsft" 6 | - name: "Jin Yu" 7 | github_alias: "yuj18" 8 | business_problem: Most organizations have large amount of information residing in multiple systems. When information is required by the organization's employees, they rely on querying different systems with different search mechanisms, and/or reaching out to different SMEs in the organization. This trial-and-error exercise relies on the search capabilities of each system and is time consuming. 9 | business_value: Technology has advanced and much of our focus has been on consolidating the data into Data Lakes, whereas, bringing meaningful information is the key to democratizing knowledge, and ultimately improving the overall efficiency and consistency of business operations. 10 | accelerator_description: This accelerator provides the code template to implement a domain-aware search solution that uses knowledge graph (KG) to enrich the organic results of a general-purpose search engine, with the goal of reducing the time to information and improving productivity of users by bringing forth the most relevant search result beyond the specified search keywords. 11 | modeling_approach_and_training: | 12 | Building domain-specific Named Entity Recognition (NER) model to detect entities of interest that are present in search queries. Leveraging Knowledge Graph for: Search refinement - Refine search results by recognizing different meanings of a search term. Search expansion - Expand search results through the relationships of the detected entities 13 | value: This accelerator is based on an actual implementation of a KG-enabled search solution for a leading Oil and Gas customer in Asia. The implementation has been deployed into production, tested and used by real users. 14 | data: This accelerator supports structured and unstructured data that can be indexed by a general-purpose search engine, e.g., text, image, video, etc. The accelerator assumes that a knowledge graph is available, and it contains the entities and relationships that can be used to support targeted search refinement or/and search expansion scenarios. 15 | architecture: 16 | - Azure Cognitive Search 17 | - Azure Cosmos DB 18 | - Azure App Service 19 | - Azure Machine Learning 20 | images: 21 | screenshot_filename: "kg_search.png" 22 | thumbnail_filename: "kg_search.png" 23 | links: 24 | demo: "https://uikgsearch.azurewebsites.net/" 25 | source_code: "https://github.com/microsoft/dstoolkit-kg-search" 26 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/manufacturing_energy_optimisation.yml: -------------------------------------------------------------------------------- 1 | name: "Manufacturing Energy Optimization" 2 | tagline: "Conserve energy and improve sustainability" 3 | authors: 4 | - name: "Florian Pydde" 5 | github_alias: "FlorianPydde" 6 | business_problem: A common challenges in manufacturing is energy optimisation. Client demand has to be met while trying to optmise the manufacturing process. Each manufacturing job (a job is a planned operation to produce specific material or objects like aluminium, metal eyelets, etc) is usually scheduled on a specific machine at a specific time with a specific set of configuration. With this data, we can understand how much energy the machine will require to run a job with some setup, and eventually optimise the job schedule to avoid energy peak load. 7 | business_value: 8 | - Insights into energy consumptions of machines 9 | - Target KPI is energy Savings 10 | accelerator_description: This demos shows (1) an AI model assessment to enable plant operator to review how the model is performing (2) the energy profile for a job schedule (3) how changes in machine configuration impact the energy consumption 11 | modeling_approach_and_training: The model is a simple linear regression as the energy consumption is mostly affected linearly by factors such as machine power, speed, etc. 12 | value: 13 | - Quickly setup a demo for operators to review your model's performances 14 | - Enable operators to experiment with new configurations to evaluate 15 | - Once the energy of a specific job is known, an extension for this demo would be to show an optimised week schedule. 16 | data: the data represents typical machinery configuration (pressure, speed, etc) and the energy consumption in KWH. 17 | architecture: 18 | - Azure App Services 19 | - Streamlit 20 | images: 21 | screenshot_filename: "manufacturing_energy_optimization.png" 22 | thumbnail_filename: "manufacturing_energy_optimization.png" 23 | links: 24 | demo: "https://manufacturing-analytics-demo.dstoolkit-gallery-dev.com/" 25 | source_code: 'https://github.com/microsoft/dstoolkit-ai-ux/tree/main/visualizations/manufacturing_analytics' 26 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/use_case_10.yml: -------------------------------------------------------------------------------- 1 | name: "Use Case 10 test" 2 | tagline: "Lorem ipsum dolor sit amet, consectetur adipisicing elit" 3 | authors: 4 | - name: "John Smith" 5 | github_alias: "benalexkeen" 6 | business_problem: Forecast future business metrics against a timeseries (daily, weekly, quarterly, monthly etc) example revenue forecast, energy demand forecast, headcount forecast, stock level forecast. 7 | business_value: 8 | - More accurate and timely forecasting help to reduce cost and increase operational efficiencies​ 9 | - Estimated Price / ACR. Examples of customers were this has been harvested / used / implemented. 10 | accelerator_description: This accelerator helps to forecast multiple time series by building models based on time-series profiling, performing accurate data preparation and by training and forecasting multiple time series with models created ad-hoc for each profile. 11 | modeling_approach_and_training: Choose explanatory variables or regressors - which variables help me in explaining the target variable I want to forecast? Choose forecasting algorithm - which algorithm do I use to produce my forecast? Arima, Linear regression, Boosting model? The accelerator helps the user to choose the training data set. Number of observations to train the model and produce the forecast. 12 | value: 13 | - This accelerator performs profiling of the data series, which helps match algorithms to data segments, making the forecast more accurate. 14 | data: This accelerator deals with so-called panel data. In statistics and econometrics, panel data or longitudinal data is a collection of data that contains observations about different cross sections (groups or ids) that is assembled over intervals in time and ordered chronologically. Examples of groups that may make up panel data series include countries, firms, individuals, or demographic groups. How does the data science toolkit product integrate with Data Strategy, and what services do I need to enable it?​ 15 | architecture: 16 | - Azure Machine Learning​ 17 | - Azure Synapse 18 | - Azure Databricks 19 | - Azure DevOps 20 | images: 21 | thumbnail_filename: "use_case_10.jpg" 22 | screenshot_filename: "placeholder_screenshot.png" 23 | links: 24 | demo: "#" 25 | source_code: '#' 26 | arm_template: '#' 27 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/use_case_11.yml: -------------------------------------------------------------------------------- 1 | name: "Use Case 11 test" 2 | tagline: "Lorem ipsum dolor sit amet, consectetur adipisicing elit" 3 | authors: 4 | - name: "John Smith" 5 | github_alias: "benalexkeen" 6 | business_problem: Forecast future business metrics against a timeseries (daily, weekly, quarterly, monthly etc) example revenue forecast, energy demand forecast, headcount forecast, stock level forecast. 7 | business_value: 8 | - More accurate and timely forecasting help to reduce cost and increase operational efficiencies​ 9 | - Estimated Price / ACR. Examples of customers were this has been harvested / used / implemented. 10 | accelerator_description: This accelerator helps to forecast multiple time series by building models based on time-series profiling, performing accurate data preparation and by training and forecasting multiple time series with models created ad-hoc for each profile. 11 | modeling_approach_and_training: Choose explanatory variables or regressors - which variables help me in explaining the target variable I want to forecast? Choose forecasting algorithm - which algorithm do I use to produce my forecast? Arima, Linear regression, Boosting model? The accelerator helps the user to choose the training data set. Number of observations to train the model and produce the forecast. 12 | value: 13 | - This accelerator performs profiling of the data series, which helps match algorithms to data segments, making the forecast more accurate. 14 | data: This accelerator deals with so-called panel data. In statistics and econometrics, panel data or longitudinal data is a collection of data that contains observations about different cross sections (groups or ids) that is assembled over intervals in time and ordered chronologically. Examples of groups that may make up panel data series include countries, firms, individuals, or demographic groups. How does the data science toolkit product integrate with Data Strategy, and what services do I need to enable it?​ 15 | architecture: 16 | - Azure Machine Learning​ 17 | - Azure Synapse 18 | - Azure Databricks 19 | - Azure DevOps 20 | images: 21 | thumbnail_filename: "use_case_3.jpg" 22 | screenshot_filename: "placeholder_screenshot.png" 23 | links: 24 | demo: "#" 25 | source_code: '#' 26 | arm_template: '#' 27 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/use_case_12.yml: -------------------------------------------------------------------------------- 1 | name: "Use Case 12 test" 2 | tagline: "Lorem ipsum dolor sit amet, consectetur adipisicing elit" 3 | authors: 4 | - name: "John Smith" 5 | github_alias: "benalexkeen" 6 | business_problem: Forecast future business metrics against a timeseries (daily, weekly, quarterly, monthly etc) example revenue forecast, energy demand forecast, headcount forecast, stock level forecast. 7 | business_value: 8 | - More accurate and timely forecasting help to reduce cost and increase operational efficiencies​ 9 | - Estimated Price / ACR. Examples of customers were this has been harvested / used / implemented. 10 | accelerator_description: This accelerator helps to forecast multiple time series by building models based on time-series profiling, performing accurate data preparation and by training and forecasting multiple time series with models created ad-hoc for each profile. 11 | modeling_approach_and_training: Choose explanatory variables or regressors - which variables help me in explaining the target variable I want to forecast? Choose forecasting algorithm - which algorithm do I use to produce my forecast? Arima, Linear regression, Boosting model? The accelerator helps the user to choose the training data set. Number of observations to train the model and produce the forecast. 12 | value: 13 | - This accelerator performs profiling of the data series, which helps match algorithms to data segments, making the forecast more accurate. 14 | data: This accelerator deals with so-called panel data. In statistics and econometrics, panel data or longitudinal data is a collection of data that contains observations about different cross sections (groups or ids) that is assembled over intervals in time and ordered chronologically. Examples of groups that may make up panel data series include countries, firms, individuals, or demographic groups. How does the data science toolkit product integrate with Data Strategy, and what services do I need to enable it?​ 15 | architecture: 16 | - Azure Machine Learning​ 17 | - Azure Synapse 18 | - Azure Databricks 19 | - Azure DevOps 20 | images: 21 | thumbnail_filename: "use_case_4.jpg" 22 | screenshot_filename: "placeholder_screenshot.png" 23 | links: 24 | demo: "#" 25 | source_code: '#' 26 | arm_template: '#' 27 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/use_case_4.yml: -------------------------------------------------------------------------------- 1 | name: "Use Case 4" 2 | tagline: "Lorem ipsum dolor sit amet, consectetur adipisicing elit" 3 | authors: 4 | - name: "John Smith" 5 | github_alias: "benalexkeen" 6 | business_problem: Forecast future business metrics against a timeseries (daily, weekly, quarterly, monthly etc) example revenue forecast, energy demand forecast, headcount forecast, stock level forecast. 7 | business_value: 8 | - More accurate and timely forecasting help to reduce cost and increase operational efficiencies​ 9 | - Estimated Price / ACR. Examples of customers were this has been harvested / used / implemented. 10 | accelerator_description: This accelerator helps to forecast multiple time series by building models based on time-series profiling, performing accurate data preparation and by training and forecasting multiple time series with models created ad-hoc for each profile. 11 | modeling_approach_and_training: Choose explanatory variables or regressors - which variables help me in explaining the target variable I want to forecast? Choose forecasting algorithm - which algorithm do I use to produce my forecast? Arima, Linear regression, Boosting model? The accelerator helps the user to choose the training data set. Number of observations to train the model and produce the forecast. 12 | value: 13 | - This accelerator performs profiling of the data series, which helps match algorithms to data segments, making the forecast more accurate. 14 | data: This accelerator deals with so-called panel data. In statistics and econometrics, panel data or longitudinal data is a collection of data that contains observations about different cross sections (groups or ids) that is assembled over intervals in time and ordered chronologically. Examples of groups that may make up panel data series include countries, firms, individuals, or demographic groups. How does the data science toolkit product integrate with Data Strategy, and what services do I need to enable it?​ 15 | architecture: 16 | - Azure Machine Learning​ 17 | - Azure Synapse 18 | - Azure Databricks 19 | - Azure DevOps 20 | images: 21 | thumbnail_filename: "use_case_4.jpg" 22 | screenshot_filename: "placeholder_screenshot.png" 23 | links: 24 | demo: "#" 25 | source_code: '#' 26 | arm_template: '#' 27 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/use_case_5.yml: -------------------------------------------------------------------------------- 1 | name: "Use Case 5 test" 2 | tagline: "Lorem ipsum dolor sit amet, consectetur adipisicing elit" 3 | authors: 4 | - name: "John Smith" 5 | github_alias: "benalexkeen" 6 | business_problem: Forecast future business metrics against a timeseries (daily, weekly, quarterly, monthly etc) example revenue forecast, energy demand forecast, headcount forecast, stock level forecast. 7 | business_value: 8 | - More accurate and timely forecasting help to reduce cost and increase operational efficiencies​ 9 | - Estimated Price / ACR. Examples of customers were this has been harvested / used / implemented. 10 | accelerator_description: This accelerator helps to forecast multiple time series by building models based on time-series profiling, performing accurate data preparation and by training and forecasting multiple time series with models created ad-hoc for each profile. 11 | modeling_approach_and_training: Choose explanatory variables or regressors - which variables help me in explaining the target variable I want to forecast? Choose forecasting algorithm - which algorithm do I use to produce my forecast? Arima, Linear regression, Boosting model? The accelerator helps the user to choose the training data set. Number of observations to train the model and produce the forecast. 12 | value: 13 | - This accelerator performs profiling of the data series, which helps match algorithms to data segments, making the forecast more accurate. 14 | data: This accelerator deals with so-called panel data. In statistics and econometrics, panel data or longitudinal data is a collection of data that contains observations about different cross sections (groups or ids) that is assembled over intervals in time and ordered chronologically. Examples of groups that may make up panel data series include countries, firms, individuals, or demographic groups. How does the data science toolkit product integrate with Data Strategy, and what services do I need to enable it?​ 15 | architecture: 16 | - Azure Machine Learning​ 17 | - Azure Synapse 18 | - Azure Databricks 19 | - Azure DevOps 20 | images: 21 | thumbnail_filename: "use_case_5.jpg" 22 | screenshot_filename: "placeholder_screenshot.png" 23 | links: 24 | demo: "#" 25 | source_code: '#' 26 | arm_template: '#' 27 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/use_case_6.yml: -------------------------------------------------------------------------------- 1 | name: "Use Case 6 test" 2 | tagline: "Lorem ipsum dolor sit amet, consectetur adipisicing elit" 3 | authors: 4 | - name: "John Smith" 5 | github_alias: "benalexkeen" 6 | business_problem: Forecast future business metrics against a timeseries (daily, weekly, quarterly, monthly etc) example revenue forecast, energy demand forecast, headcount forecast, stock level forecast. 7 | business_value: 8 | - More accurate and timely forecasting help to reduce cost and increase operational efficiencies​ 9 | - Estimated Price / ACR. Examples of customers were this has been harvested / used / implemented. 10 | accelerator_description: This accelerator helps to forecast multiple time series by building models based on time-series profiling, performing accurate data preparation and by training and forecasting multiple time series with models created ad-hoc for each profile. 11 | modeling_approach_and_training: Choose explanatory variables or regressors - which variables help me in explaining the target variable I want to forecast? Choose forecasting algorithm - which algorithm do I use to produce my forecast? Arima, Linear regression, Boosting model? The accelerator helps the user to choose the training data set. Number of observations to train the model and produce the forecast. 12 | value: 13 | - This accelerator performs profiling of the data series, which helps match algorithms to data segments, making the forecast more accurate. 14 | data: This accelerator deals with so-called panel data. In statistics and econometrics, panel data or longitudinal data is a collection of data that contains observations about different cross sections (groups or ids) that is assembled over intervals in time and ordered chronologically. Examples of groups that may make up panel data series include countries, firms, individuals, or demographic groups. How does the data science toolkit product integrate with Data Strategy, and what services do I need to enable it?​ 15 | architecture: 16 | - Azure Machine Learning​ 17 | - Azure Synapse 18 | - Azure Databricks 19 | - Azure DevOps 20 | images: 21 | thumbnail_filename: "use_case_6.jpg" 22 | screenshot_filename: "placeholder_screenshot.png" 23 | links: 24 | demo: "#" 25 | source_code: '#' 26 | arm_template: '#' 27 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/use_case_7.yml: -------------------------------------------------------------------------------- 1 | name: "Use Case 7 test" 2 | tagline: "Lorem ipsum dolor sit amet, consectetur adipisicing elit" 3 | authors: 4 | - name: "John Smith" 5 | github_alias: "benalexkeen" 6 | business_problem: Forecast future business metrics against a timeseries (daily, weekly, quarterly, monthly etc) example revenue forecast, energy demand forecast, headcount forecast, stock level forecast. 7 | business_value: 8 | - More accurate and timely forecasting help to reduce cost and increase operational efficiencies​ 9 | - Estimated Price / ACR. Examples of customers were this has been harvested / used / implemented. 10 | accelerator_description: This accelerator helps to forecast multiple time series by building models based on time-series profiling, performing accurate data preparation and by training and forecasting multiple time series with models created ad-hoc for each profile. 11 | modeling_approach_and_training: Choose explanatory variables or regressors - which variables help me in explaining the target variable I want to forecast? Choose forecasting algorithm - which algorithm do I use to produce my forecast? Arima, Linear regression, Boosting model? The accelerator helps the user to choose the training data set. Number of observations to train the model and produce the forecast. 12 | value: 13 | - This accelerator performs profiling of the data series, which helps match algorithms to data segments, making the forecast more accurate. 14 | data: This accelerator deals with so-called panel data. In statistics and econometrics, panel data or longitudinal data is a collection of data that contains observations about different cross sections (groups or ids) that is assembled over intervals in time and ordered chronologically. Examples of groups that may make up panel data series include countries, firms, individuals, or demographic groups. How does the data science toolkit product integrate with Data Strategy, and what services do I need to enable it?​ 15 | architecture: 16 | - Azure Machine Learning​ 17 | - Azure Synapse 18 | - Azure Databricks 19 | - Azure DevOps 20 | images: 21 | thumbnail_filename: "use_case_7.jpg" 22 | screenshot_filename: "placeholder_screenshot.png" 23 | links: 24 | demo: "#" 25 | source_code: '#' 26 | arm_template: '#' 27 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/use_case_8.yml: -------------------------------------------------------------------------------- 1 | name: "Use Case 8 test" 2 | tagline: "Lorem ipsum dolor sit amet, consectetur adipisicing elit" 3 | authors: 4 | - name: "John Smith" 5 | github_alias: "benalexkeen" 6 | business_problem: Forecast future business metrics against a timeseries (daily, weekly, quarterly, monthly etc) example revenue forecast, energy demand forecast, headcount forecast, stock level forecast. 7 | business_value: 8 | - More accurate and timely forecasting help to reduce cost and increase operational efficiencies​ 9 | - Estimated Price / ACR. Examples of customers were this has been harvested / used / implemented. 10 | accelerator_description: This accelerator helps to forecast multiple time series by building models based on time-series profiling, performing accurate data preparation and by training and forecasting multiple time series with models created ad-hoc for each profile. 11 | modeling_approach_and_training: Choose explanatory variables or regressors - which variables help me in explaining the target variable I want to forecast? Choose forecasting algorithm - which algorithm do I use to produce my forecast? Arima, Linear regression, Boosting model? The accelerator helps the user to choose the training data set. Number of observations to train the model and produce the forecast. 12 | value: 13 | - This accelerator performs profiling of the data series, which helps match algorithms to data segments, making the forecast more accurate. 14 | data: This accelerator deals with so-called panel data. In statistics and econometrics, panel data or longitudinal data is a collection of data that contains observations about different cross sections (groups or ids) that is assembled over intervals in time and ordered chronologically. Examples of groups that may make up panel data series include countries, firms, individuals, or demographic groups. How does the data science toolkit product integrate with Data Strategy, and what services do I need to enable it?​ 15 | architecture: 16 | - Azure Machine Learning​ 17 | - Azure Synapse 18 | - Azure Databricks 19 | - Azure DevOps 20 | images: 21 | thumbnail_filename: "use_case_8.jpg" 22 | screenshot_filename: "placeholder_screenshot.png" 23 | links: 24 | demo: "#" 25 | source_code: '#' 26 | arm_template: '#' 27 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/use_case_9.yml: -------------------------------------------------------------------------------- 1 | name: "Use Case 9 test" 2 | tagline: "Lorem ipsum dolor sit amet, consectetur adipisicing elit" 3 | authors: 4 | - name: "John Smith" 5 | github_alias: "benalexkeen" 6 | business_problem: Forecast future business metrics against a timeseries (daily, weekly, quarterly, monthly etc) example revenue forecast, energy demand forecast, headcount forecast, stock level forecast. 7 | business_value: 8 | - More accurate and timely forecasting help to reduce cost and increase operational efficiencies​ 9 | - Estimated Price / ACR. Examples of customers were this has been harvested / used / implemented. 10 | accelerator_description: This accelerator helps to forecast multiple time series by building models based on time-series profiling, performing accurate data preparation and by training and forecasting multiple time series with models created ad-hoc for each profile. 11 | modeling_approach_and_training: Choose explanatory variables or regressors - which variables help me in explaining the target variable I want to forecast? Choose forecasting algorithm - which algorithm do I use to produce my forecast? Arima, Linear regression, Boosting model? The accelerator helps the user to choose the training data set. Number of observations to train the model and produce the forecast. 12 | value: 13 | - This accelerator performs profiling of the data series, which helps match algorithms to data segments, making the forecast more accurate. 14 | data: This accelerator deals with so-called panel data. In statistics and econometrics, panel data or longitudinal data is a collection of data that contains observations about different cross sections (groups or ids) that is assembled over intervals in time and ordered chronologically. Examples of groups that may make up panel data series include countries, firms, individuals, or demographic groups. How does the data science toolkit product integrate with Data Strategy, and what services do I need to enable it?​ 15 | architecture: 16 | - Azure Machine Learning​ 17 | - Azure Synapse 18 | - Azure Databricks 19 | - Azure DevOps 20 | images: 21 | thumbnail_filename: "use_case_9.jpg" 22 | screenshot_filename: "placeholder_screenshot.png" 23 | links: 24 | demo: "#" 25 | source_code: '#' 26 | arm_template: '#' 27 | -------------------------------------------------------------------------------- /gallery/app/demo_configs/verseagility.yml: -------------------------------------------------------------------------------- 1 | name: "Verseagility" 2 | tagline: "Text classification, named entity recognition and answer suggestions for support emails and attachments." 3 | authors: 4 | - name: "Timm Walz" 5 | github_alias: "nonstoptimm" 6 | - name: "Christian Vorhemus" 7 | github_alias: "christian-vorhemus" 8 | - name: "Martin Kayser" 9 | github_alias: "maknotavailable" 10 | - name: "Timo Acquistapace" 11 | github_alias: "TimoA89" 12 | business_problem: Building NLP solutions which cover all components from text classification, named entity recognition to answer suggestion, require testing and integration effort. For this purpose, we developed this toolkit, which serves to minimize the setup time of an end-to-end solution and maximizes the time for use case-specific enhancements and adjustments. On this way, first results should be made available in an accelerated way when bringing individual, pre-labeled text document data and allow more time for iterative improvements. 13 | business_value: 14 | - 15 | accelerator_description: Verseagility is a Python-based toolkit to ramp up your custom natural language processing (NLP) task, allowing you to bring your own data, use your preferred frameworks and bring models into production. It is a central component of the Microsoft Data Science Toolkit. 16 | modeling_approach_and_training: | 17 | Verseagility is a modular toolkit that can be extended by further use-cases as needed. Following use-cases are already implemented and ready to be used: Binary, multi-class & multi-label classification. Named entity recognition. Question answering. Opinion mining. 18 | value: 19 | - 20 | data: 21 | architecture: 22 | - Azure App Services 23 | - Streamlit 24 | images: 25 | thumbnail_filename: "verseagility.png" 26 | screenshot_filename: "verseagility.png" 27 | links: 28 | demo: "https://verseagility.azurewebsites.net/" 29 | source_code: 'https://github.com/microsoft/verseagility' 30 | -------------------------------------------------------------------------------- /gallery/app/requirements.txt: -------------------------------------------------------------------------------- 1 | flask==2.1.2 2 | pyyaml==6.0 -------------------------------------------------------------------------------- /gallery/app/static/assets/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/apple-touch-icon.png -------------------------------------------------------------------------------- /gallery/app/static/assets/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/favicon-16x16.png -------------------------------------------------------------------------------- /gallery/app/static/assets/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/favicon-32x32.png -------------------------------------------------------------------------------- /gallery/app/static/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/favicon.ico -------------------------------------------------------------------------------- /gallery/app/static/assets/img/azure_icon_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/azure_icon_white.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_screenshots/consumer_analytics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_screenshots/consumer_analytics.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_screenshots/kg_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_screenshots/kg_search.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_screenshots/manufacturing_energy_optimization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_screenshots/manufacturing_energy_optimization.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_screenshots/placeholder_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_screenshots/placeholder_screenshot.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_screenshots/verseagility.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_screenshots/verseagility.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/consumer_analytics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/consumer_analytics.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/kg_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/kg_search.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/manufacturing_energy_optimization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/manufacturing_energy_optimization.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/use_case_10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/use_case_10.jpg -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/use_case_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/use_case_3.jpg -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/use_case_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/use_case_4.jpg -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/use_case_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/use_case_5.jpg -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/use_case_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/use_case_6.jpg -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/use_case_7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/use_case_7.jpg -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/use_case_8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/use_case_8.jpg -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/use_case_9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/use_case_9.jpg -------------------------------------------------------------------------------- /gallery/app/static/assets/img/demo_thumbnails/verseagility.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/demo_thumbnails/verseagility.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/ds_toolkit_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/ds_toolkit_logo.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/ds_toolkit_logo_invert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/ds_toolkit_logo_invert.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/ds_toolkit_logo_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/ds_toolkit_logo_square.png -------------------------------------------------------------------------------- /gallery/app/static/assets/img/portrait_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/assets/img/portrait_black.png -------------------------------------------------------------------------------- /gallery/app/static/css/custom.css: -------------------------------------------------------------------------------- 1 | .btn-github { 2 | color: #fff; 3 | background-color: #0078d4; 4 | border-color: #0078d4; 5 | } 6 | 7 | .btn-optimization { 8 | color: #fff; 9 | background-color: #73262f; 10 | border-color: #73262f; 11 | } 12 | 13 | .btn-regression { 14 | color: #fff; 15 | background-color: #702573; 16 | border-color: #702573; 17 | ; 18 | } 19 | 20 | .btn-classification { 21 | color: #fff; 22 | background-color: #107c10; 23 | border-color: #107c10; 24 | } 25 | 26 | .btn-clustering { 27 | color: #fff; 28 | background-color: #7F5A1A; 29 | border-color: #7F5A1A; 30 | } 31 | 32 | .btn-nlp { 33 | color: #fff; 34 | background-color: #008575; 35 | border-color: #008575; 36 | } 37 | 38 | .btn-search { 39 | color: #fff; 40 | background-color: #243a5e; 41 | border-color: #243a5e; 42 | } 43 | 44 | .btn-vision { 45 | color: #fff; 46 | background-color: #6a4b16; 47 | border-color: #6a4b16; 48 | } 49 | 50 | .btn-other { 51 | color: #fff; 52 | background-color: #737373; 53 | border-color: #737373; 54 | } 55 | 56 | .btn-demo { 57 | color: #fff; 58 | background-color: #702573; 59 | border-color: #702573; 60 | } 61 | 62 | .btn-source-code { 63 | color: #fff; 64 | background-color: #2A446F; 65 | border-color: #2A446F; 66 | } 67 | 68 | .btn-download { 69 | color: #fff; 70 | background-color: #0078D4; 71 | border-color: #0078D4; 72 | } 73 | 74 | .descriptor-title { 75 | font-family: "Segoe UI Semibold"; 76 | } 77 | 78 | .btn { 79 | font-family: "Segoe UI Semibold"; 80 | } 81 | -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/bold/segoeuib.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/bold/segoeuib.eot -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/bold/segoeuib.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/bold/segoeuib.ttf -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/bold/segoeuib.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/bold/segoeuib.woff -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/light/segoeuil.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/light/segoeuil.eot -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/light/segoeuil.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/light/segoeuil.ttf -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/light/segoeuil.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/light/segoeuil.woff -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/semibold/seguisb.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/semibold/seguisb.eot -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/semibold/seguisb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/semibold/seguisb.ttf -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/semibold/seguisb.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/semibold/seguisb.woff -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/ui/segoeui.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/ui/segoeui.eot -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/ui/segoeui.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/ui/segoeui.ttf -------------------------------------------------------------------------------- /gallery/app/static/css/fonts/segoe/ui/segoeui.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/app/static/css/fonts/segoe/ui/segoeui.woff -------------------------------------------------------------------------------- /gallery/app/static/js/scripts.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Start Bootstrap - New Age v6.0.6 (https://startbootstrap.com/theme/new-age) 3 | * Copyright 2013-2022 Start Bootstrap 4 | * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-new-age/blob/master/LICENSE) 5 | */ 6 | // 7 | // Scripts 8 | // 9 | 10 | window.addEventListener('DOMContentLoaded', event => { 11 | 12 | // Activate Bootstrap scrollspy on the main nav element 13 | const mainNav = document.body.querySelector('#mainNav'); 14 | if (mainNav) { 15 | new bootstrap.ScrollSpy(document.body, { 16 | target: '#mainNav', 17 | offset: 74, 18 | }); 19 | }; 20 | 21 | // Collapse responsive navbar when toggler is visible 22 | const navbarToggler = document.body.querySelector('.navbar-toggler'); 23 | const responsiveNavItems = [].slice.call( 24 | document.querySelectorAll('#navbarResponsive .nav-link') 25 | ); 26 | responsiveNavItems.map(function (responsiveNavItem) { 27 | responsiveNavItem.addEventListener('click', () => { 28 | if (window.getComputedStyle(navbarToggler).display !== 'none') { 29 | navbarToggler.click(); 30 | } 31 | }); 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /gallery/app/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% block head %} 5 | 6 | 7 | 8 | 9 | DS Toolkit AI UX 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {% endblock %} 25 | {% block custom_css %}{% endblock %} 26 | 27 | 28 | 29 | 30 | 53 | {% block content %}{% endblock %} 54 | 55 |
56 |
57 |
58 |
© Microsoft 2022. All Rights Reserved.
59 | Privacy 60 | · 61 | Terms 62 |
63 |
64 |
65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /gallery/app/templates/gallery.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 4 |
5 |
6 |
7 |
8 | 9 |
10 |
11 |
12 |

Gallery

13 |

View a selection of reusable user experiences created for different data science use cases below.

14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | {% for demo_config in data.demo_configs %} 25 | 26 |
27 |
{{demo_config['name']}} Use Case Thumbnail 28 |
29 |
{{demo_config['name']}}
30 |

{{demo_config['tagline']}}

31 |
32 |
33 |
34 | 35 | {% endfor %} 36 | 37 |
38 |
39 |
40 | {% endblock %} 41 | -------------------------------------------------------------------------------- /gallery/app/templates/use_case.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 4 |
5 |
6 |
7 |
8 |
9 | 10 |
11 |

{{ data.demo_config.name }}

12 |

{{ data.demo_config.tagline }}

13 |
14 |
15 |
16 |
17 | {% if data['demo_config']['links']['demo'] %} 18 | 19 | {{ data.demo_config.name }} Use Case Screenshot 20 |
21 |
Live Demo
22 |
23 |
24 | {% else %} 25 | {{ data.demo_config.name }} Use Case Screenshot 26 | {% endif %} 27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | 38 |
39 |

Business Problem

40 | {% if data.demo_config.business_problem is string %} 41 |

42 | {{ data.demo_config.business_problem }} 43 |

44 | {% else %} 45 |

46 |

    47 | {% for item in data.demo_config.business_problem %} 48 |
  • {{ item }}
  • 49 | {% endfor %} 50 |
51 |

52 | {% endif %} 53 |

Business Value

54 | {% if data.demo_config.business_value is string %} 55 |

56 | {{ data.demo_config.business_value }} 57 |

58 | {% else %} 59 |

60 |

    61 | {% for item in data.demo_config.business_value %} 62 |
  • {{ item }}
  • 63 | {% endfor %} 64 |
65 |

66 | {% endif %} 67 |

Accelerator Description

68 | {% if data.demo_config.accelerator_description is string %} 69 |

70 | {{ data.demo_config.accelerator_description }} 71 |

72 | {% else %} 73 |

74 |

    75 | {% for item in data.demo_config.accelerator_description %} 76 |
  • {{ item }}
  • 77 | {% endfor %} 78 |
79 |

80 | {% endif %} 81 |

Modeling Approach & Training

82 | {% if data.demo_config.modeling_approach_and_training is string %} 83 |

84 | {{ data.demo_config.modeling_approach_and_training }} 85 |

86 | {% else %} 87 |

88 |

    89 | {% for item in data.demo_config.modeling_approach_and_training %} 90 |
  • {{ item }}
  • 91 | {% endfor %} 92 |
93 |

94 | {% endif %} 95 |

Value

96 | {% if data.demo_config.value is string %} 97 |

98 | {{ data.demo_config.value }} 99 |

100 | {% else %} 101 |

102 |

    103 | {% for item in data.demo_config.value %} 104 |
  • {{ item }}
  • 105 | {% endfor %} 106 |
107 |

108 | {% endif %} 109 |

Data

110 | {% if data.demo_config.data is string %} 111 |

112 | {{ data.demo_config.data }} 113 |

114 | {% else %} 115 |

116 |

    117 | {% for item in data.demo_config.data %} 118 |
  • {{ item }}
  • 119 | {% endfor %} 120 |
121 |

122 | {% endif %} 123 |

Architecture

124 |

125 | This accelerator implements the following technologies: 126 | {% if data.demo_config.architecture is string %} 127 |

128 | {{ data.demo_config.architecture }} 129 |

130 | {% else %} 131 |

132 |

    133 | {% for item in data.demo_config.architecture %} 134 |
  • {{ item }}
  • 135 | {% endfor %} 136 |
137 |

138 | {% endif %} 139 |

140 |
141 |
142 |
143 | {% if data['demo_config']['links']['demo'] %} 144 | 149 | {% endif %} 150 | {% if data['demo_config']['links']['source_code'] %} 151 | 156 | {% endif %} 157 | {% if data['demo_config']['links']['arm_template'] %} 158 | 163 | {% endif %} 164 |
165 |
166 |
167 |
Authors
168 |
169 | {% for author in data['demo_config']['authors'] %} 170 | {{ author.name }}
171 | {% endfor %} 172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 | {% endblock %} 181 | -------------------------------------------------------------------------------- /gallery/docs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/gallery/docs/.gitkeep -------------------------------------------------------------------------------- /gallery/tests/test_use_cases.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import re 3 | import os 4 | from unittest import TestCase 5 | 6 | import requests 7 | import yaml 8 | 9 | __here__ = os.path.dirname(__file__) 10 | CONFIGS_DIR = os.path.join(__here__, '..', 'app', 'demo_configs') 11 | IMG_DIR = os.path.join(__here__, '..', 'app', 'static', 'assets', 'img') 12 | 13 | EXPECTED_YML_KEYS = ( 14 | 'name', 'tagline', 'authors', 'business_problem', 'business_value', 15 | 'accelerator_description', 'modeling_approach_and_training', 'value', 16 | 'data', 'architecture', 'images', 'links' 17 | ) 18 | EXPECTED_AUTHOR_KEYS = ('name', 'github_alias') 19 | EXPECTED_IMAGE_KEYS = ('thumbnail_filename', 'screenshot_filename') 20 | 21 | 22 | def get_yml_files(): 23 | configs_dir_files = os.listdir(CONFIGS_DIR) 24 | yml_files = [ 25 | yml_file for yml_file in configs_dir_files 26 | if yml_file.endswith('.yml') 27 | ] 28 | return yml_files 29 | 30 | 31 | def get_order_files(): 32 | order_filepath = os.path.join(CONFIGS_DIR, '.order') 33 | with open(order_filepath, 'r') as f: 34 | demo_order = [f.strip('\n') for f in f.readlines()] 35 | return demo_order 36 | 37 | 38 | def get_yml_file_data(yml_files): 39 | yml_file_data = {} 40 | for yml_file in yml_files: 41 | with open(os.path.join(CONFIGS_DIR, yml_file), 'r') as f: 42 | yml_file_data[yml_file] = yaml.safe_load(f) 43 | return yml_file_data 44 | 45 | 46 | def get_image_files(): 47 | demo_screenshot_files = os.listdir( 48 | os.path.join(IMG_DIR, 'demo_screenshots') 49 | ) 50 | demo_thumbnail_files = os.listdir( 51 | os.path.join(IMG_DIR, 'demo_thumbnails') 52 | ) 53 | return demo_screenshot_files, demo_thumbnail_files 54 | 55 | 56 | class TestDemoConfigs(TestCase): 57 | def setUp(self): 58 | self.order_files = get_order_files() 59 | self.yml_files = get_yml_files() 60 | self.yml_file_data = get_yml_file_data(self.yml_files) 61 | 62 | def test_use_cases_in_order_file(self): 63 | for yml_file in self.yml_files: 64 | if re.sub('\.yml$', '', yml_file) not in self.order_files: 65 | msg = '{} missing from .order file'.format( 66 | re.sub('\.yml$', '', yml_file) 67 | ) 68 | raise ValueError(msg) 69 | 70 | def test_expected_keys_in_yml_files(self): 71 | for yml_file, yml_data in self.yml_file_data.items(): 72 | for key in EXPECTED_YML_KEYS: 73 | if key not in yml_data: 74 | msg = f'{key} not found in {yml_file} demo config' 75 | raise KeyError(msg) 76 | 77 | def test_valid_authors(self): 78 | for yml_file, yml_data in self.yml_file_data.items(): 79 | for author in yml_data['authors']: 80 | for key in EXPECTED_AUTHOR_KEYS: 81 | if key not in author: 82 | msg = f'Author missing {key} data in {yml_file}' 83 | raise ValueError(msg) 84 | github_alias = author['github_alias'] 85 | response = requests.get(f'https://github.com/{github_alias}') 86 | try: 87 | response.raise_for_status() 88 | except requests.exceptions.HTTPError: 89 | msg = f"Github Alias '{github_alias}' from {yml_file}" 90 | msg += " not found." 91 | raise ValueError(msg) 92 | 93 | def test_images_present(self): 94 | demo_screenshot_files, demo_thumbnail_files = get_image_files() 95 | for yml_file, yml_data in self.yml_file_data.items(): 96 | for key in EXPECTED_IMAGE_KEYS: 97 | if key not in yml_data['images']: 98 | msg = f'Key {key} not found in "images" data for {yml_file}' 99 | raise KeyError(msg) 100 | screenshot = yml_data['images']['screenshot_filename'] 101 | thumbnail = yml_data['images']['thumbnail_filename'] 102 | if screenshot not in demo_screenshot_files: 103 | msg = f'{screenshot} screenshot for {yml_file} not found' 104 | msg += ' in demo_screenshots directory.' 105 | raise ValueError(msg) 106 | if thumbnail not in demo_thumbnail_files: 107 | msg = f'{thumbnail} thumbnail for {yml_file} not found' 108 | msg += ' in demo_thumbnails directory.' 109 | raise ValueError(msg) 110 | 111 | def test_links_valid(self): 112 | for yml_file, yml_data in self.yml_file_data.items(): 113 | for link_type, link in yml_data['links'].items(): 114 | # Dummy link 115 | if link == '#': 116 | continue 117 | # Currently our repo is private so these links return 404 118 | repo_name = 'microsoft/dstoolkit-ai-ux' 119 | github_url = 'https://github.com/' 120 | if link.startswith(github_url + repo_name): 121 | continue 122 | raw_file_url = 'https://raw.githubusercontent.com/' 123 | if link.startswith(raw_file_url + repo_name): 124 | continue 125 | response = requests.get(link) 126 | try: 127 | response.raise_for_status() 128 | except requests.exceptions.HTTPError: 129 | msg = f"{link_type} link {link} for {yml_file}" 130 | msg += " could not be found." 131 | raise ValueError(msg) 132 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9 2 | 3 | ADD app/requirements.txt ./ 4 | RUN pip install -r requirements.txt 5 | RUN pip install gunicorn 6 | 7 | COPY app app 8 | 9 | WORKDIR /app 10 | 11 | ENV PORT 8081 12 | EXPOSE 8081 13 | 14 | ENTRYPOINT ["gunicorn", "--timeout", "600", "--access-logfile", "'-'", "--error-logfile", "'-'", "app:app"] 15 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Deployment 3 | 4 | [![Deploy To Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fdstoolkit-ai-ux%2Fgallery-dev%visualizations%2Fconsumer_analytics%2Fapp%2Fazuredeploy.json) 5 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/app.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | from collections import defaultdict 4 | 5 | import numpy as np 6 | import pandas as pd 7 | from flask import Flask, redirect, render_template, url_for 8 | from lifetimes import BetaGeoFitter, GammaGammaFitter 9 | from lifetimes.datasets import ( 10 | load_cdnow_summary, load_cdnow_summary_data_with_monetary_value) 11 | 12 | 13 | app = Flask(__name__) 14 | __here__ = os.path.dirname(__file__) 15 | CACHE_DIR = os.path.join(__here__, 'cached_data') 16 | CHURN_PROBABILITY_CACHE_PATH = os.path.join( 17 | CACHE_DIR, 'churn_probability.json' 18 | ) 19 | CLV_CACHE_PATH = os.path.join( 20 | CACHE_DIR, 'clv_data.json' 21 | ) 22 | 23 | 24 | def get_trained_beta_geo_fitter(): 25 | data = load_cdnow_summary(index_col=[0]) 26 | bgf = BetaGeoFitter(penalizer_coef=0.0) 27 | bgf.fit(data['frequency'], data['recency'], data['T']) 28 | return bgf 29 | 30 | 31 | def get_trained_gamma_gamma_fitter(): 32 | summary_with_money_value = load_cdnow_summary_data_with_monetary_value() 33 | returning_customers_summary = summary_with_money_value[ 34 | summary_with_money_value['frequency'] > 0 35 | ] 36 | ggf = GammaGammaFitter(penalizer_coef=0) 37 | ggf.fit( 38 | returning_customers_summary['frequency'], 39 | returning_customers_summary['monetary_value'] 40 | ) 41 | return ggf 42 | 43 | 44 | def get_clv(bgf, ggf, customer_data): 45 | customer_data['clv'] = ggf.customer_lifetime_value( 46 | bgf, #the model to use to predict the number of future transactions 47 | customer_data['frequency'], 48 | customer_data['recency'], 49 | customer_data['T'], 50 | customer_data['monetary_value'], 51 | time=12, # months 52 | discount_rate=0.01 # monthly discount rate ~ 12.7% annually 53 | ) 54 | return customer_data 55 | 56 | 57 | def get_customer_data(): 58 | frequency = np.arange(0, 51, 5) 59 | recency = np.arange(0, 41, 2) 60 | average_spend = np.arange(10, 101, 10) 61 | first_transaction = np.arange(0, 41, 2) 62 | max_recency = max(first_transaction) 63 | customer_data = pd.DataFrame( 64 | np.array( 65 | np.meshgrid( 66 | frequency, recency, average_spend, first_transaction 67 | ) 68 | ).T.reshape(-1, 4), 69 | columns=['frequency', 'recency', 'monetary_value', 'T'] 70 | ) 71 | customer_data['recency_invert'] = max_recency - customer_data['recency'] 72 | return customer_data 73 | 74 | 75 | def format_clv_data(clv_data): 76 | tree = lambda: defaultdict(tree) 77 | clv_data_dict = tree() 78 | for _, row in clv_data.iterrows(): 79 | clv_data_dict[ 80 | int(row['frequency']) 81 | ][ 82 | int(row['recency_invert']) 83 | ][ 84 | int(row['T']) 85 | ][ 86 | int(row['monetary_value']) 87 | ] = "%.2f" % row['clv'] 88 | return clv_data_dict 89 | 90 | 91 | def get_data(use_cached=True): 92 | if use_cached: 93 | with open(CHURN_PROBABILITY_CACHE_PATH, 'r') as f: 94 | churn_probability = json.load(f) 95 | with open(CLV_CACHE_PATH, 'r') as f: 96 | clv_data = json.load(f) 97 | else: 98 | bgf = get_trained_beta_geo_fitter() 99 | churn_probability = pd.DataFrame( 100 | bgf.conditional_probability_alive_matrix() 101 | ).apply(lambda x: 1 - x) 102 | churn_probability.index = list( 103 | range( 104 | churn_probability.index.max(), -1, -1 105 | ) 106 | ) 107 | churn_probability = churn_probability.stack().reset_index() 108 | churn_probability.columns = ['y', 'x', 'churn_probability'] 109 | churn_probability['churn_probability'] = round( 110 | churn_probability['churn_probability'] * 100, 111 | 3 112 | ) 113 | customer_data = get_customer_data() 114 | ggf = get_trained_gamma_gamma_fitter() 115 | clv_data = get_clv(bgf, ggf, customer_data) 116 | clv_data = format_clv_data(clv_data) 117 | churn_probability = churn_probability.to_dict(orient='records') 118 | data = { 119 | 'churn_probability': json.dumps(churn_probability, indent=2), 120 | 'clv_data': json.dumps(clv_data) 121 | } 122 | return data 123 | 124 | 125 | @app.route('/customer-analytics', methods=['GET']) 126 | def customer_analytics(): 127 | data = get_data(use_cached=True) 128 | return render_template('customer_analytics.html', data=data) 129 | 130 | 131 | @app.route('/') 132 | def home(): 133 | return render_template('home.html') 134 | 135 | 136 | def main(): 137 | app.run(host='0.0.0.0', port=5001, debug=True) 138 | 139 | 140 | if __name__ == '__main__': 141 | main() 142 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/azuredeploy.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "webAppName": { 6 | "type": "string", 7 | "defaultValue": "[concat('webApp-', uniqueString(resourceGroup().id))]", 8 | "minLength": 2, 9 | "metadata": { 10 | "description": "Web app name." 11 | } 12 | }, 13 | "location": { 14 | "type": "string", 15 | "defaultValue": "[resourceGroup().location]", 16 | "metadata": { 17 | "description": "Location for all resources." 18 | } 19 | }, 20 | "sku": { 21 | "type": "string", 22 | "allowedValues": [ 23 | "F1", 24 | "D1", 25 | "B1", 26 | "B2", 27 | "B3", 28 | "S1", 29 | "S2", 30 | "S3", 31 | "P1", 32 | "P2", 33 | "P3", 34 | "P4" 35 | ], 36 | "defaultValue": "B1", 37 | "metadata": { 38 | "description": "The SKU of App Service Plan." 39 | } 40 | }, 41 | "linuxFxVersion": { 42 | "type": "string", 43 | "defaultValue": "PYTHON|3.7", 44 | "metadata": { 45 | "description": "The Runtime stack of current web app" 46 | } 47 | }, 48 | "repoUrl": { 49 | "type": "string", 50 | "defaultValue": "https://github.com/dstoolkit-ai-ux/tree/gallery-dev/visualizations/consumer_analytics/app", 51 | "metadata": { 52 | "description": "Git Repo URL" 53 | } 54 | }, 55 | "repoBranch": { 56 | "type": "string", 57 | "defaultValue": "gallery-dev", 58 | "metadata": { 59 | "description": "Git Repo branch to deploy" 60 | } 61 | } 62 | }, 63 | "variables": { 64 | "appServicePlanPortalName": "[concat('AppServicePlan-', parameters('webAppName'))]" 65 | }, 66 | "resources": [ 67 | { 68 | "type": "Microsoft.Web/serverfarms", 69 | "apiVersion": "2020-06-01", 70 | "name": "[variables('appServicePlanPortalName')]", 71 | "location": "[parameters('location')]", 72 | "sku": { 73 | "name": "[parameters('sku')]" 74 | }, 75 | "kind": "linux", 76 | "properties": { 77 | "reserved": true 78 | } 79 | }, 80 | { 81 | "type": "Microsoft.Web/sites", 82 | "apiVersion": "2020-06-01", 83 | "name": "[parameters('webAppName')]", 84 | "location": "[parameters('location')]", 85 | 86 | "dependsOn": [ 87 | "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]" 88 | ], 89 | "properties": { 90 | "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]", 91 | "siteConfig": { 92 | "linuxFxVersion": "[parameters('linuxFxVersion')]" 93 | } 94 | }, 95 | "resources": [ 96 | { 97 | "type": "sourcecontrols", 98 | "apiVersion": "2020-06-01", 99 | "name": "web", 100 | "location": "[parameters('location')]", 101 | "dependsOn": [ 102 | "[resourceId('Microsoft.Web/sites', parameters('webAppName'))]" 103 | ], 104 | "properties": { 105 | "repoUrl": "[parameters('repoUrl')]", 106 | "branch": "[parameters('repoBranch')]", 107 | "isManualIntegration": true 108 | } 109 | } 110 | ] 111 | } 112 | ] 113 | } -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/azuredeploy.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.1", 4 | "parameters": { 5 | "webAppName": { 6 | "value": "ds-toolkit-ai-ux-web-app" 7 | }, 8 | "sku": { 9 | "value": "B1" 10 | }, 11 | "linuxFxVersion": { 12 | "value": "PYTHON|3.7" 13 | }, 14 | "repoUrl": { 15 | "value": "https://github.com/microsoft/dstoolkit-ai-ux.git" 16 | }, 17 | "repoBranch": { 18 | "value": "gallery-dev" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/requirements.txt: -------------------------------------------------------------------------------- 1 | flask==2.1.2 2 | lifetimes==0.11.3 3 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/consumer_analytics/app/static/assets/apple-touch-icon.png -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/consumer_analytics/app/static/assets/favicon-16x16.png -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/consumer_analytics/app/static/assets/favicon-32x32.png -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/consumer_analytics/app/static/assets/favicon.ico -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/img/add_to_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/consumer_analytics/app/static/assets/img/add_to_cart.png -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/img/add_to_cart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/img/customer_leaving.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/img/ds_toolkit_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/consumer_analytics/app/static/assets/img/ds_toolkit_logo.png -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/img/ds_toolkit_logo_invert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/consumer_analytics/app/static/assets/img/ds_toolkit_logo_invert.png -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/img/ds_toolkit_logo_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/consumer_analytics/app/static/assets/img/ds_toolkit_logo_square.png -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/assets/img/successful_purchase.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/static/js/scripts.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Start Bootstrap - New Age v6.0.6 (https://startbootstrap.com/theme/new-age) 3 | * Copyright 2013-2022 Start Bootstrap 4 | * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-new-age/blob/master/LICENSE) 5 | */ 6 | // 7 | // Scripts 8 | // 9 | 10 | window.addEventListener('DOMContentLoaded', event => { 11 | 12 | // Activate Bootstrap scrollspy on the main nav element 13 | const mainNav = document.body.querySelector('#mainNav'); 14 | if (mainNav) { 15 | new bootstrap.ScrollSpy(document.body, { 16 | target: '#mainNav', 17 | offset: 74, 18 | }); 19 | }; 20 | 21 | // Collapse responsive navbar when toggler is visible 22 | const navbarToggler = document.body.querySelector('.navbar-toggler'); 23 | const responsiveNavItems = [].slice.call( 24 | document.querySelectorAll('#navbarResponsive .nav-link') 25 | ); 26 | responsiveNavItems.map(function (responsiveNavItem) { 27 | responsiveNavItem.addEventListener('click', () => { 28 | if (window.getComputedStyle(navbarToggler).display !== 'none') { 29 | navbarToggler.click(); 30 | } 31 | }); 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% block head %} 5 | 6 | 7 | 8 | 9 | Consumer Analytics 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {% endblock %} 25 | {% block custom_css %}{% endblock %} 26 | 27 | 28 | 29 | 30 | 52 | {% block content %}{% endblock %} 53 | 54 |
55 |
56 |
57 |
© Microsoft 2022. All Rights Reserved.
58 | Privacy 59 | · 60 | Terms 61 |
62 |
63 |
64 | 65 | 66 | 67 | 68 | {% block custom_js %}{% endblock %} 69 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/templates/customer_analytics.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 4 |
5 | 6 |
7 |
8 |

Customer Analytics

9 |

Customer Churn Analysis

10 | 11 |
12 |
13 |
14 | 15 | 16 |
17 |
18 |
19 | 20 |
21 | 22 |
23 |
24 |
25 |

As the churn probability of a customer increases, consider marketing intervention to prevent customer churn. Continue below to customer lieftime value to determine how much you should consider spending on marketing.

26 |
27 |
28 | 29 |
30 |
31 |
32 |
33 |

Customer Lifetime Value

34 |

Select some values below to see the expected customer lifetime value:

35 |
36 |
37 | 38 | 39 |

40 |
41 |
42 |
43 | 44 | 45 |

46 |
47 |
48 |
49 | 50 | 51 |

52 |
53 |
54 |
55 | 56 | 57 |

58 |
59 |
60 |
61 |
62 |
Customer Lifetime Value
63 |
64 |

£180.00

65 |
66 |
67 |
68 |
69 |
...
70 |
71 |
72 |
73 |
74 |
75 | {% endblock %} 76 | {% block custom_js %} 77 | 143 | 187 | {% endblock %} 188 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/app/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 4 | 5 |
6 |
7 |
8 |
9 | 10 |
11 |

Consumer Analytics

12 |

Learn more about your customers today, how likely are they to churn and what will their customer lifetime value be?

13 | 16 |
17 |
18 |
19 |
20 | 21 |
22 | 23 |
24 |
25 |
26 |
27 |
28 | {% endblock %} 29 | 30 | -------------------------------------------------------------------------------- /visualizations/consumer_analytics/docs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/consumer_analytics/docs/.gitkeep -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9 2 | 3 | ADD app/requirements.txt ./ 4 | RUN pip install -r requirements.txt 5 | 6 | COPY app app 7 | 8 | WORKDIR /app 9 | 10 | ENV PORT 8080 11 | 12 | EXPOSE 8080 13 | 14 | ENTRYPOINT [ "streamlit", "run", "dashboard.py", "--server.port", "8080" ] 15 | -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Deployment 3 | 4 | [![Deploy To Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fdstoolkit-ai-ux%2Fgallery-dev%visualizations%2Fmanufacturing_analytics%2Fapp%2Fazuredeploy.json) 5 | -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/app/azuredeploy.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "webAppName": { 6 | "type": "string", 7 | "defaultValue": "[concat('webApp-', uniqueString(resourceGroup().id))]", 8 | "minLength": 2, 9 | "metadata": { 10 | "description": "Web app name." 11 | } 12 | }, 13 | "location": { 14 | "type": "string", 15 | "defaultValue": "[resourceGroup().location]", 16 | "metadata": { 17 | "description": "Location for all resources." 18 | } 19 | }, 20 | "sku": { 21 | "type": "string", 22 | "allowedValues": [ 23 | "F1", 24 | "D1", 25 | "B1", 26 | "B2", 27 | "B3", 28 | "S1", 29 | "S2", 30 | "S3", 31 | "P1", 32 | "P2", 33 | "P3", 34 | "P4" 35 | ], 36 | "defaultValue": "B1", 37 | "metadata": { 38 | "description": "The SKU of App Service Plan." 39 | } 40 | }, 41 | "linuxFxVersion": { 42 | "type": "string", 43 | "defaultValue": "PYTHON|3.7", 44 | "metadata": { 45 | "description": "The Runtime stack of current web app" 46 | } 47 | }, 48 | "repoUrl": { 49 | "type": "string", 50 | "defaultValue": "https://github.com/dstoolkit-ai-ux/tree/gallery-dev/visualizations/manufacturing_analtyics/app", 51 | "metadata": { 52 | "description": "Git Repo URL" 53 | } 54 | }, 55 | "repoBranch": { 56 | "type": "string", 57 | "defaultValue": "gallery-dev", 58 | "metadata": { 59 | "description": "Git Repo branch to deploy" 60 | } 61 | } 62 | }, 63 | "variables": { 64 | "appServicePlanPortalName": "[concat('AppServicePlan-', parameters('webAppName'))]" 65 | }, 66 | "resources": [ 67 | { 68 | "type": "Microsoft.Web/serverfarms", 69 | "apiVersion": "2020-06-01", 70 | "name": "[variables('appServicePlanPortalName')]", 71 | "location": "[parameters('location')]", 72 | "sku": { 73 | "name": "[parameters('sku')]" 74 | }, 75 | "kind": "linux", 76 | "properties": { 77 | "reserved": true 78 | } 79 | }, 80 | { 81 | "type": "Microsoft.Web/sites", 82 | "apiVersion": "2020-06-01", 83 | "name": "[parameters('webAppName')]", 84 | "location": "[parameters('location')]", 85 | 86 | "dependsOn": [ 87 | "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]" 88 | ], 89 | "properties": { 90 | "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]", 91 | "siteConfig": { 92 | "linuxFxVersion": "[parameters('linuxFxVersion')]" 93 | } 94 | }, 95 | "resources": [ 96 | { 97 | "type": "sourcecontrols", 98 | "apiVersion": "2020-06-01", 99 | "name": "web", 100 | "location": "[parameters('location')]", 101 | "dependsOn": [ 102 | "[resourceId('Microsoft.Web/sites', parameters('webAppName'))]" 103 | ], 104 | "properties": { 105 | "repoUrl": "[parameters('repoUrl')]", 106 | "branch": "[parameters('repoBranch')]", 107 | "isManualIntegration": true 108 | } 109 | } 110 | ] 111 | }, 112 | { 113 | "type": "Microsoft.Web/sites/config", 114 | "apiVersion": "2021-03-01", 115 | "name": "[concat(parameters('webAppName'), '/web')]", 116 | "location": "[parameters('location')]", 117 | "dependsOn": [ 118 | "[resourceId('Microsoft.Web/sites', parameters('webAppName'))]" 119 | ], 120 | "properties": { 121 | "appCommandLine": "python -m streamlit run dashboard.py --server.port 8000 --server.address 0.0.0.0" 122 | } 123 | } 124 | ] 125 | } -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/app/config_data.toml: -------------------------------------------------------------------------------- 1 | [datasets] # Toy datasets 2 | [datasets.Manufacturing] 3 | name = "Machine Consumption" 4 | url = "" 5 | date = "date" 6 | date_format = "%Y-%m-%d" 7 | columns = ["energy", "condition", "volume", "weight","machine_id","speed"] 8 | target = "energy" 9 | 10 | 11 | [plots] 12 | colors = ["#002244", "#ff0066", "#66cccc", "#ff9933", "#337788", 13 | "#429e79", "#474747", "#f7d126", "#ee5eab", "#b8b8b8"] # Color palette for visualizations 14 | color_axis = '#d62728' # Color for axis on residuals chart and scatter plot 15 | waterfall_digits = 2 # Number of digits in waterfall chart 16 | -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/app/dashboard.py: -------------------------------------------------------------------------------- 1 | # Info 2 | import streamlit as st 3 | import pandas as pd 4 | import plotly.express as px 5 | import plotly.graph_objects as go 6 | import joblib 7 | import numpy as np 8 | 9 | st.set_page_config(layout="wide") 10 | 11 | 12 | @st.cache 13 | def load_data(path=''): 14 | if path: 15 | return pd.read_csv(path) 16 | else: 17 | return pd.read_csv('./datasets/energy_consumption.csv') 18 | 19 | 20 | @st.cache(allow_output_mutation=False) 21 | def load_models(): 22 | return joblib.load('list_models.pkl') 23 | 24 | @st.cache(allow_output_mutation=True) 25 | def generate_plan(df): 26 | import random 27 | import datetime 28 | 29 | 30 | starting_date = pd.Timestamp(datetime.datetime.now()).round('H') 31 | dates = pd.date_range(start=starting_date, end=starting_date+pd.Timedelta('5days'),freq='1H') 32 | 33 | df_plan = pd.DataFrame() 34 | for m in df['machine_id'].unique(): 35 | select_sample = [random.choice([True, False]) for x in dates] 36 | 37 | df_sample = df.query(f'machine_id=="{m}"').sample(len(dates)) 38 | df_sample['date'] = dates 39 | df_sample = df_sample.iloc[select_sample,:] 40 | 41 | model = dict_models[m]['model'] 42 | df_sample['energy_prediction'] = model.predict(df_sample[["volume","weight","speed"]]) 43 | df_plan = pd.concat([df_plan,df_sample]) 44 | return df_plan 45 | 46 | @st.cache 47 | def generate_default_values(df): 48 | return df.sample(1)[info].values.tolist()[0] 49 | 50 | 51 | df = load_data() 52 | df = df[['machine_id','energy','speed','volume','weight']].copy() 53 | list_machines = df['machine_id'].unique() 54 | list_machines = list(sorted(list_machines)) 55 | 56 | dict_models = load_models() 57 | list_models = list(dict_models.keys()) 58 | 59 | 60 | st.write( 61 | """ 62 | # Sustainable Manufacturing through AI 63 | 64 | This app shows how manufacturing companies can leverage AI to become more sustainable. 65 | This use-case show how operation team can predict the energy consumption of their machines based on operational features. 66 | """ 67 | ) 68 | 69 | st.write("") 70 | 71 | # st.sidebar.image("./microsoft.png", use_column_width=True) 72 | st.sidebar.image("./ds-toolkit-logo.png", use_column_width=True) 73 | 74 | st.sidebar.title("Select View") 75 | 76 | 77 | genre = st.sidebar.radio( 78 | "Wireframe", 79 | ('Analytics', 80 | 'AI Service', 81 | # 'Data I/O' 82 | )) 83 | 84 | 85 | if genre == "Analytics": 86 | 87 | st.write("") 88 | st.write('# Analytics Wireframe') 89 | st.write("") 90 | st.dataframe(df) 91 | 92 | st.markdown("""---""") 93 | 94 | st.write('## Some interesting plots') 95 | 96 | m_id = st.selectbox('select machine',list_machines) 97 | 98 | st.write(f'### Showing plots for machine {m_id}') 99 | 100 | df_machine = df.query(f'machine_id =="{m_id}"') 101 | 102 | 103 | col1, col2 = st.columns(2) 104 | col3, col4 = st.columns(2) 105 | 106 | with col1: 107 | st.markdown('#### Histogram') 108 | fig_hist = px.histogram(df_machine, x='energy',title='Energy Distribution') 109 | st.plotly_chart(fig_hist, use_container_width=True) 110 | 111 | with col2: 112 | st.markdown('#### Scatter') 113 | # fig_scatter = px.scatter(df_machine, x="speed", y='energy',title='Energy consumption based on machine speed') 114 | fig_scatter = px.scatter_matrix(df_machine, 115 | dimensions=["speed", "weight", "volume"], 116 | color="energy", 117 | title="Feature interaction", 118 | ) 119 | 120 | fig_scatter.update_traces(diagonal_visible=False) 121 | st.plotly_chart(fig_scatter, use_container_width=True) 122 | 123 | with col3: 124 | st.markdown('#### Correlation Map') 125 | corr = df_machine.select_dtypes(include=np.number).corr() 126 | mask = np.triu(np.ones_like(corr, dtype=bool)) 127 | fig_heatmap = go.Figure(data=go.Heatmap(z=corr.mask(mask),x=corr.columns,y=corr.columns,zmin=-1,zmax=1)) 128 | fig_heatmap.update_xaxes(side="top") 129 | fig_heatmap.update_layout( 130 | xaxis_showgrid=False, 131 | yaxis_showgrid=False, 132 | xaxis_zeroline=False, 133 | yaxis_zeroline=False, 134 | yaxis_autorange='reversed', 135 | template='plotly_white' 136 | ) 137 | st.plotly_chart(fig_heatmap, use_container_width=True) 138 | 139 | 140 | with col4: 141 | st.markdown('#### 3D Scatter') 142 | fig_3dscatter = px.scatter_3d(df_machine, x='speed', y='volume', z='weight', 143 | color='energy', size_max=18,#size='energy', 144 | opacity=0.7) 145 | st.plotly_chart(fig_3dscatter, use_container_width=True) 146 | 147 | elif genre == 'AI Service': 148 | 149 | st.write("") 150 | st.write('# AI Service Wireframe') 151 | st.write("Predict the hourly total energy consumption for a week") 152 | 153 | df_plan = generate_plan(df=df) 154 | 155 | st.dataframe(df_plan) 156 | 157 | st.write('') 158 | st.write('Show 5-days energy consumption based on scheduling') 159 | df_agg = df_plan.groupby('date').sum(numeric_only=True).reset_index() 160 | df_max = df_agg.loc[df_agg['energy_prediction'].idxmax()] 161 | 162 | max_energy = df_max['energy_prediction'].round(1) 163 | max_date = df_max.date 164 | fig = px.bar(df_plan, x="date", y="energy_prediction", color="machine_id", text_auto=True) 165 | 166 | fig.update_xaxes(rangeslider_visible=True) 167 | 168 | fig.add_shape( 169 | type='line', 170 | x0=df_plan['date'].min(), 171 | y0=max_energy, 172 | x1=df_plan['date'].max(), 173 | y1=max_energy, 174 | line=dict(color='Red'), 175 | name="test" 176 | ) 177 | 178 | fig.add_trace(go.Scatter( 179 | x=[max_date, max_date], 180 | y=[max_energy], 181 | name = f"Highest Consumption: {max_energy} kWh" 182 | )) 183 | 184 | st.plotly_chart(fig, use_container_width=True) 185 | 186 | if st.button('Refresh plan'): 187 | st.legacy_caching.clear_cache() 188 | st.experimental_rerun() 189 | 190 | st.markdown("""---""") 191 | 192 | st.write('## Predict the energy consumption') 193 | st.write ('##### Choose your operation parameters:') 194 | info = ["volume","weight","speed"] 195 | 196 | cols = st.columns(len(info)+1) 197 | option = cols[0].selectbox('Select machine',list_machines) 198 | default_val = generate_default_values(df) 199 | result_input = [] 200 | for i in range(len(info)): 201 | user_input = cols[i+1].slider( 202 | label=info[i], 203 | value=int(default_val[i]), 204 | min_value=int(df[info[i]].min()), 205 | max_value=int(df[info[i]].max()), 206 | ) 207 | result_input.append(float(user_input)) 208 | 209 | 210 | prediction = 0.0 211 | if st.button('Calculate Energy Consumption'): 212 | if len(result_input) == len(info): 213 | data_prediction = pd.DataFrame([result_input], columns = info) 214 | model = dict_models[option]['model'] 215 | prediction = model.predict(data_prediction)[0] 216 | 217 | st.metric("Energy Consumption (kWh)", np.round(prediction,1)) 218 | 219 | # else: 220 | # st.write("") 221 | # st.write('# Data I/O Wireframe') 222 | # st.write(f"Import your own data. The dataset file needs to contain the following columns: {df.columns.tolist()}") 223 | # uploaded_file = st.file_uploader("Choose a file") 224 | 225 | # if uploaded_file is not None: 226 | # df = pd.read_csv(uploaded_file) 227 | # st.dataframe(df) 228 | # st.write("You can now go back to previous page and review your plan") -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/app/ds-toolkit-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/manufacturing_analytics/app/ds-toolkit-logo.png -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/app/list_models.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/manufacturing_analytics/app/list_models.pkl -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/app/notebooks/Data - generation.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 82, 16 | "metadata": {}, 17 | "outputs": [], 18 | "source": [ 19 | "df = pd.read_csv('../datasets/energy_consumption.csv')\n" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": 83, 25 | "metadata": {}, 26 | "outputs": [ 27 | { 28 | "data": { 29 | "text/plain": [ 30 | "Index(['energy', 'condition', 'volume', 'weight', 'machine_id', 'speed'], dtype='object')" 31 | ] 32 | }, 33 | "execution_count": 83, 34 | "metadata": {}, 35 | "output_type": "execute_result" 36 | } 37 | ], 38 | "source": [ 39 | "df.columns" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": 84, 45 | "metadata": {}, 46 | "outputs": [], 47 | "source": [ 48 | "for c in ['condition','volume', 'weight', 'machine_id', 'speed']:\n", 49 | " df[c] = pd.Categorical(df[c])" 50 | ] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": 85, 55 | "metadata": {}, 56 | "outputs": [], 57 | "source": [ 58 | "for c in ['volume', 'weight', 'speed']:\n", 59 | " df[c] = df[c].cat.codes\n", 60 | " df[c] = df[c] .astype(int)" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": 92, 66 | "metadata": {}, 67 | "outputs": [], 68 | "source": [ 69 | "df['condition'] = 'C000'+df['condition'].str.upper()" 70 | ] 71 | }, 72 | { 73 | "cell_type": "code", 74 | "execution_count": 88, 75 | "metadata": {}, 76 | "outputs": [], 77 | "source": [ 78 | "df['energy'] = (df['energy'] * df['energy'] / 10).round(1) \n" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": 89, 84 | "metadata": {}, 85 | "outputs": [], 86 | "source": [ 87 | "df['speed'] = ((df['speed'] + 100)**2 / 100)" 88 | ] 89 | }, 90 | { 91 | "cell_type": "code", 92 | "execution_count": 97, 93 | "metadata": {}, 94 | "outputs": [], 95 | "source": [ 96 | "df['volume'] = (df['energy'] / 100 + 20 + np.random.normal(10,5,df['energy'].shape[0])).round()" 97 | ] 98 | }, 99 | { 100 | "cell_type": "code", 101 | "execution_count": 151, 102 | "metadata": {}, 103 | "outputs": [], 104 | "source": [ 105 | "df['weight'] = (df['energy'] / 100 + 5 + np.random.normal(2,1,df['energy'].shape[0])).round()\n", 106 | "\n", 107 | "df['volume'] = (df['energy'] / 10 + 5 + np.random.normal(2,1,df['energy'].shape[0])).round()\n", 108 | "\n", 109 | "df['speed'] = (1/(df['energy']+np.random.normal(0,5,df['energy'].shape[0]))*10000).round(1)\n" 110 | ] 111 | }, 112 | { 113 | "cell_type": "code", 114 | "execution_count": 154, 115 | "metadata": {}, 116 | "outputs": [], 117 | "source": [ 118 | "df['machine_id'] = df['machine_id'].replace({'c': 'M1', 'f': 'M2', 'a':'M3','d':'M4', 'g':'M5'})" 119 | ] 120 | }, 121 | { 122 | "cell_type": "code", 123 | "execution_count": 155, 124 | "metadata": {}, 125 | "outputs": [ 126 | { 127 | "data": { 128 | "text/html": [ 129 | "
\n", 130 | "\n", 143 | "\n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | " \n", 234 | " \n", 235 | " \n", 236 | " \n", 237 | " \n", 238 | " \n", 239 | " \n", 240 | " \n", 241 | " \n", 242 | " \n", 243 | " \n", 244 | " \n", 245 | " \n", 246 | " \n", 247 | " \n", 248 | " \n", 249 | " \n", 250 | " \n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | "
energyconditionvolumeweightmachine_idspeed
01711.1C000K179.025.0M35.9
1581.6C000AZ63.013.0M116.9
2650.0C000AZ71.012.0M215.1
3608.7C000AZ68.013.0M216.7
4863.6C000T94.017.0M111.7
.....................
39801153.3C000AK123.017.0M18.7
39811183.1C000J126.019.0M48.5
39821192.9C000AK126.019.0M38.5
3983765.3C000AL82.014.0M213.0
39841228.8C000Z128.020.0M18.2
\n", 257 | "

3985 rows × 6 columns

\n", 258 | "
" 259 | ], 260 | "text/plain": [ 261 | " energy condition volume weight machine_id speed\n", 262 | "0 1711.1 C000K 179.0 25.0 M3 5.9\n", 263 | "1 581.6 C000AZ 63.0 13.0 M1 16.9\n", 264 | "2 650.0 C000AZ 71.0 12.0 M2 15.1\n", 265 | "3 608.7 C000AZ 68.0 13.0 M2 16.7\n", 266 | "4 863.6 C000T 94.0 17.0 M1 11.7\n", 267 | "... ... ... ... ... ... ...\n", 268 | "3980 1153.3 C000AK 123.0 17.0 M1 8.7\n", 269 | "3981 1183.1 C000J 126.0 19.0 M4 8.5\n", 270 | "3982 1192.9 C000AK 126.0 19.0 M3 8.5\n", 271 | "3983 765.3 C000AL 82.0 14.0 M2 13.0\n", 272 | "3984 1228.8 C000Z 128.0 20.0 M1 8.2\n", 273 | "\n", 274 | "[3985 rows x 6 columns]" 275 | ] 276 | }, 277 | "execution_count": 155, 278 | "metadata": {}, 279 | "output_type": "execute_result" 280 | } 281 | ], 282 | "source": [ 283 | "df" 284 | ] 285 | }, 286 | { 287 | "cell_type": "code", 288 | "execution_count": 156, 289 | "metadata": {}, 290 | "outputs": [], 291 | "source": [ 292 | "df.to_csv('../datasets/energy_consumption.csv',index=False)" 293 | ] 294 | }, 295 | { 296 | "cell_type": "code", 297 | "execution_count": null, 298 | "metadata": {}, 299 | "outputs": [], 300 | "source": [] 301 | } 302 | ], 303 | "metadata": { 304 | "kernelspec": { 305 | "display_name": "Python 3.10.8 ('env-exp')", 306 | "language": "python", 307 | "name": "python3" 308 | }, 309 | "language_info": { 310 | "codemirror_mode": { 311 | "name": "ipython", 312 | "version": 3 313 | }, 314 | "file_extension": ".py", 315 | "mimetype": "text/x-python", 316 | "name": "python", 317 | "nbconvert_exporter": "python", 318 | "pygments_lexer": "ipython3", 319 | "version": "3.10.8" 320 | }, 321 | "orig_nbformat": 4, 322 | "vscode": { 323 | "interpreter": { 324 | "hash": "f9ea5abf22a07b85e9bf9a5b4559740fd04a2c83982993619f47f79687ac8ab1" 325 | } 326 | } 327 | }, 328 | "nbformat": 4, 329 | "nbformat_minor": 2 330 | } 331 | -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/app/notebooks/Model - training.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "from sklearn.model_selection import train_test_split\n", 12 | "import sklearn.metrics as sm\n", 13 | "from sklearn.linear_model import ElasticNet\n", 14 | "import joblib\n", 15 | "\n", 16 | "import random\n", 17 | "import datetime\n" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 2, 23 | "metadata": {}, 24 | "outputs": [], 25 | "source": [ 26 | "df = pd.read_csv('../datasets/energy_consumption.csv')\n" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": 3, 32 | "metadata": {}, 33 | "outputs": [ 34 | { 35 | "data": { 36 | "text/plain": [ 37 | "array(['M3', 'M1', 'M2', 'M4', 'M5'], dtype=object)" 38 | ] 39 | }, 40 | "execution_count": 3, 41 | "metadata": {}, 42 | "output_type": "execute_result" 43 | } 44 | ], 45 | "source": [ 46 | "df['machine_id'].unique()" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": 8, 52 | "metadata": {}, 53 | "outputs": [], 54 | "source": [ 55 | "dict_model = {}\n", 56 | "\n", 57 | "for machine in df['machine_id'].unique():\n", 58 | " \n", 59 | " df_tmp = df.query(f'machine_id == \"{machine}\"').copy()\n", 60 | " X = df_tmp.drop(['energy','condition','machine_id'],axis=1).copy()\n", 61 | " y = df_tmp['energy'].copy()\n", 62 | " \n", 63 | " \n", 64 | " X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=1)\n", 65 | " \n", 66 | " model = ElasticNet()\n", 67 | " model.fit(X_train,y_train)\n", 68 | " y_pred = model.predict(X_test)\n", 69 | " score = sm.r2_score(y_test,y_pred)\n", 70 | " dict_model[machine] = {'model':model, 'r2': score}\n" 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": 9, 76 | "metadata": {}, 77 | "outputs": [], 78 | "source": [ 79 | "with open('../list_models.pkl','wb') as f_out:\n", 80 | " joblib.dump(dict_model,f_out)" 81 | ] 82 | }, 83 | { 84 | "attachments": {}, 85 | "cell_type": "markdown", 86 | "metadata": {}, 87 | "source": [ 88 | "### Test model on dummy data" 89 | ] 90 | }, 91 | { 92 | "cell_type": "code", 93 | "execution_count": 10, 94 | "metadata": {}, 95 | "outputs": [], 96 | "source": [ 97 | "starting_date = pd.Timestamp(datetime.datetime.now()).round('H')" 98 | ] 99 | }, 100 | { 101 | "cell_type": "code", 102 | "execution_count": 11, 103 | "metadata": {}, 104 | "outputs": [], 105 | "source": [ 106 | "dates = pd.date_range(start=starting_date, end=starting_date+pd.Timedelta('7days'),freq='1H')" 107 | ] 108 | }, 109 | { 110 | "cell_type": "code", 111 | "execution_count": 12, 112 | "metadata": {}, 113 | "outputs": [], 114 | "source": [ 115 | "dict_plan = {}\n", 116 | "for m in df['machine_id'].unique():\n", 117 | " select_sample = [random.choice([True, False]) for x in dates]\n", 118 | " dict_plan[m] = df.query(f'machine_id==\"{m}\"').sample(len(dates)).iloc[select_sample,:]" 119 | ] 120 | }, 121 | { 122 | "cell_type": "code", 123 | "execution_count": 13, 124 | "metadata": {}, 125 | "outputs": [ 126 | { 127 | "data": { 128 | "text/html": [ 129 | "
\n", 130 | "\n", 143 | "\n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | " \n", 234 | " \n", 235 | " \n", 236 | " \n", 237 | " \n", 238 | " \n", 239 | " \n", 240 | " \n", 241 | " \n", 242 | " \n", 243 | " \n", 244 | " \n", 245 | " \n", 246 | " \n", 247 | " \n", 248 | " \n", 249 | " \n", 250 | " \n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | "
energyconditionvolumeweightmachine_idspeed
3404820.7C000Z89.014.0M512.2
1409830.1C000O90.015.0M512.0
3749741.3C000E81.015.0M513.4
32561304.8C000F137.019.0M57.7
487890.2C000Z96.016.0M511.3
.....................
4511177.9C000W125.022.0M58.5
300784.8C000Z87.014.0M512.8
24321179.8C000X127.020.0M58.5
3317921.2C000Y98.015.0M510.8
33121125.7C000AK120.020.0M58.9
\n", 257 | "

93 rows × 6 columns

\n", 258 | "
" 259 | ], 260 | "text/plain": [ 261 | " energy condition volume weight machine_id speed\n", 262 | "3404 820.7 C000Z 89.0 14.0 M5 12.2\n", 263 | "1409 830.1 C000O 90.0 15.0 M5 12.0\n", 264 | "3749 741.3 C000E 81.0 15.0 M5 13.4\n", 265 | "3256 1304.8 C000F 137.0 19.0 M5 7.7\n", 266 | "487 890.2 C000Z 96.0 16.0 M5 11.3\n", 267 | "... ... ... ... ... ... ...\n", 268 | "451 1177.9 C000W 125.0 22.0 M5 8.5\n", 269 | "300 784.8 C000Z 87.0 14.0 M5 12.8\n", 270 | "2432 1179.8 C000X 127.0 20.0 M5 8.5\n", 271 | "3317 921.2 C000Y 98.0 15.0 M5 10.8\n", 272 | "3312 1125.7 C000AK 120.0 20.0 M5 8.9\n", 273 | "\n", 274 | "[93 rows x 6 columns]" 275 | ] 276 | }, 277 | "execution_count": 13, 278 | "metadata": {}, 279 | "output_type": "execute_result" 280 | } 281 | ], 282 | "source": [ 283 | "dict_plan[m]" 284 | ] 285 | }, 286 | { 287 | "cell_type": "code", 288 | "execution_count": null, 289 | "metadata": {}, 290 | "outputs": [], 291 | "source": [] 292 | } 293 | ], 294 | "metadata": { 295 | "kernelspec": { 296 | "display_name": "Python 3.10.8 ('env-exp')", 297 | "language": "python", 298 | "name": "python3" 299 | }, 300 | "language_info": { 301 | "codemirror_mode": { 302 | "name": "ipython", 303 | "version": 3 304 | }, 305 | "file_extension": ".py", 306 | "mimetype": "text/x-python", 307 | "name": "python", 308 | "nbconvert_exporter": "python", 309 | "pygments_lexer": "ipython3", 310 | "version": "3.10.8" 311 | }, 312 | "orig_nbformat": 4, 313 | "vscode": { 314 | "interpreter": { 315 | "hash": "f9ea5abf22a07b85e9bf9a5b4559740fd04a2c83982993619f47f79687ac8ab1" 316 | } 317 | } 318 | }, 319 | "nbformat": 4, 320 | "nbformat_minor": 2 321 | } 322 | -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/app/requirements.txt: -------------------------------------------------------------------------------- 1 | joblib==1.2.0 2 | plotly==5.8.0 3 | scikit-learn==1.0.2 4 | streamlit==1.11.1 5 | -------------------------------------------------------------------------------- /visualizations/manufacturing_analytics/docs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/dstoolkit-ai-ux/2000f5e7dd147ee5a93f7f92b2422136d01d5416/visualizations/manufacturing_analytics/docs/.gitkeep --------------------------------------------------------------------------------