├── .flake8 ├── .github ├── ISSUE_TEMPLATE │ └── custom-template.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── python-package.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── data ├── greenhouse.pred ├── greenhouse.real ├── lstm_ad.pred ├── lstm_ad.real ├── luminol.pred └── luminol.real ├── examples ├── example.png └── precision_recall_for_time_series.py ├── poetry.lock ├── prts ├── __init__.py ├── base │ ├── __init__.py │ └── time_series_metrics.py └── time_series_metrics │ ├── __init__.py │ ├── fscore.py │ ├── precision.py │ ├── precision_recall.py │ └── recall.py ├── pyproject.toml └── tests ├── test_fscore.py ├── test_interfaces.py ├── test_precision.py ├── test_precision_recall.py └── test_recall.py /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 119 3 | ignore = E121,E123,E126,E133,E226,E241,E242,E704,W503,W504,W505,E127,E203,E266,E402,W605,W391,E701,E731 4 | per-file-ignores = __init__.py:F401 5 | exclude = 6 | .git 7 | __pycache__ 8 | setup.py 9 | build 10 | dist 11 | releases 12 | .venv 13 | .tox 14 | .mypy_cache 15 | .pytest_cache 16 | .vscode 17 | .github 18 | poetry/utils/_compat.py 19 | poetry/utils/env_scripts/tags.py 20 | tests/fixtures/ 21 | tests/repositories/fixtures/ 22 | tests/utils/fixtures/ 23 | 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom Template 3 | about: our issue template. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Summary 11 | Describe this issue summary here. 12 | 13 | ## Goal 14 | Describe the definition by which this issue will be closed. 15 | 16 | ## Todo 17 | - [ ] task1 to do 18 | - [ ] task2 to do 19 | 20 | ## Deadline 21 | yyyy / mm / dd 22 | 23 | ## Parent issue 24 | If the parent issue exists, post a link here. 25 | 26 | ## References 27 | If there are any reference links, they are described here. 28 | 29 | ## Notes 30 | Other comments. 31 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Summary 2 | 3 | Describe this pull request summary here. 4 | 5 | ## Goal 6 | 7 | Describe the definition by which this pull request will be merged. 8 | 9 | ## Checklist 10 | * [ ] task1 to check 11 | * [ ] task2 to check 12 | 13 | ## Deadline 14 | xx/xx 15 | 16 | ## Corresponding issue 17 | If the corresponding issue exists, post a link here. 18 | 19 | ## References 20 | If there are any reference links, they are described here. 21 | 22 | ## Notes 23 | Other comments. 24 | -------------------------------------------------------------------------------- /.github/workflows/python-package.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a variety of Python versions 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 3 | 4 | name: Python package 5 | 6 | on: 7 | push: 8 | branches: [ main ] 9 | pull_request: 10 | branches: [ main ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | strategy: 17 | matrix: 18 | python-version: ['3.8'] 19 | 20 | steps: 21 | - uses: actions/checkout@v2 22 | - name: Set up Python ${{ matrix.python-version }} 23 | uses: actions/setup-python@v2 24 | with: 25 | python-version: ${{ matrix.python-version }} 26 | - name: Install dependencies 27 | run: | 28 | python -m pip install --upgrade pip 29 | python -m pip install poetry 30 | poetry install 31 | - name: Lint with flake8 32 | run: | 33 | poetry run python -m flake8 prts 34 | poetry run python -m autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive prts 35 | poetry run python -m isort prts 36 | poetry run python -m black --line-length=119 prts 37 | - name: Test with pytest 38 | run: | 39 | poetry run python -m pytest --durations=0 --cov=prts tests 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/python,vscode 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=python,vscode 4 | 5 | ### Python ### 6 | # Byte-compiled / optimized / DLL files 7 | __pycache__/ 8 | *.py[cod] 9 | *$py.class 10 | 11 | # C extensions 12 | *.so 13 | 14 | # Distribution / packaging 15 | .Python 16 | build/ 17 | develop-eggs/ 18 | dist/ 19 | downloads/ 20 | eggs/ 21 | .eggs/ 22 | lib/ 23 | lib64/ 24 | parts/ 25 | sdist/ 26 | var/ 27 | wheels/ 28 | pip-wheel-metadata/ 29 | share/python-wheels/ 30 | *.egg-info/ 31 | .installed.cfg 32 | *.egg 33 | MANIFEST 34 | 35 | # PyInstaller 36 | # Usually these files are written by a python script from a template 37 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 38 | *.manifest 39 | *.spec 40 | 41 | # Installer logs 42 | pip-log.txt 43 | pip-delete-this-directory.txt 44 | 45 | # Unit test / coverage reports 46 | htmlcov/ 47 | .tox/ 48 | .nox/ 49 | .coverage 50 | .coverage.* 51 | .cache 52 | nosetests.xml 53 | coverage.xml 54 | *.cover 55 | *.py,cover 56 | .hypothesis/ 57 | .pytest_cache/ 58 | pytestdebug.log 59 | 60 | # Translations 61 | *.mo 62 | *.pot 63 | 64 | # Django stuff: 65 | *.log 66 | local_settings.py 67 | db.sqlite3 68 | db.sqlite3-journal 69 | 70 | # Flask stuff: 71 | instance/ 72 | .webassets-cache 73 | 74 | # Scrapy stuff: 75 | .scrapy 76 | 77 | # Sphinx documentation 78 | docs/_build/ 79 | doc/_build/ 80 | 81 | # PyBuilder 82 | target/ 83 | 84 | # Jupyter Notebook 85 | .ipynb_checkpoints 86 | 87 | # IPython 88 | profile_default/ 89 | ipython_config.py 90 | 91 | # pyenv 92 | .python-version 93 | 94 | # pipenv 95 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 96 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 97 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 98 | # install all needed dependencies. 99 | #Pipfile.lock 100 | 101 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 102 | __pypackages__/ 103 | 104 | # Celery stuff 105 | celerybeat-schedule 106 | celerybeat.pid 107 | 108 | # SageMath parsed files 109 | *.sage.py 110 | 111 | # Environments 112 | .env 113 | .venv 114 | env/ 115 | venv/ 116 | ENV/ 117 | env.bak/ 118 | venv.bak/ 119 | pythonenv* 120 | 121 | # Spyder project settings 122 | .spyderproject 123 | .spyproject 124 | 125 | # Rope project settings 126 | .ropeproject 127 | 128 | # mkdocs documentation 129 | /site 130 | 131 | # mypy 132 | .mypy_cache/ 133 | .dmypy.json 134 | dmypy.json 135 | 136 | # Pyre type checker 137 | .pyre/ 138 | 139 | # pytype static type analyzer 140 | .pytype/ 141 | 142 | # profiling data 143 | .prof 144 | 145 | ### vscode ### 146 | .vscode/* 147 | !.vscode/settings.json 148 | !.vscode/tasks.json 149 | !.vscode/launch.json 150 | !.vscode/extensions.json 151 | *.code-workspace 152 | 153 | # End of https://www.toptal.com/developers/gitignore/api/python,vscode -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | default: | help 2 | 3 | POETRY_RUN := poetry run 4 | PYTHON := $(POETRY_RUN) python 5 | 6 | # ------------------------- 7 | # install 8 | # ------------------------- 9 | .PHONY: install 10 | install: ## install this project 11 | pip install poetry 12 | poetry install --no-dev 13 | 14 | .PHONY: develop 15 | develop: ## setup project for development 16 | pip install poetry 17 | poetry install 18 | 19 | # ------------------------- 20 | # test 21 | # ------------------------- 22 | .PHONY: unittest 23 | unittest: ## run unit test for api with coverage 24 | $(PYTHON) -m pytest -v --durations=0 --cov-report=term-missing --cov=prts tests 25 | 26 | .PHONY: test 27 | test: ## run all test 28 | make unittest 29 | 30 | # ------------------------- 31 | # coding style 32 | # ------------------------- 33 | .PHONY: lint 34 | lint: ## type check 35 | $(PYTHON) -m flake8 prts 36 | 37 | #typecheck: ## typing check 38 | # $(PYTHON) -m mypy \ 39 | # --allow-redefinition \ 40 | # --ignore-missing-imports \ 41 | # --disallow-untyped-defs \ 42 | # --warn-redundant-casts \ 43 | # --no-implicit-optional \ 44 | # --html-report ./mypyreport \ 45 | # prts 46 | 47 | .PHONY: format 48 | format: ## auto format 49 | $(PYTHON) -m autoflake \ 50 | --in-place \ 51 | --remove-all-unused-imports \ 52 | --remove-unused-variables \ 53 | --recursive prts 54 | $(PYTHON) -m isort prts 55 | $(PYTHON) -m black \ 56 | --line-length=119 \ 57 | prts 58 | 59 | .PHONY: pre-push 60 | pre-push: ## run before `git push` 61 | make test 62 | make format 63 | make lint 64 | 65 | 66 | help: ## Show all of tasks 67 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 68 | 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Precision and Recall for Time Series 2 | 3 | [![GitHub stars](https://img.shields.io/github/stars/CompML/PRTS)](https://github.com/CompML/PRTS/stargazers) 4 | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 5 | ![Python package](https://github.com/CompML/PRTS/workflows/Python%20package/badge.svg?branch=main) 6 | [![PyPI version](https://badge.fury.io/py/prts.svg)](https://badge.fury.io/py/prts) 7 | 8 | Unofficial python implementation of [Precision and Recall for Time Series](https://papers.nips.cc/paper/2018/file/8f468c873a32bb0619eaeb2050ba45d1-Paper.pdf). 9 | 10 | >Classical anomaly detection is principally concerned with point-based anomalies, those anomalies that occur at a single point in time. Yet, many real-world anomalies are range-based, meaning they occur over a period of time. Motivated by this observation, we present a new mathematical model to evaluate the accuracy of time series classification algorithms. Our model expands the well-known Precision and Recall metrics to measure ranges, while simultaneously enabling customization support for domain-specific preferences. 11 | 12 | This is the open source software released by [Computational Mathematics Laboratory](https://sites.google.com/view/compml/). It is available for download on [PyPI](https://pypi.org/project/prts/). 13 | 14 | ## Installation 15 | 16 | 17 | ### PyPI 18 | 19 | PRTS is on [PyPI](https://pypi.org/project/prts/), so you can use pip to install it. 20 | 21 | ```bash 22 | $ pip install prts 23 | ``` 24 | 25 | ### from github 26 | You can also use the following command to install. 27 | 28 | ```bash 29 | $ git clone https://github.com/CompML/PRTS.git 30 | $ cd PRTS 31 | $ make install # (or make develop) 32 | ``` 33 | 34 | ## Usage 35 | 36 | ```python 37 | from prts import ts_precision, ts_recall 38 | 39 | 40 | # calculate time series precision score 41 | precision_flat = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="flat") 42 | precision_front = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="front") 43 | precision_middle = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="middle") 44 | precision_back = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="back") 45 | print("precision_flat=", precision_flat) 46 | print("precision_front=", precision_front) 47 | print("precision_middle=", precision_middle) 48 | print("precision_back=", precision_back) 49 | 50 | # calculate time series recall score 51 | recall_flat = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="flat") 52 | recall_front = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="front") 53 | recall_middle = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="middle") 54 | recall_back = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="back") 55 | print("recall_flat=", recall_flat) 56 | print("recall_front=", recall_front) 57 | print("recall_middle=", recall_middle) 58 | print("recall_back=", recall_back) 59 | ``` 60 | 61 | ### Parameters 62 | 63 | | Parameter | Description | Type | 64 | |-------------|----------------------------------------------------------------------|--------| 65 | | alpha | Relative importance of existence reward (0 ≤ alpha ≤ 1). | float | 66 | | cardinality | Cardinality type. This should be "one", "reciprocal" or "udf_gamma" | string | 67 | | bias | Positional bias. This should be "flat", "front", "middle", or "back" | string | 68 | 69 | ## Examples 70 | 71 | We provide a simple example code. 72 | By the following command you can run the example code for the toy dataset and visualize the metrics. 73 | 74 | ```bash 75 | $ python3 examples/precision_recall_for_time_series.py 76 | ``` 77 | 78 | ![example output](./examples/example.png) 79 | 80 | ## Tests 81 | 82 | You can run all the test codes as follows: 83 | 84 | ```bash 85 | $ make test 86 | ``` 87 | 88 | ## References 89 | * Tatbul, Nesime, Tae Jun Lee, Stan Zdonik, Mejbah Alam, and Justin Gottschlich. 2018. “Precision and Recall for Time Series.” In Advances in Neural Information Processing Systems, edited by S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, 31:1920–30. Curran Associates, Inc. 90 | 91 | ## LICENSE 92 | This repository is Apache-style licensed, as found in the [LICENSE file](LICENSE). 93 | 94 | ## Citation 95 | 96 | ```bibtex 97 | @software{https://doi.org/10.5281/zenodo.4428056, 98 | doi = {10.5281/ZENODO.4428056}, 99 | url = {https://zenodo.org/record/4428056}, 100 | author = {Ryohei Izawa, Ryosuke Sato, Masanari Kimura}, 101 | title = {PRTS: Python Library for Time Series Metrics}, 102 | publisher = {Zenodo}, 103 | year = {2021}, 104 | copyright = {Open Access} 105 | } 106 | 107 | ``` 108 | -------------------------------------------------------------------------------- /examples/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompML/PRTS/66db2ac5f83ac9182ce29dcd7afc0f678a678eed/examples/example.png -------------------------------------------------------------------------------- /examples/precision_recall_for_time_series.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append("../prts/") 3 | import numpy as np 4 | import matplotlib.pyplot as plt 5 | import seaborn as sns 6 | from sklearn.metrics import precision_score, recall_score 7 | 8 | from prts import ts_precision, ts_recall 9 | 10 | sns.set_style("darkgrid") 11 | 12 | 13 | def main(): 14 | with open("data//lstm_ad.real", "r") as f: 15 | real = f.readlines() 16 | with open("data/lstm_ad.pred", "r") as f: 17 | pred = f.readlines() 18 | 19 | real = np.array([int(value.strip("\n")) for value in real]) 20 | pred = np.array([int(value.strip("\n")) for value in pred]) 21 | 22 | # calculate classic precision and recall score 23 | precision_classic = precision_score(real, pred) 24 | recall_classic = recall_score(real, pred) 25 | print("precision_classic=", precision_classic) 26 | print("recall_classic=", recall_classic) 27 | 28 | # calculate time series precision score 29 | precision_flat = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="flat") 30 | precision_front = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="front") 31 | precision_middle = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="middle") 32 | precision_back = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="back") 33 | print("precision_flat=", precision_flat) 34 | print("precision_front=", precision_front) 35 | print("precision_middle=", precision_middle) 36 | print("precision_back=", precision_back) 37 | 38 | # calculate time series recall score 39 | recall_flat = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="flat") 40 | recall_front = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="front") 41 | recall_middle = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="middle") 42 | recall_back = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="back") 43 | print("recall_flat=", recall_flat) 44 | print("recall_front=", recall_front) 45 | print("recall_middle=", recall_middle) 46 | print("recall_back=", recall_back) 47 | 48 | fig = plt.figure(figsize=(16, 8)) 49 | ax1 = plt.subplot2grid((2, 2), (0, 0), colspan=2) 50 | ax2 = plt.subplot2grid((2, 2), (1, 0)) 51 | ax3 = plt.subplot2grid((2, 2), (1, 1)) 52 | 53 | ax1.set_title("Preds and Ground Truth") 54 | ax1.plot(real*1.25, alpha=0.6) 55 | ax1.plot(pred, alpha=0.6) 56 | ax1.legend(["real anomalies", "predicted anomalies"], loc="upper left", fontsize=8) 57 | ax1.grid(True) 58 | 59 | ax2.set_title("Precision") 60 | ax2.bar(["precision_classic", "precision_flat", "precision_front", "precision_middle", "precision_back"], 61 | [precision_classic, precision_flat, precision_front, precision_middle, precision_back], alpha=0.6) 62 | ax2.set_ylim([0, 1]) 63 | ax2.grid(True) 64 | ax2.tick_params("x", rotation=45) 65 | 66 | ax3.set_title("Recall") 67 | ax3.bar(["recall_classic", "recall_flat", "recall_front", "recall_middle", "recall_back"], 68 | [recall_classic, recall_flat, recall_front, recall_middle, recall_back], alpha=0.6) 69 | ax3.set_ylim([0, 1]) 70 | ax3.grid(True) 71 | 72 | ax3.tick_params("x", rotation=45) 73 | plt.savefig("examples/example.png") 74 | plt.show() 75 | fig.clear() 76 | 77 | 78 | if __name__ == "__main__": 79 | main() 80 | -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "appdirs" 3 | version = "1.4.4" 4 | description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." 5 | category = "dev" 6 | optional = false 7 | python-versions = "*" 8 | 9 | [[package]] 10 | name = "atomicwrites" 11 | version = "1.4.0" 12 | description = "Atomic file writes." 13 | category = "dev" 14 | optional = false 15 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 16 | 17 | [[package]] 18 | name = "attrs" 19 | version = "20.3.0" 20 | description = "Classes Without Boilerplate" 21 | category = "dev" 22 | optional = false 23 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 24 | 25 | [package.extras] 26 | dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"] 27 | docs = ["furo", "sphinx", "zope.interface"] 28 | tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] 29 | tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] 30 | 31 | [[package]] 32 | name = "autoflake" 33 | version = "1.4" 34 | description = "Removes unused imports and unused variables" 35 | category = "dev" 36 | optional = false 37 | python-versions = "*" 38 | 39 | [package.dependencies] 40 | pyflakes = ">=1.1.0" 41 | 42 | [[package]] 43 | name = "black" 44 | version = "20.8b1" 45 | description = "The uncompromising code formatter." 46 | category = "dev" 47 | optional = false 48 | python-versions = ">=3.6" 49 | 50 | [package.dependencies] 51 | appdirs = "*" 52 | click = ">=7.1.2" 53 | dataclasses = {version = ">=0.6", markers = "python_version < \"3.7\""} 54 | mypy-extensions = ">=0.4.3" 55 | pathspec = ">=0.6,<1" 56 | regex = ">=2020.1.8" 57 | toml = ">=0.10.1" 58 | typed-ast = ">=1.4.0" 59 | typing-extensions = ">=3.7.4" 60 | 61 | [package.extras] 62 | colorama = ["colorama (>=0.4.3)"] 63 | d = ["aiohttp (>=3.3.2)", "aiohttp-cors"] 64 | 65 | [[package]] 66 | name = "click" 67 | version = "7.1.2" 68 | description = "Composable command line interface toolkit" 69 | category = "dev" 70 | optional = false 71 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 72 | 73 | [[package]] 74 | name = "colorama" 75 | version = "0.4.4" 76 | description = "Cross-platform colored terminal text." 77 | category = "dev" 78 | optional = false 79 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 80 | 81 | [[package]] 82 | name = "coverage" 83 | version = "5.3.1" 84 | description = "Code coverage measurement for Python" 85 | category = "dev" 86 | optional = false 87 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" 88 | 89 | [package.extras] 90 | toml = ["toml"] 91 | 92 | [[package]] 93 | name = "cycler" 94 | version = "0.10.0" 95 | description = "Composable style cycles" 96 | category = "dev" 97 | optional = false 98 | python-versions = "*" 99 | 100 | [package.dependencies] 101 | six = "*" 102 | 103 | [[package]] 104 | name = "dataclasses" 105 | version = "0.8" 106 | description = "A backport of the dataclasses module for Python 3.6" 107 | category = "dev" 108 | optional = false 109 | python-versions = ">=3.6, <3.7" 110 | 111 | [[package]] 112 | name = "flake8" 113 | version = "3.8.4" 114 | description = "the modular source code checker: pep8 pyflakes and co" 115 | category = "dev" 116 | optional = false 117 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" 118 | 119 | [package.dependencies] 120 | importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} 121 | mccabe = ">=0.6.0,<0.7.0" 122 | pycodestyle = ">=2.6.0a1,<2.7.0" 123 | pyflakes = ">=2.2.0,<2.3.0" 124 | 125 | [[package]] 126 | name = "importlib-metadata" 127 | version = "3.3.0" 128 | description = "Read metadata from Python packages" 129 | category = "dev" 130 | optional = false 131 | python-versions = ">=3.6" 132 | 133 | [package.dependencies] 134 | typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} 135 | zipp = ">=0.5" 136 | 137 | [package.extras] 138 | docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] 139 | testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] 140 | 141 | [[package]] 142 | name = "iniconfig" 143 | version = "1.1.1" 144 | description = "iniconfig: brain-dead simple config-ini parsing" 145 | category = "dev" 146 | optional = false 147 | python-versions = "*" 148 | 149 | [[package]] 150 | name = "isort" 151 | version = "5.6.4" 152 | description = "A Python utility / library to sort Python imports." 153 | category = "dev" 154 | optional = false 155 | python-versions = ">=3.6,<4.0" 156 | 157 | [package.extras] 158 | pipfile_deprecated_finder = ["pipreqs", "requirementslib"] 159 | requirements_deprecated_finder = ["pipreqs", "pip-api"] 160 | colors = ["colorama (>=0.4.3,<0.5.0)"] 161 | 162 | [[package]] 163 | name = "joblib" 164 | version = "1.0.0" 165 | description = "Lightweight pipelining with Python functions" 166 | category = "dev" 167 | optional = false 168 | python-versions = ">=3.6" 169 | 170 | [[package]] 171 | name = "kiwisolver" 172 | version = "1.3.1" 173 | description = "A fast implementation of the Cassowary constraint solver" 174 | category = "dev" 175 | optional = false 176 | python-versions = ">=3.6" 177 | 178 | [[package]] 179 | name = "matplotlib" 180 | version = "3.3.3" 181 | description = "Python plotting package" 182 | category = "dev" 183 | optional = false 184 | python-versions = ">=3.6" 185 | 186 | [package.dependencies] 187 | cycler = ">=0.10" 188 | kiwisolver = ">=1.0.1" 189 | numpy = ">=1.15" 190 | pillow = ">=6.2.0" 191 | pyparsing = ">=2.0.3,<2.0.4 || >2.0.4,<2.1.2 || >2.1.2,<2.1.6 || >2.1.6" 192 | python-dateutil = ">=2.1" 193 | 194 | [[package]] 195 | name = "mccabe" 196 | version = "0.6.1" 197 | description = "McCabe checker, plugin for flake8" 198 | category = "dev" 199 | optional = false 200 | python-versions = "*" 201 | 202 | [[package]] 203 | name = "mypy-extensions" 204 | version = "0.4.3" 205 | description = "Experimental type system extensions for programs checked with the mypy typechecker." 206 | category = "dev" 207 | optional = false 208 | python-versions = "*" 209 | 210 | [[package]] 211 | name = "numpy" 212 | version = "1.19.4" 213 | description = "NumPy is the fundamental package for array computing with Python." 214 | category = "main" 215 | optional = false 216 | python-versions = ">=3.6" 217 | 218 | [[package]] 219 | name = "packaging" 220 | version = "20.8" 221 | description = "Core utilities for Python packages" 222 | category = "dev" 223 | optional = false 224 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 225 | 226 | [package.dependencies] 227 | pyparsing = ">=2.0.2" 228 | 229 | [[package]] 230 | name = "pandas" 231 | version = "0.25.3" 232 | description = "Powerful data structures for data analysis, time series, and statistics" 233 | category = "dev" 234 | optional = false 235 | python-versions = ">=3.5.3" 236 | 237 | [package.dependencies] 238 | numpy = ">=1.13.3" 239 | python-dateutil = ">=2.6.1" 240 | pytz = ">=2017.2" 241 | 242 | [package.extras] 243 | test = ["pytest (>=4.0.2)", "pytest-xdist", "hypothesis (>=3.58)"] 244 | 245 | [[package]] 246 | name = "pathspec" 247 | version = "0.8.1" 248 | description = "Utility library for gitignore style pattern matching of file paths." 249 | category = "dev" 250 | optional = false 251 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 252 | 253 | [[package]] 254 | name = "pillow" 255 | version = "8.0.1" 256 | description = "Python Imaging Library (Fork)" 257 | category = "dev" 258 | optional = false 259 | python-versions = ">=3.6" 260 | 261 | [[package]] 262 | name = "pluggy" 263 | version = "0.13.1" 264 | description = "plugin and hook calling mechanisms for python" 265 | category = "dev" 266 | optional = false 267 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 268 | 269 | [package.dependencies] 270 | importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} 271 | 272 | [package.extras] 273 | dev = ["pre-commit", "tox"] 274 | 275 | [[package]] 276 | name = "py" 277 | version = "1.10.0" 278 | description = "library with cross-python path, ini-parsing, io, code, log facilities" 279 | category = "dev" 280 | optional = false 281 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 282 | 283 | [[package]] 284 | name = "pycodestyle" 285 | version = "2.6.0" 286 | description = "Python style guide checker" 287 | category = "dev" 288 | optional = false 289 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 290 | 291 | [[package]] 292 | name = "pyflakes" 293 | version = "2.2.0" 294 | description = "passive checker of Python programs" 295 | category = "dev" 296 | optional = false 297 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 298 | 299 | [[package]] 300 | name = "pyparsing" 301 | version = "2.4.7" 302 | description = "Python parsing module" 303 | category = "dev" 304 | optional = false 305 | python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" 306 | 307 | [[package]] 308 | name = "pytest" 309 | version = "6.2.1" 310 | description = "pytest: simple powerful testing with Python" 311 | category = "dev" 312 | optional = false 313 | python-versions = ">=3.6" 314 | 315 | [package.dependencies] 316 | atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} 317 | attrs = ">=19.2.0" 318 | colorama = {version = "*", markers = "sys_platform == \"win32\""} 319 | importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} 320 | iniconfig = "*" 321 | packaging = "*" 322 | pluggy = ">=0.12,<1.0.0a1" 323 | py = ">=1.8.2" 324 | toml = "*" 325 | 326 | [package.extras] 327 | testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] 328 | 329 | [[package]] 330 | name = "pytest-cov" 331 | version = "2.10.1" 332 | description = "Pytest plugin for measuring coverage." 333 | category = "dev" 334 | optional = false 335 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 336 | 337 | [package.dependencies] 338 | coverage = ">=4.4" 339 | pytest = ">=4.6" 340 | 341 | [package.extras] 342 | testing = ["fields", "hunter", "process-tests (==2.0.2)", "six", "pytest-xdist", "virtualenv"] 343 | 344 | [[package]] 345 | name = "python-dateutil" 346 | version = "2.8.1" 347 | description = "Extensions to the standard Python datetime module" 348 | category = "dev" 349 | optional = false 350 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" 351 | 352 | [package.dependencies] 353 | six = ">=1.5" 354 | 355 | [[package]] 356 | name = "pytz" 357 | version = "2020.5" 358 | description = "World timezone definitions, modern and historical" 359 | category = "dev" 360 | optional = false 361 | python-versions = "*" 362 | 363 | [[package]] 364 | name = "regex" 365 | version = "2020.11.13" 366 | description = "Alternative regular expression module, to replace re." 367 | category = "dev" 368 | optional = false 369 | python-versions = "*" 370 | 371 | [[package]] 372 | name = "scikit-learn" 373 | version = "0.24.0" 374 | description = "A set of python modules for machine learning and data mining" 375 | category = "dev" 376 | optional = false 377 | python-versions = ">=3.6" 378 | 379 | [package.dependencies] 380 | joblib = ">=0.11" 381 | numpy = ">=1.13.3" 382 | scipy = ">=0.19.1" 383 | threadpoolctl = ">=2.0.0" 384 | 385 | [package.extras] 386 | benchmark = ["matplotlib (>=2.1.1)", "pandas (>=0.25.0)", "memory-profiler (>=0.57.0)"] 387 | docs = ["matplotlib (>=2.1.1)", "scikit-image (>=0.13)", "pandas (>=0.25.0)", "seaborn (>=0.9.0)", "memory-profiler (>=0.57.0)", "sphinx (>=3.2.0)", "sphinx-gallery (>=0.7.0)", "numpydoc (>=1.0.0)", "Pillow (>=7.1.2)", "sphinx-prompt (>=1.3.0)"] 388 | examples = ["matplotlib (>=2.1.1)", "scikit-image (>=0.13)", "pandas (>=0.25.0)", "seaborn (>=0.9.0)"] 389 | tests = ["matplotlib (>=2.1.1)", "scikit-image (>=0.13)", "pandas (>=0.25.0)", "pytest (>=5.0.1)", "pytest-cov (>=2.9.0)", "flake8 (>=3.8.2)", "mypy (>=0.770)", "pyamg (>=4.0.0)"] 390 | 391 | [[package]] 392 | name = "scipy" 393 | version = "1.5.4" 394 | description = "SciPy: Scientific Library for Python" 395 | category = "dev" 396 | optional = false 397 | python-versions = ">=3.6" 398 | 399 | [package.dependencies] 400 | numpy = ">=1.14.5" 401 | 402 | [[package]] 403 | name = "seaborn" 404 | version = "0.11.1" 405 | description = "seaborn: statistical data visualization" 406 | category = "dev" 407 | optional = false 408 | python-versions = ">=3.6" 409 | 410 | [package.dependencies] 411 | matplotlib = ">=2.2" 412 | numpy = ">=1.15" 413 | pandas = ">=0.23" 414 | scipy = ">=1.0" 415 | 416 | [[package]] 417 | name = "six" 418 | version = "1.15.0" 419 | description = "Python 2 and 3 compatibility utilities" 420 | category = "dev" 421 | optional = false 422 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" 423 | 424 | [[package]] 425 | name = "sklearn" 426 | version = "0.0" 427 | description = "A set of python modules for machine learning and data mining" 428 | category = "dev" 429 | optional = false 430 | python-versions = "*" 431 | 432 | [package.dependencies] 433 | scikit-learn = "*" 434 | 435 | [[package]] 436 | name = "threadpoolctl" 437 | version = "2.1.0" 438 | description = "threadpoolctl" 439 | category = "dev" 440 | optional = false 441 | python-versions = ">=3.5" 442 | 443 | [[package]] 444 | name = "toml" 445 | version = "0.10.2" 446 | description = "Python Library for Tom's Obvious, Minimal Language" 447 | category = "dev" 448 | optional = false 449 | python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" 450 | 451 | [[package]] 452 | name = "typed-ast" 453 | version = "1.4.1" 454 | description = "a fork of Python 2 and 3 ast modules with type comment support" 455 | category = "dev" 456 | optional = false 457 | python-versions = "*" 458 | 459 | [[package]] 460 | name = "typing-extensions" 461 | version = "3.7.4.3" 462 | description = "Backported and Experimental Type Hints for Python 3.5+" 463 | category = "dev" 464 | optional = false 465 | python-versions = "*" 466 | 467 | [[package]] 468 | name = "zipp" 469 | version = "3.4.0" 470 | description = "Backport of pathlib-compatible object wrapper for zip files" 471 | category = "dev" 472 | optional = false 473 | python-versions = ">=3.6" 474 | 475 | [package.extras] 476 | docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] 477 | testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] 478 | 479 | [metadata] 480 | lock-version = "1.1" 481 | python-versions = "^3.6" 482 | content-hash = "3efa2bb02798b6a7a13206b7ae37682536d8faa45e5ae5091d4e12a0328f3386" 483 | 484 | [metadata.files] 485 | appdirs = [ 486 | {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, 487 | {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, 488 | ] 489 | atomicwrites = [ 490 | {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, 491 | {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, 492 | ] 493 | attrs = [ 494 | {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, 495 | {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, 496 | ] 497 | autoflake = [ 498 | {file = "autoflake-1.4.tar.gz", hash = "sha256:61a353012cff6ab94ca062823d1fb2f692c4acda51c76ff83a8d77915fba51ea"}, 499 | ] 500 | black = [ 501 | {file = "black-20.8b1.tar.gz", hash = "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea"}, 502 | ] 503 | click = [ 504 | {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, 505 | {file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"}, 506 | ] 507 | colorama = [ 508 | {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, 509 | {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, 510 | ] 511 | coverage = [ 512 | {file = "coverage-5.3.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:fabeeb121735d47d8eab8671b6b031ce08514c86b7ad8f7d5490a7b6dcd6267d"}, 513 | {file = "coverage-5.3.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:7e4d159021c2029b958b2363abec4a11db0ce8cd43abb0d9ce44284cb97217e7"}, 514 | {file = "coverage-5.3.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:378ac77af41350a8c6b8801a66021b52da8a05fd77e578b7380e876c0ce4f528"}, 515 | {file = "coverage-5.3.1-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:e448f56cfeae7b1b3b5bcd99bb377cde7c4eb1970a525c770720a352bc4c8044"}, 516 | {file = "coverage-5.3.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:cc44e3545d908ecf3e5773266c487ad1877be718d9dc65fc7eb6e7d14960985b"}, 517 | {file = "coverage-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:08b3ba72bd981531fd557f67beee376d6700fba183b167857038997ba30dd297"}, 518 | {file = "coverage-5.3.1-cp27-cp27m-win_amd64.whl", hash = "sha256:8dacc4073c359f40fcf73aede8428c35f84639baad7e1b46fce5ab7a8a7be4bb"}, 519 | {file = "coverage-5.3.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:ee2f1d1c223c3d2c24e3afbb2dd38be3f03b1a8d6a83ee3d9eb8c36a52bee899"}, 520 | {file = "coverage-5.3.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:9a9d4ff06804920388aab69c5ea8a77525cf165356db70131616acd269e19b36"}, 521 | {file = "coverage-5.3.1-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:782a5c7df9f91979a7a21792e09b34a658058896628217ae6362088b123c8500"}, 522 | {file = "coverage-5.3.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:fda29412a66099af6d6de0baa6bd7c52674de177ec2ad2630ca264142d69c6c7"}, 523 | {file = "coverage-5.3.1-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:f2c6888eada180814b8583c3e793f3f343a692fc802546eed45f40a001b1169f"}, 524 | {file = "coverage-5.3.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:8f33d1156241c43755137288dea619105477961cfa7e47f48dbf96bc2c30720b"}, 525 | {file = "coverage-5.3.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:b239711e774c8eb910e9b1ac719f02f5ae4bf35fa0420f438cdc3a7e4e7dd6ec"}, 526 | {file = "coverage-5.3.1-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:f54de00baf200b4539a5a092a759f000b5f45fd226d6d25a76b0dff71177a714"}, 527 | {file = "coverage-5.3.1-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:be0416074d7f253865bb67630cf7210cbc14eb05f4099cc0f82430135aaa7a3b"}, 528 | {file = "coverage-5.3.1-cp35-cp35m-win32.whl", hash = "sha256:c46643970dff9f5c976c6512fd35768c4a3819f01f61169d8cdac3f9290903b7"}, 529 | {file = "coverage-5.3.1-cp35-cp35m-win_amd64.whl", hash = "sha256:9a4f66259bdd6964d8cf26142733c81fb562252db74ea367d9beb4f815478e72"}, 530 | {file = "coverage-5.3.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c6e5174f8ca585755988bc278c8bb5d02d9dc2e971591ef4a1baabdf2d99589b"}, 531 | {file = "coverage-5.3.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:3911c2ef96e5ddc748a3c8b4702c61986628bb719b8378bf1e4a6184bbd48fe4"}, 532 | {file = "coverage-5.3.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:c5ec71fd4a43b6d84ddb88c1df94572479d9a26ef3f150cef3dacefecf888105"}, 533 | {file = "coverage-5.3.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:f51dbba78d68a44e99d484ca8c8f604f17e957c1ca09c3ebc2c7e3bbd9ba0448"}, 534 | {file = "coverage-5.3.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:a2070c5affdb3a5e751f24208c5c4f3d5f008fa04d28731416e023c93b275277"}, 535 | {file = "coverage-5.3.1-cp36-cp36m-win32.whl", hash = "sha256:535dc1e6e68fad5355f9984d5637c33badbdc987b0c0d303ee95a6c979c9516f"}, 536 | {file = "coverage-5.3.1-cp36-cp36m-win_amd64.whl", hash = "sha256:a4857f7e2bc6921dbd487c5c88b84f5633de3e7d416c4dc0bb70256775551a6c"}, 537 | {file = "coverage-5.3.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:fac3c432851038b3e6afe086f777732bcf7f6ebbfd90951fa04ee53db6d0bcdd"}, 538 | {file = "coverage-5.3.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:cd556c79ad665faeae28020a0ab3bda6cd47d94bec48e36970719b0b86e4dcf4"}, 539 | {file = "coverage-5.3.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:a66ca3bdf21c653e47f726ca57f46ba7fc1f260ad99ba783acc3e58e3ebdb9ff"}, 540 | {file = "coverage-5.3.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:ab110c48bc3d97b4d19af41865e14531f300b482da21783fdaacd159251890e8"}, 541 | {file = "coverage-5.3.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:e52d3d95df81c8f6b2a1685aabffadf2d2d9ad97203a40f8d61e51b70f191e4e"}, 542 | {file = "coverage-5.3.1-cp37-cp37m-win32.whl", hash = "sha256:fa10fee7e32213f5c7b0d6428ea92e3a3fdd6d725590238a3f92c0de1c78b9d2"}, 543 | {file = "coverage-5.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:ce6f3a147b4b1a8b09aae48517ae91139b1b010c5f36423fa2b866a8b23df879"}, 544 | {file = "coverage-5.3.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:93a280c9eb736a0dcca19296f3c30c720cb41a71b1f9e617f341f0a8e791a69b"}, 545 | {file = "coverage-5.3.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:3102bb2c206700a7d28181dbe04d66b30780cde1d1c02c5f3c165cf3d2489497"}, 546 | {file = "coverage-5.3.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8ffd4b204d7de77b5dd558cdff986a8274796a1e57813ed005b33fd97e29f059"}, 547 | {file = "coverage-5.3.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:a607ae05b6c96057ba86c811d9c43423f35e03874ffb03fbdcd45e0637e8b631"}, 548 | {file = "coverage-5.3.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:3a3c3f8863255f3c31db3889f8055989527173ef6192a283eb6f4db3c579d830"}, 549 | {file = "coverage-5.3.1-cp38-cp38-win32.whl", hash = "sha256:ff1330e8bc996570221b450e2d539134baa9465f5cb98aff0e0f73f34172e0ae"}, 550 | {file = "coverage-5.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:3498b27d8236057def41de3585f317abae235dd3a11d33e01736ffedb2ef8606"}, 551 | {file = "coverage-5.3.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ceb499d2b3d1d7b7ba23abe8bf26df5f06ba8c71127f188333dddcf356b4b63f"}, 552 | {file = "coverage-5.3.1-cp39-cp39-manylinux1_i686.whl", hash = "sha256:3b14b1da110ea50c8bcbadc3b82c3933974dbeea1832e814aab93ca1163cd4c1"}, 553 | {file = "coverage-5.3.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:76b2775dda7e78680d688daabcb485dc87cf5e3184a0b3e012e1d40e38527cc8"}, 554 | {file = "coverage-5.3.1-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:cef06fb382557f66d81d804230c11ab292d94b840b3cb7bf4450778377b592f4"}, 555 | {file = "coverage-5.3.1-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:6f61319e33222591f885c598e3e24f6a4be3533c1d70c19e0dc59e83a71ce27d"}, 556 | {file = "coverage-5.3.1-cp39-cp39-win32.whl", hash = "sha256:cc6f8246e74dd210d7e2b56c76ceaba1cc52b025cd75dbe96eb48791e0250e98"}, 557 | {file = "coverage-5.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:2757fa64e11ec12220968f65d086b7a29b6583d16e9a544c889b22ba98555ef1"}, 558 | {file = "coverage-5.3.1-pp36-none-any.whl", hash = "sha256:723d22d324e7997a651478e9c5a3120a0ecbc9a7e94071f7e1954562a8806cf3"}, 559 | {file = "coverage-5.3.1-pp37-none-any.whl", hash = "sha256:c89b558f8a9a5a6f2cfc923c304d49f0ce629c3bd85cb442ca258ec20366394c"}, 560 | {file = "coverage-5.3.1.tar.gz", hash = "sha256:38f16b1317b8dd82df67ed5daa5f5e7c959e46579840d77a67a4ceb9cef0a50b"}, 561 | ] 562 | cycler = [ 563 | {file = "cycler-0.10.0-py2.py3-none-any.whl", hash = "sha256:1d8a5ae1ff6c5cf9b93e8811e581232ad8920aeec647c37316ceac982b08cb2d"}, 564 | {file = "cycler-0.10.0.tar.gz", hash = "sha256:cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8"}, 565 | ] 566 | dataclasses = [ 567 | {file = "dataclasses-0.8-py3-none-any.whl", hash = "sha256:0201d89fa866f68c8ebd9d08ee6ff50c0b255f8ec63a71c16fda7af82bb887bf"}, 568 | {file = "dataclasses-0.8.tar.gz", hash = "sha256:8479067f342acf957dc82ec415d355ab5edb7e7646b90dc6e2fd1d96ad084c97"}, 569 | ] 570 | flake8 = [ 571 | {file = "flake8-3.8.4-py2.py3-none-any.whl", hash = "sha256:749dbbd6bfd0cf1318af27bf97a14e28e5ff548ef8e5b1566ccfb25a11e7c839"}, 572 | {file = "flake8-3.8.4.tar.gz", hash = "sha256:aadae8761ec651813c24be05c6f7b4680857ef6afaae4651a4eccaef97ce6c3b"}, 573 | ] 574 | importlib-metadata = [ 575 | {file = "importlib_metadata-3.3.0-py3-none-any.whl", hash = "sha256:bf792d480abbd5eda85794e4afb09dd538393f7d6e6ffef6e9f03d2014cf9450"}, 576 | {file = "importlib_metadata-3.3.0.tar.gz", hash = "sha256:5c5a2720817414a6c41f0a49993908068243ae02c1635a228126519b509c8aed"}, 577 | ] 578 | iniconfig = [ 579 | {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, 580 | {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, 581 | ] 582 | isort = [ 583 | {file = "isort-5.6.4-py3-none-any.whl", hash = "sha256:dcab1d98b469a12a1a624ead220584391648790275560e1a43e54c5dceae65e7"}, 584 | {file = "isort-5.6.4.tar.gz", hash = "sha256:dcaeec1b5f0eca77faea2a35ab790b4f3680ff75590bfcb7145986905aab2f58"}, 585 | ] 586 | joblib = [ 587 | {file = "joblib-1.0.0-py3-none-any.whl", hash = "sha256:75ead23f13484a2a414874779d69ade40d4fa1abe62b222a23cd50d4bc822f6f"}, 588 | {file = "joblib-1.0.0.tar.gz", hash = "sha256:7ad866067ac1fdec27d51c8678ea760601b70e32ff1881d4dc8e1171f2b64b24"}, 589 | ] 590 | kiwisolver = [ 591 | {file = "kiwisolver-1.3.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:fd34fbbfbc40628200730bc1febe30631347103fc8d3d4fa012c21ab9c11eca9"}, 592 | {file = "kiwisolver-1.3.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:d3155d828dec1d43283bd24d3d3e0d9c7c350cdfcc0bd06c0ad1209c1bbc36d0"}, 593 | {file = "kiwisolver-1.3.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:5a7a7dbff17e66fac9142ae2ecafb719393aaee6a3768c9de2fd425c63b53e21"}, 594 | {file = "kiwisolver-1.3.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:f8d6f8db88049a699817fd9178782867bf22283e3813064302ac59f61d95be05"}, 595 | {file = "kiwisolver-1.3.1-cp36-cp36m-manylinux2014_ppc64le.whl", hash = "sha256:5f6ccd3dd0b9739edcf407514016108e2280769c73a85b9e59aa390046dbf08b"}, 596 | {file = "kiwisolver-1.3.1-cp36-cp36m-win32.whl", hash = "sha256:225e2e18f271e0ed8157d7f4518ffbf99b9450fca398d561eb5c4a87d0986dd9"}, 597 | {file = "kiwisolver-1.3.1-cp36-cp36m-win_amd64.whl", hash = "sha256:cf8b574c7b9aa060c62116d4181f3a1a4e821b2ec5cbfe3775809474113748d4"}, 598 | {file = "kiwisolver-1.3.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:232c9e11fd7ac3a470d65cd67e4359eee155ec57e822e5220322d7b2ac84fbf0"}, 599 | {file = "kiwisolver-1.3.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:b38694dcdac990a743aa654037ff1188c7a9801ac3ccc548d3341014bc5ca278"}, 600 | {file = "kiwisolver-1.3.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:ca3820eb7f7faf7f0aa88de0e54681bddcb46e485beb844fcecbcd1c8bd01689"}, 601 | {file = "kiwisolver-1.3.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:c8fd0f1ae9d92b42854b2979024d7597685ce4ada367172ed7c09edf2cef9cb8"}, 602 | {file = "kiwisolver-1.3.1-cp37-cp37m-manylinux2014_ppc64le.whl", hash = "sha256:1e1bc12fb773a7b2ffdeb8380609f4f8064777877b2225dec3da711b421fda31"}, 603 | {file = "kiwisolver-1.3.1-cp37-cp37m-win32.whl", hash = "sha256:72c99e39d005b793fb7d3d4e660aed6b6281b502e8c1eaf8ee8346023c8e03bc"}, 604 | {file = "kiwisolver-1.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:8be8d84b7d4f2ba4ffff3665bcd0211318aa632395a1a41553250484a871d454"}, 605 | {file = "kiwisolver-1.3.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:31dfd2ac56edc0ff9ac295193eeaea1c0c923c0355bf948fbd99ed6018010b72"}, 606 | {file = "kiwisolver-1.3.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:563c649cfdef27d081c84e72a03b48ea9408c16657500c312575ae9d9f7bc1c3"}, 607 | {file = "kiwisolver-1.3.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:78751b33595f7f9511952e7e60ce858c6d64db2e062afb325985ddbd34b5c131"}, 608 | {file = "kiwisolver-1.3.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:a357fd4f15ee49b4a98b44ec23a34a95f1e00292a139d6015c11f55774ef10de"}, 609 | {file = "kiwisolver-1.3.1-cp38-cp38-manylinux2014_ppc64le.whl", hash = "sha256:5989db3b3b34b76c09253deeaf7fbc2707616f130e166996606c284395da3f18"}, 610 | {file = "kiwisolver-1.3.1-cp38-cp38-win32.whl", hash = "sha256:c08e95114951dc2090c4a630c2385bef681cacf12636fb0241accdc6b303fd81"}, 611 | {file = "kiwisolver-1.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:44a62e24d9b01ba94ae7a4a6c3fb215dc4af1dde817e7498d901e229aaf50e4e"}, 612 | {file = "kiwisolver-1.3.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:50af681a36b2a1dee1d3c169ade9fdc59207d3c31e522519181e12f1b3ba7000"}, 613 | {file = "kiwisolver-1.3.1-cp39-cp39-manylinux1_i686.whl", hash = "sha256:a53d27d0c2a0ebd07e395e56a1fbdf75ffedc4a05943daf472af163413ce9598"}, 614 | {file = "kiwisolver-1.3.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:834ee27348c4aefc20b479335fd422a2c69db55f7d9ab61721ac8cd83eb78882"}, 615 | {file = "kiwisolver-1.3.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:5c3e6455341008a054cccee8c5d24481bcfe1acdbc9add30aa95798e95c65621"}, 616 | {file = "kiwisolver-1.3.1-cp39-cp39-manylinux2014_ppc64le.whl", hash = "sha256:acef3d59d47dd85ecf909c359d0fd2c81ed33bdff70216d3956b463e12c38a54"}, 617 | {file = "kiwisolver-1.3.1-cp39-cp39-win32.whl", hash = "sha256:c5518d51a0735b1e6cee1fdce66359f8d2b59c3ca85dc2b0813a8aa86818a030"}, 618 | {file = "kiwisolver-1.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:b9edd0110a77fc321ab090aaa1cfcaba1d8499850a12848b81be2222eab648f6"}, 619 | {file = "kiwisolver-1.3.1-pp36-pypy36_pp73-macosx_10_9_x86_64.whl", hash = "sha256:0cd53f403202159b44528498de18f9285b04482bab2a6fc3f5dd8dbb9352e30d"}, 620 | {file = "kiwisolver-1.3.1-pp36-pypy36_pp73-manylinux2010_x86_64.whl", hash = "sha256:33449715e0101e4d34f64990352bce4095c8bf13bed1b390773fc0a7295967b3"}, 621 | {file = "kiwisolver-1.3.1-pp36-pypy36_pp73-win32.whl", hash = "sha256:401a2e9afa8588589775fe34fc22d918ae839aaaf0c0e96441c0fdbce6d8ebe6"}, 622 | {file = "kiwisolver-1.3.1.tar.gz", hash = "sha256:950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248"}, 623 | ] 624 | matplotlib = [ 625 | {file = "matplotlib-3.3.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b2a5e1f637a92bb6f3526cc54cc8af0401112e81ce5cba6368a1b7908f9e18bc"}, 626 | {file = "matplotlib-3.3.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:c586ac1d64432f92857c3cf4478cfb0ece1ae18b740593f8a39f2f0b27c7fda5"}, 627 | {file = "matplotlib-3.3.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:9b03722c89a43a61d4d148acfc89ec5bb54cd0fd1539df25b10eb9c5fa6c393a"}, 628 | {file = "matplotlib-3.3.3-cp36-cp36m-win32.whl", hash = "sha256:2c2c5041608cb75c39cbd0ed05256f8a563e144234a524c59d091abbfa7a868f"}, 629 | {file = "matplotlib-3.3.3-cp36-cp36m-win_amd64.whl", hash = "sha256:c092fc4673260b1446b8578015321081d5db73b94533fe4bf9b69f44e948d174"}, 630 | {file = "matplotlib-3.3.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:27c9393fada62bd0ad7c730562a0fecbd3d5aaa8d9ed80ba7d3ebb8abc4f0453"}, 631 | {file = "matplotlib-3.3.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:b8ba2a1dbb4660cb469fe8e1febb5119506059e675180c51396e1723ff9b79d9"}, 632 | {file = "matplotlib-3.3.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:0caa687fce6174fef9b27d45f8cc57cbc572e04e98c81db8e628b12b563d59a2"}, 633 | {file = "matplotlib-3.3.3-cp37-cp37m-win32.whl", hash = "sha256:b7b09c61a91b742cb5460b72efd1fe26ef83c1c704f666e0af0df156b046aada"}, 634 | {file = "matplotlib-3.3.3-cp37-cp37m-win_amd64.whl", hash = "sha256:6ffd2d80d76df2e5f9f0c0140b5af97e3b87dd29852dcdb103ec177d853ec06b"}, 635 | {file = "matplotlib-3.3.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5111d6d47a0f5b8f3e10af7a79d5e7eb7e73a22825391834734274c4f312a8a0"}, 636 | {file = "matplotlib-3.3.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:a4fe54eab2c7129add75154823e6543b10261f9b65b2abe692d68743a4999f8c"}, 637 | {file = "matplotlib-3.3.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:83e6c895d93fdf93eeff1a21ee96778ba65ef258e5d284160f7c628fee40c38f"}, 638 | {file = "matplotlib-3.3.3-cp38-cp38-win32.whl", hash = "sha256:b26c472847911f5a7eb49e1c888c31c77c4ddf8023c1545e0e8e0367ba74fb15"}, 639 | {file = "matplotlib-3.3.3-cp38-cp38-win_amd64.whl", hash = "sha256:09225edca87a79815822eb7d3be63a83ebd4d9d98d5aa3a15a94f4eee2435954"}, 640 | {file = "matplotlib-3.3.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:eb6b6700ea454bb88333d98601e74928e06f9669c1ea231b4c4c666c1d7701b4"}, 641 | {file = "matplotlib-3.3.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:2d31aff0c8184b05006ad756b9a4dc2a0805e94d28f3abc3187e881b6673b302"}, 642 | {file = "matplotlib-3.3.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:d082f77b4ed876ae94a9373f0db96bf8768a7cca6c58fc3038f94e30ffde1880"}, 643 | {file = "matplotlib-3.3.3-cp39-cp39-win32.whl", hash = "sha256:e71cdd402047e657c1662073e9361106c6981e9621ab8c249388dfc3ec1de07b"}, 644 | {file = "matplotlib-3.3.3-cp39-cp39-win_amd64.whl", hash = "sha256:756ee498b9ba35460e4cbbd73f09018e906daa8537fff61da5b5bf8d5e9de5c7"}, 645 | {file = "matplotlib-3.3.3-pp36-pypy36_pp73-macosx_10_9_x86_64.whl", hash = "sha256:7ad44f2c74c50567c694ee91c6fa16d67e7c8af6f22c656b80469ad927688457"}, 646 | {file = "matplotlib-3.3.3-pp36-pypy36_pp73-manylinux2010_x86_64.whl", hash = "sha256:3a4c3e9be63adf8e9b305aa58fb3ec40ecc61fd0f8fd3328ce55bc30e7a2aeb0"}, 647 | {file = "matplotlib-3.3.3-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:746897fbd72bd462b888c74ed35d812ca76006b04f717cd44698cdfc99aca70d"}, 648 | {file = "matplotlib-3.3.3-pp37-pypy37_pp73-manylinux2010_x86_64.whl", hash = "sha256:5ed3d3342698c2b1f3651f8ea6c099b0f196d16ee00e33dc3a6fee8cb01d530a"}, 649 | {file = "matplotlib-3.3.3.tar.gz", hash = "sha256:b1b60c6476c4cfe9e5cf8ab0d3127476fd3d5f05de0f343a452badaad0e4bdec"}, 650 | ] 651 | mccabe = [ 652 | {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, 653 | {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, 654 | ] 655 | mypy-extensions = [ 656 | {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, 657 | {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, 658 | ] 659 | numpy = [ 660 | {file = "numpy-1.19.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e9b30d4bd69498fc0c3fe9db5f62fffbb06b8eb9321f92cc970f2969be5e3949"}, 661 | {file = "numpy-1.19.4-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:fedbd128668ead37f33917820b704784aff695e0019309ad446a6d0b065b57e4"}, 662 | {file = "numpy-1.19.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:8ece138c3a16db8c1ad38f52eb32be6086cc72f403150a79336eb2045723a1ad"}, 663 | {file = "numpy-1.19.4-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:64324f64f90a9e4ef732be0928be853eee378fd6a01be21a0a8469c4f2682c83"}, 664 | {file = "numpy-1.19.4-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:ad6f2ff5b1989a4899bf89800a671d71b1612e5ff40866d1f4d8bcf48d4e5764"}, 665 | {file = "numpy-1.19.4-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:d6c7bb82883680e168b55b49c70af29b84b84abb161cbac2800e8fcb6f2109b6"}, 666 | {file = "numpy-1.19.4-cp36-cp36m-win32.whl", hash = "sha256:13d166f77d6dc02c0a73c1101dd87fdf01339febec1030bd810dcd53fff3b0f1"}, 667 | {file = "numpy-1.19.4-cp36-cp36m-win_amd64.whl", hash = "sha256:448ebb1b3bf64c0267d6b09a7cba26b5ae61b6d2dbabff7c91b660c7eccf2bdb"}, 668 | {file = "numpy-1.19.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:27d3f3b9e3406579a8af3a9f262f5339005dd25e0ecf3cf1559ff8a49ed5cbf2"}, 669 | {file = "numpy-1.19.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:16c1b388cc31a9baa06d91a19366fb99ddbe1c7b205293ed072211ee5bac1ed2"}, 670 | {file = "numpy-1.19.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e5b6ed0f0b42317050c88022349d994fe72bfe35f5908617512cd8c8ef9da2a9"}, 671 | {file = "numpy-1.19.4-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:18bed2bcb39e3f758296584337966e68d2d5ba6aab7e038688ad53c8f889f757"}, 672 | {file = "numpy-1.19.4-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:fe45becb4c2f72a0907c1d0246ea6449fe7a9e2293bb0e11c4e9a32bb0930a15"}, 673 | {file = "numpy-1.19.4-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:6d7593a705d662be5bfe24111af14763016765f43cb6923ed86223f965f52387"}, 674 | {file = "numpy-1.19.4-cp37-cp37m-win32.whl", hash = "sha256:6ae6c680f3ebf1cf7ad1d7748868b39d9f900836df774c453c11c5440bc15b36"}, 675 | {file = "numpy-1.19.4-cp37-cp37m-win_amd64.whl", hash = "sha256:9eeb7d1d04b117ac0d38719915ae169aa6b61fca227b0b7d198d43728f0c879c"}, 676 | {file = "numpy-1.19.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cb1017eec5257e9ac6209ac172058c430e834d5d2bc21961dceeb79d111e5909"}, 677 | {file = "numpy-1.19.4-cp38-cp38-manylinux1_i686.whl", hash = "sha256:edb01671b3caae1ca00881686003d16c2209e07b7ef8b7639f1867852b948f7c"}, 678 | {file = "numpy-1.19.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:f29454410db6ef8126c83bd3c968d143304633d45dc57b51252afbd79d700893"}, 679 | {file = "numpy-1.19.4-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:ec149b90019852266fec2341ce1db513b843e496d5a8e8cdb5ced1923a92faab"}, 680 | {file = "numpy-1.19.4-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:1aeef46a13e51931c0b1cf8ae1168b4a55ecd282e6688fdb0a948cc5a1d5afb9"}, 681 | {file = "numpy-1.19.4-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:08308c38e44cc926bdfce99498b21eec1f848d24c302519e64203a8da99a97db"}, 682 | {file = "numpy-1.19.4-cp38-cp38-win32.whl", hash = "sha256:5734bdc0342aba9dfc6f04920988140fb41234db42381cf7ccba64169f9fe7ac"}, 683 | {file = "numpy-1.19.4-cp38-cp38-win_amd64.whl", hash = "sha256:09c12096d843b90eafd01ea1b3307e78ddd47a55855ad402b157b6c4862197ce"}, 684 | {file = "numpy-1.19.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e452dc66e08a4ce642a961f134814258a082832c78c90351b75c41ad16f79f63"}, 685 | {file = "numpy-1.19.4-cp39-cp39-manylinux1_i686.whl", hash = "sha256:a5d897c14513590a85774180be713f692df6fa8ecf6483e561a6d47309566f37"}, 686 | {file = "numpy-1.19.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:a09f98011236a419ee3f49cedc9ef27d7a1651df07810ae430a6b06576e0b414"}, 687 | {file = "numpy-1.19.4-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:50e86c076611212ca62e5a59f518edafe0c0730f7d9195fec718da1a5c2bb1fc"}, 688 | {file = "numpy-1.19.4-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:f0d3929fe88ee1c155129ecd82f981b8856c5d97bcb0d5f23e9b4242e79d1de3"}, 689 | {file = "numpy-1.19.4-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:c42c4b73121caf0ed6cd795512c9c09c52a7287b04d105d112068c1736d7c753"}, 690 | {file = "numpy-1.19.4-cp39-cp39-win32.whl", hash = "sha256:8cac8790a6b1ddf88640a9267ee67b1aee7a57dfa2d2dd33999d080bc8ee3a0f"}, 691 | {file = "numpy-1.19.4-cp39-cp39-win_amd64.whl", hash = "sha256:4377e10b874e653fe96985c05feed2225c912e328c8a26541f7fc600fb9c637b"}, 692 | {file = "numpy-1.19.4-pp36-pypy36_pp73-manylinux2010_x86_64.whl", hash = "sha256:2a2740aa9733d2e5b2dfb33639d98a64c3b0f24765fed86b0fd2aec07f6a0a08"}, 693 | {file = "numpy-1.19.4.zip", hash = "sha256:141ec3a3300ab89c7f2b0775289954d193cc8edb621ea05f99db9cb181530512"}, 694 | ] 695 | packaging = [ 696 | {file = "packaging-20.8-py2.py3-none-any.whl", hash = "sha256:24e0da08660a87484d1602c30bb4902d74816b6985b93de36926f5bc95741858"}, 697 | {file = "packaging-20.8.tar.gz", hash = "sha256:78598185a7008a470d64526a8059de9aaa449238f280fc9eb6b13ba6c4109093"}, 698 | ] 699 | pandas = [ 700 | {file = "pandas-0.25.3-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:df8864824b1fe488cf778c3650ee59c3a0d8f42e53707de167ba6b4f7d35f133"}, 701 | {file = "pandas-0.25.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:7458c48e3d15b8aaa7d575be60e1e4dd70348efcd9376656b72fecd55c59a4c3"}, 702 | {file = "pandas-0.25.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:61741f5aeb252f39c3031d11405305b6d10ce663c53bc3112705d7ad66c013d0"}, 703 | {file = "pandas-0.25.3-cp35-cp35m-win32.whl", hash = "sha256:adc3d3a3f9e59a38d923e90e20c4922fc62d1e5a03d083440468c6d8f3f1ae0a"}, 704 | {file = "pandas-0.25.3-cp35-cp35m-win_amd64.whl", hash = "sha256:975c461accd14e89d71772e89108a050fa824c0b87a67d34cedf245f6681fc17"}, 705 | {file = "pandas-0.25.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ee50c2142cdcf41995655d499a157d0a812fce55c97d9aad13bc1eef837ed36c"}, 706 | {file = "pandas-0.25.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:4545467a637e0e1393f7d05d61dace89689ad6d6f66f267f86fff737b702cce9"}, 707 | {file = "pandas-0.25.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:bbe3eb765a0b1e578833d243e2814b60c825b7fdbf4cdfe8e8aae8a08ed56ecf"}, 708 | {file = "pandas-0.25.3-cp36-cp36m-win32.whl", hash = "sha256:8153705d6545fd9eb6dd2bc79301bff08825d2e2f716d5dced48daafc2d0b81f"}, 709 | {file = "pandas-0.25.3-cp36-cp36m-win_amd64.whl", hash = "sha256:26382aab9c119735908d94d2c5c08020a4a0a82969b7e5eefb92f902b3b30ad7"}, 710 | {file = "pandas-0.25.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:00dff3a8e337f5ed7ad295d98a31821d3d0fe7792da82d78d7fd79b89c03ea9d"}, 711 | {file = "pandas-0.25.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e45055c30a608076e31a9fcd780a956ed3b1fa20db61561b8d88b79259f526f7"}, 712 | {file = "pandas-0.25.3-cp37-cp37m-win32.whl", hash = "sha256:255920e63850dc512ce356233081098554d641ba99c3767dde9e9f35630f994b"}, 713 | {file = "pandas-0.25.3-cp37-cp37m-win_amd64.whl", hash = "sha256:22361b1597c8c2ffd697aa9bf85423afa9e1fcfa6b1ea821054a244d5f24d75e"}, 714 | {file = "pandas-0.25.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9962957a27bfb70ab64103d0a7b42fa59c642fb4ed4cb75d0227b7bb9228535d"}, 715 | {file = "pandas-0.25.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:78bf638993219311377ce9836b3dc05f627a666d0dbc8cec37c0ff3c9ada673b"}, 716 | {file = "pandas-0.25.3-cp38-cp38-win32.whl", hash = "sha256:6a3ac2c87e4e32a969921d1428525f09462770c349147aa8e9ab95f88c71ec71"}, 717 | {file = "pandas-0.25.3-cp38-cp38-win_amd64.whl", hash = "sha256:33970f4cacdd9a0ddb8f21e151bfb9f178afb7c36eb7c25b9094c02876f385c2"}, 718 | {file = "pandas-0.25.3.tar.gz", hash = "sha256:52da74df8a9c9a103af0a72c9d5fdc8e0183a90884278db7f386b5692a2220a4"}, 719 | ] 720 | pathspec = [ 721 | {file = "pathspec-0.8.1-py2.py3-none-any.whl", hash = "sha256:aa0cb481c4041bf52ffa7b0d8fa6cd3e88a2ca4879c533c9153882ee2556790d"}, 722 | {file = "pathspec-0.8.1.tar.gz", hash = "sha256:86379d6b86d75816baba717e64b1a3a3469deb93bb76d613c9ce79edc5cb68fd"}, 723 | ] 724 | pillow = [ 725 | {file = "Pillow-8.0.1-cp36-cp36m-macosx_10_10_x86_64.whl", hash = "sha256:b63d4ff734263ae4ce6593798bcfee6dbfb00523c82753a3a03cbc05555a9cc3"}, 726 | {file = "Pillow-8.0.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:5f9403af9c790cc18411ea398a6950ee2def2a830ad0cfe6dc9122e6d528b302"}, 727 | {file = "Pillow-8.0.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:6b4a8fd632b4ebee28282a9fef4c341835a1aa8671e2770b6f89adc8e8c2703c"}, 728 | {file = "Pillow-8.0.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:cc3ea6b23954da84dbee8025c616040d9aa5eaf34ea6895a0a762ee9d3e12e11"}, 729 | {file = "Pillow-8.0.1-cp36-cp36m-win32.whl", hash = "sha256:d8a96747df78cda35980905bf26e72960cba6d355ace4780d4bdde3b217cdf1e"}, 730 | {file = "Pillow-8.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:7ba0ba61252ab23052e642abdb17fd08fdcfdbbf3b74c969a30c58ac1ade7cd3"}, 731 | {file = "Pillow-8.0.1-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:795e91a60f291e75de2e20e6bdd67770f793c8605b553cb6e4387ce0cb302e09"}, 732 | {file = "Pillow-8.0.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:0a2e8d03787ec7ad71dc18aec9367c946ef8ef50e1e78c71f743bc3a770f9fae"}, 733 | {file = "Pillow-8.0.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:006de60d7580d81f4a1a7e9f0173dc90a932e3905cc4d47ea909bc946302311a"}, 734 | {file = "Pillow-8.0.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:bd7bf289e05470b1bc74889d1466d9ad4a56d201f24397557b6f65c24a6844b8"}, 735 | {file = "Pillow-8.0.1-cp37-cp37m-win32.whl", hash = "sha256:95edb1ed513e68bddc2aee3de66ceaf743590bf16c023fb9977adc4be15bd3f0"}, 736 | {file = "Pillow-8.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:e38d58d9138ef972fceb7aeec4be02e3f01d383723965bfcef14d174c8ccd039"}, 737 | {file = "Pillow-8.0.1-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:d3d07c86d4efa1facdf32aa878bd508c0dc4f87c48125cc16b937baa4e5b5e11"}, 738 | {file = "Pillow-8.0.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:fbd922f702582cb0d71ef94442bfca57624352622d75e3be7a1e7e9360b07e72"}, 739 | {file = "Pillow-8.0.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:92c882b70a40c79de9f5294dc99390671e07fc0b0113d472cbea3fde15db1792"}, 740 | {file = "Pillow-8.0.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:7c9401e68730d6c4245b8e361d3d13e1035cbc94db86b49dc7da8bec235d0015"}, 741 | {file = "Pillow-8.0.1-cp38-cp38-win32.whl", hash = "sha256:6c1aca8231625115104a06e4389fcd9ec88f0c9befbabd80dc206c35561be271"}, 742 | {file = "Pillow-8.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:cc9ec588c6ef3a1325fa032ec14d97b7309db493782ea8c304666fb10c3bd9a7"}, 743 | {file = "Pillow-8.0.1-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:eb472586374dc66b31e36e14720747595c2b265ae962987261f044e5cce644b5"}, 744 | {file = "Pillow-8.0.1-cp39-cp39-manylinux1_i686.whl", hash = "sha256:0eeeae397e5a79dc088d8297a4c2c6f901f8fb30db47795113a4a605d0f1e5ce"}, 745 | {file = "Pillow-8.0.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:81f812d8f5e8a09b246515fac141e9d10113229bc33ea073fec11403b016bcf3"}, 746 | {file = "Pillow-8.0.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:895d54c0ddc78a478c80f9c438579ac15f3e27bf442c2a9aa74d41d0e4d12544"}, 747 | {file = "Pillow-8.0.1-cp39-cp39-win32.whl", hash = "sha256:2fb113757a369a6cdb189f8df3226e995acfed0a8919a72416626af1a0a71140"}, 748 | {file = "Pillow-8.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:59e903ca800c8cfd1ebe482349ec7c35687b95e98cefae213e271c8c7fffa021"}, 749 | {file = "Pillow-8.0.1-pp36-pypy36_pp73-macosx_10_10_x86_64.whl", hash = "sha256:5abd653a23c35d980b332bc0431d39663b1709d64142e3652890df4c9b6970f6"}, 750 | {file = "Pillow-8.0.1-pp36-pypy36_pp73-manylinux2010_x86_64.whl", hash = "sha256:4b0ef2470c4979e345e4e0cc1bbac65fda11d0d7b789dbac035e4c6ce3f98adb"}, 751 | {file = "Pillow-8.0.1-pp37-pypy37_pp73-win32.whl", hash = "sha256:8de332053707c80963b589b22f8e0229f1be1f3ca862a932c1bcd48dafb18dd8"}, 752 | {file = "Pillow-8.0.1.tar.gz", hash = "sha256:11c5c6e9b02c9dac08af04f093eb5a2f84857df70a7d4a6a6ad461aca803fb9e"}, 753 | ] 754 | pluggy = [ 755 | {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, 756 | {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, 757 | ] 758 | py = [ 759 | {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, 760 | {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, 761 | ] 762 | pycodestyle = [ 763 | {file = "pycodestyle-2.6.0-py2.py3-none-any.whl", hash = "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367"}, 764 | {file = "pycodestyle-2.6.0.tar.gz", hash = "sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e"}, 765 | ] 766 | pyflakes = [ 767 | {file = "pyflakes-2.2.0-py2.py3-none-any.whl", hash = "sha256:0d94e0e05a19e57a99444b6ddcf9a6eb2e5c68d3ca1e98e90707af8152c90a92"}, 768 | {file = "pyflakes-2.2.0.tar.gz", hash = "sha256:35b2d75ee967ea93b55750aa9edbbf72813e06a66ba54438df2cfac9e3c27fc8"}, 769 | ] 770 | pyparsing = [ 771 | {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, 772 | {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, 773 | ] 774 | pytest = [ 775 | {file = "pytest-6.2.1-py3-none-any.whl", hash = "sha256:1969f797a1a0dbd8ccf0fecc80262312729afea9c17f1d70ebf85c5e76c6f7c8"}, 776 | {file = "pytest-6.2.1.tar.gz", hash = "sha256:66e419b1899bc27346cb2c993e12c5e5e8daba9073c1fbce33b9807abc95c306"}, 777 | ] 778 | pytest-cov = [ 779 | {file = "pytest-cov-2.10.1.tar.gz", hash = "sha256:47bd0ce14056fdd79f93e1713f88fad7bdcc583dcd7783da86ef2f085a0bb88e"}, 780 | {file = "pytest_cov-2.10.1-py2.py3-none-any.whl", hash = "sha256:45ec2d5182f89a81fc3eb29e3d1ed3113b9e9a873bcddb2a71faaab066110191"}, 781 | ] 782 | python-dateutil = [ 783 | {file = "python-dateutil-2.8.1.tar.gz", hash = "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"}, 784 | {file = "python_dateutil-2.8.1-py2.py3-none-any.whl", hash = "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a"}, 785 | ] 786 | pytz = [ 787 | {file = "pytz-2020.5-py2.py3-none-any.whl", hash = "sha256:16962c5fb8db4a8f63a26646d8886e9d769b6c511543557bc84e9569fb9a9cb4"}, 788 | {file = "pytz-2020.5.tar.gz", hash = "sha256:180befebb1927b16f6b57101720075a984c019ac16b1b7575673bea42c6c3da5"}, 789 | ] 790 | regex = [ 791 | {file = "regex-2020.11.13-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:8b882a78c320478b12ff024e81dc7d43c1462aa4a3341c754ee65d857a521f85"}, 792 | {file = "regex-2020.11.13-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:a63f1a07932c9686d2d416fb295ec2c01ab246e89b4d58e5fa468089cab44b70"}, 793 | {file = "regex-2020.11.13-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:6e4b08c6f8daca7d8f07c8d24e4331ae7953333dbd09c648ed6ebd24db5a10ee"}, 794 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:bba349276b126947b014e50ab3316c027cac1495992f10e5682dc677b3dfa0c5"}, 795 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:56e01daca75eae420bce184edd8bb341c8eebb19dd3bce7266332258f9fb9dd7"}, 796 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:6a8ce43923c518c24a2579fda49f093f1397dad5d18346211e46f134fc624e31"}, 797 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:1ab79fcb02b930de09c76d024d279686ec5d532eb814fd0ed1e0051eb8bd2daa"}, 798 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:9801c4c1d9ae6a70aeb2128e5b4b68c45d4f0af0d1535500884d644fa9b768c6"}, 799 | {file = "regex-2020.11.13-cp36-cp36m-win32.whl", hash = "sha256:49cae022fa13f09be91b2c880e58e14b6da5d10639ed45ca69b85faf039f7a4e"}, 800 | {file = "regex-2020.11.13-cp36-cp36m-win_amd64.whl", hash = "sha256:749078d1eb89484db5f34b4012092ad14b327944ee7f1c4f74d6279a6e4d1884"}, 801 | {file = "regex-2020.11.13-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b2f4007bff007c96a173e24dcda236e5e83bde4358a557f9ccf5e014439eae4b"}, 802 | {file = "regex-2020.11.13-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:38c8fd190db64f513fe4e1baa59fed086ae71fa45083b6936b52d34df8f86a88"}, 803 | {file = "regex-2020.11.13-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5862975b45d451b6db51c2e654990c1820523a5b07100fc6903e9c86575202a0"}, 804 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:262c6825b309e6485ec2493ffc7e62a13cf13fb2a8b6d212f72bd53ad34118f1"}, 805 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:bafb01b4688833e099d79e7efd23f99172f501a15c44f21ea2118681473fdba0"}, 806 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:e32f5f3d1b1c663af7f9c4c1e72e6ffe9a78c03a31e149259f531e0fed826512"}, 807 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:3bddc701bdd1efa0d5264d2649588cbfda549b2899dc8d50417e47a82e1387ba"}, 808 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:02951b7dacb123d8ea6da44fe45ddd084aa6777d4b2454fa0da61d569c6fa538"}, 809 | {file = "regex-2020.11.13-cp37-cp37m-win32.whl", hash = "sha256:0d08e71e70c0237883d0bef12cad5145b84c3705e9c6a588b2a9c7080e5af2a4"}, 810 | {file = "regex-2020.11.13-cp37-cp37m-win_amd64.whl", hash = "sha256:1fa7ee9c2a0e30405e21031d07d7ba8617bc590d391adfc2b7f1e8b99f46f444"}, 811 | {file = "regex-2020.11.13-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:baf378ba6151f6e272824b86a774326f692bc2ef4cc5ce8d5bc76e38c813a55f"}, 812 | {file = "regex-2020.11.13-cp38-cp38-manylinux1_i686.whl", hash = "sha256:e3faaf10a0d1e8e23a9b51d1900b72e1635c2d5b0e1bea1c18022486a8e2e52d"}, 813 | {file = "regex-2020.11.13-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:2a11a3e90bd9901d70a5b31d7dd85114755a581a5da3fc996abfefa48aee78af"}, 814 | {file = "regex-2020.11.13-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d1ebb090a426db66dd80df8ca85adc4abfcbad8a7c2e9a5ec7513ede522e0a8f"}, 815 | {file = "regex-2020.11.13-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:b2b1a5ddae3677d89b686e5c625fc5547c6e492bd755b520de5332773a8af06b"}, 816 | {file = "regex-2020.11.13-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:2c99e97d388cd0a8d30f7c514d67887d8021541b875baf09791a3baad48bb4f8"}, 817 | {file = "regex-2020.11.13-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:c084582d4215593f2f1d28b65d2a2f3aceff8342aa85afd7be23a9cad74a0de5"}, 818 | {file = "regex-2020.11.13-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:a3d748383762e56337c39ab35c6ed4deb88df5326f97a38946ddd19028ecce6b"}, 819 | {file = "regex-2020.11.13-cp38-cp38-win32.whl", hash = "sha256:7913bd25f4ab274ba37bc97ad0e21c31004224ccb02765ad984eef43e04acc6c"}, 820 | {file = "regex-2020.11.13-cp38-cp38-win_amd64.whl", hash = "sha256:6c54ce4b5d61a7129bad5c5dc279e222afd00e721bf92f9ef09e4fae28755683"}, 821 | {file = "regex-2020.11.13-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1862a9d9194fae76a7aaf0150d5f2a8ec1da89e8b55890b1786b8f88a0f619dc"}, 822 | {file = "regex-2020.11.13-cp39-cp39-manylinux1_i686.whl", hash = "sha256:4902e6aa086cbb224241adbc2f06235927d5cdacffb2425c73e6570e8d862364"}, 823 | {file = "regex-2020.11.13-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:7a25fcbeae08f96a754b45bdc050e1fb94b95cab046bf56b016c25e9ab127b3e"}, 824 | {file = "regex-2020.11.13-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:d2d8ce12b7c12c87e41123997ebaf1a5767a5be3ec545f64675388970f415e2e"}, 825 | {file = "regex-2020.11.13-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:f7d29a6fc4760300f86ae329e3b6ca28ea9c20823df123a2ea8693e967b29917"}, 826 | {file = "regex-2020.11.13-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:717881211f46de3ab130b58ec0908267961fadc06e44f974466d1887f865bd5b"}, 827 | {file = "regex-2020.11.13-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:3128e30d83f2e70b0bed9b2a34e92707d0877e460b402faca908c6667092ada9"}, 828 | {file = "regex-2020.11.13-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:8f6a2229e8ad946e36815f2a03386bb8353d4bde368fdf8ca5f0cb97264d3b5c"}, 829 | {file = "regex-2020.11.13-cp39-cp39-win32.whl", hash = "sha256:f8f295db00ef5f8bae530fc39af0b40486ca6068733fb860b42115052206466f"}, 830 | {file = "regex-2020.11.13-cp39-cp39-win_amd64.whl", hash = "sha256:a15f64ae3a027b64496a71ab1f722355e570c3fac5ba2801cafce846bf5af01d"}, 831 | {file = "regex-2020.11.13.tar.gz", hash = "sha256:83d6b356e116ca119db8e7c6fc2983289d87b27b3fac238cfe5dca529d884562"}, 832 | ] 833 | scikit-learn = [ 834 | {file = "scikit-learn-0.24.0.tar.gz", hash = "sha256:076369634ee72b5a5941440661e2f306ff4ac30903802dc52031c7e9199ac640"}, 835 | {file = "scikit_learn-0.24.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:890d7d588f65acb0c4f6c083347c9076916bda5e6bd8400f06244b1afc1009af"}, 836 | {file = "scikit_learn-0.24.0-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:e534f5f3796db6781c87e9835dcd51b7854c8c5a379c9210b93605965c1941fd"}, 837 | {file = "scikit_learn-0.24.0-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:d7fe05fcb44eadd6d6c874c768f085f5de1239db3a3b7be4d3d23d12e4120589"}, 838 | {file = "scikit_learn-0.24.0-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:7f654befc5ad413690cc58f3f34a3e906caf825195ce0fda00a8e9565e1403e6"}, 839 | {file = "scikit_learn-0.24.0-cp36-cp36m-win32.whl", hash = "sha256:afeb06dc69847927634e58579b9cdc72e1390b79497336b2324b1b173f33bd47"}, 840 | {file = "scikit_learn-0.24.0-cp36-cp36m-win_amd64.whl", hash = "sha256:26f66b3726b54dfb76ea51c5d9c2431ed17ebc066cb4527662b9e851a3e7ba61"}, 841 | {file = "scikit_learn-0.24.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c08b27cb78ee8d2dc781a7affed09859441f5b624f9f92da59ac0791c8774dfc"}, 842 | {file = "scikit_learn-0.24.0-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:905d8934d1e27a686698864a5863ff2c0e13a2ae1adb78a8a848aacc8a49927d"}, 843 | {file = "scikit_learn-0.24.0-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:d819d625832fb2969911a243e009cfa135cb8ef1e150866e417d6e9d75290087"}, 844 | {file = "scikit_learn-0.24.0-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:18f7131e62265bf2691ed1d0303c640313894ccfe4278427478c6b2f45094b53"}, 845 | {file = "scikit_learn-0.24.0-cp37-cp37m-win32.whl", hash = "sha256:b0d13fd56d26cf3de0314a4fd48037108c638fe126d813f5c1222bb0f08b6a76"}, 846 | {file = "scikit_learn-0.24.0-cp37-cp37m-win_amd64.whl", hash = "sha256:c912247e42114f389858ae05d63f4359d4e667ea72aaabee191aee9ad3f9774a"}, 847 | {file = "scikit_learn-0.24.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:758619e49cd7c17282e6cc60d5cc73c02c072b47c9a10010bb3bb47e0d976e50"}, 848 | {file = "scikit_learn-0.24.0-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:66f27bf21202a850bcd7b6303916e4907f6e22ec59a14974ede4955aed5c7ed0"}, 849 | {file = "scikit_learn-0.24.0-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:5e6e3c042cea83f2e20a45e563b8eabc1f8f72446251fe23ebefdf111a173a33"}, 850 | {file = "scikit_learn-0.24.0-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:2a5348585aa793bc8cc5a72f8e9067c9380834b0aadbd55f924843b071f13282"}, 851 | {file = "scikit_learn-0.24.0-cp38-cp38-win32.whl", hash = "sha256:743b6edd98c98991be46c08e6b21df3861d5ae915f91d59f988384d93f7263e7"}, 852 | {file = "scikit_learn-0.24.0-cp38-cp38-win_amd64.whl", hash = "sha256:2951f87d35e72f007701c6e028aa230f6df6212a3194677c0c950486066a454d"}, 853 | {file = "scikit_learn-0.24.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:44e452ea8491225c5783d49577aad0f36202dfd52aec7f82c0fdfe5fbd5f7400"}, 854 | {file = "scikit_learn-0.24.0-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:800aaf63f8838c00e85db2267dd226f89858594843fd03932a9eda95746d2c40"}, 855 | {file = "scikit_learn-0.24.0-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:3eeff086f7329521d27249a082ea3c48c085cedb110db5f65968ab55c3ba2e09"}, 856 | {file = "scikit_learn-0.24.0-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:4395e91b3548005f4a645018435b5a94f8cce232b5b70753020e606c6a750656"}, 857 | {file = "scikit_learn-0.24.0-cp39-cp39-win32.whl", hash = "sha256:80ca024154b84b6ac4cfc86930ba13fdc348a209753bf2c16129db6f9eb8a80b"}, 858 | {file = "scikit_learn-0.24.0-cp39-cp39-win_amd64.whl", hash = "sha256:490436b44b3a1957cb625e871764b0aa330b34cc416aea4abc6c38ca63d0d682"}, 859 | ] 860 | scipy = [ 861 | {file = "scipy-1.5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:4f12d13ffbc16e988fa40809cbbd7a8b45bc05ff6ea0ba8e3e41f6f4db3a9e47"}, 862 | {file = "scipy-1.5.4-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:a254b98dbcc744c723a838c03b74a8a34c0558c9ac5c86d5561703362231107d"}, 863 | {file = "scipy-1.5.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:368c0f69f93186309e1b4beb8e26d51dd6f5010b79264c0f1e9ca00cd92ea8c9"}, 864 | {file = "scipy-1.5.4-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:4598cf03136067000855d6b44d7a1f4f46994164bcd450fb2c3d481afc25dd06"}, 865 | {file = "scipy-1.5.4-cp36-cp36m-win32.whl", hash = "sha256:e98d49a5717369d8241d6cf33ecb0ca72deee392414118198a8e5b4c35c56340"}, 866 | {file = "scipy-1.5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:65923bc3809524e46fb7eb4d6346552cbb6a1ffc41be748535aa502a2e3d3389"}, 867 | {file = "scipy-1.5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:9ad4fcddcbf5dc67619379782e6aeef41218a79e17979aaed01ed099876c0e62"}, 868 | {file = "scipy-1.5.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:f87b39f4d69cf7d7529d7b1098cb712033b17ea7714aed831b95628f483fd012"}, 869 | {file = "scipy-1.5.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:25b241034215247481f53355e05f9e25462682b13bd9191359075682adcd9554"}, 870 | {file = "scipy-1.5.4-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:fa789583fc94a7689b45834453fec095245c7e69c58561dc159b5d5277057e4c"}, 871 | {file = "scipy-1.5.4-cp37-cp37m-win32.whl", hash = "sha256:d6d25c41a009e3c6b7e757338948d0076ee1dd1770d1c09ec131f11946883c54"}, 872 | {file = "scipy-1.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:2c872de0c69ed20fb1a9b9cf6f77298b04a26f0b8720a5457be08be254366c6e"}, 873 | {file = "scipy-1.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e360cb2299028d0b0d0f65a5c5e51fc16a335f1603aa2357c25766c8dab56938"}, 874 | {file = "scipy-1.5.4-cp38-cp38-manylinux1_i686.whl", hash = "sha256:3397c129b479846d7eaa18f999369a24322d008fac0782e7828fa567358c36ce"}, 875 | {file = "scipy-1.5.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:168c45c0c32e23f613db7c9e4e780bc61982d71dcd406ead746c7c7c2f2004ce"}, 876 | {file = "scipy-1.5.4-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:213bc59191da2f479984ad4ec39406bf949a99aba70e9237b916ce7547b6ef42"}, 877 | {file = "scipy-1.5.4-cp38-cp38-win32.whl", hash = "sha256:634568a3018bc16a83cda28d4f7aed0d803dd5618facb36e977e53b2df868443"}, 878 | {file = "scipy-1.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:b03c4338d6d3d299e8ca494194c0ae4f611548da59e3c038813f1a43976cb437"}, 879 | {file = "scipy-1.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3d5db5d815370c28d938cf9b0809dade4acf7aba57eaf7ef733bfedc9b2474c4"}, 880 | {file = "scipy-1.5.4-cp39-cp39-manylinux1_i686.whl", hash = "sha256:6b0ceb23560f46dd236a8ad4378fc40bad1783e997604ba845e131d6c680963e"}, 881 | {file = "scipy-1.5.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:ed572470af2438b526ea574ff8f05e7f39b44ac37f712105e57fc4d53a6fb660"}, 882 | {file = "scipy-1.5.4-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:8c8d6ca19c8497344b810b0b0344f8375af5f6bb9c98bd42e33f747417ab3f57"}, 883 | {file = "scipy-1.5.4-cp39-cp39-win32.whl", hash = "sha256:d84cadd7d7998433334c99fa55bcba0d8b4aeff0edb123b2a1dfcface538e474"}, 884 | {file = "scipy-1.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:cc1f78ebc982cd0602c9a7615d878396bec94908db67d4ecddca864d049112f2"}, 885 | {file = "scipy-1.5.4.tar.gz", hash = "sha256:4a453d5e5689de62e5d38edf40af3f17560bfd63c9c5bd228c18c1f99afa155b"}, 886 | ] 887 | seaborn = [ 888 | {file = "seaborn-0.11.1-py3-none-any.whl", hash = "sha256:4e1cce9489449a1c6ff3c567f2113cdb41122f727e27a984950d004a88ef3c5c"}, 889 | {file = "seaborn-0.11.1.tar.gz", hash = "sha256:44e78eaed937c5a87fc7a892c329a7cc091060b67ebd1d0d306b446a74ba01ad"}, 890 | ] 891 | six = [ 892 | {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, 893 | {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, 894 | ] 895 | sklearn = [ 896 | {file = "sklearn-0.0.tar.gz", hash = "sha256:e23001573aa194b834122d2b9562459bf5ae494a2d59ca6b8aa22c85a44c0e31"}, 897 | ] 898 | threadpoolctl = [ 899 | {file = "threadpoolctl-2.1.0-py3-none-any.whl", hash = "sha256:38b74ca20ff3bb42caca8b00055111d74159ee95c4370882bbff2b93d24da725"}, 900 | {file = "threadpoolctl-2.1.0.tar.gz", hash = "sha256:ddc57c96a38beb63db45d6c159b5ab07b6bced12c45a1f07b2b92f272aebfa6b"}, 901 | ] 902 | toml = [ 903 | {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, 904 | {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, 905 | ] 906 | typed-ast = [ 907 | {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3"}, 908 | {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb"}, 909 | {file = "typed_ast-1.4.1-cp35-cp35m-win32.whl", hash = "sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919"}, 910 | {file = "typed_ast-1.4.1-cp35-cp35m-win_amd64.whl", hash = "sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01"}, 911 | {file = "typed_ast-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75"}, 912 | {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652"}, 913 | {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"}, 914 | {file = "typed_ast-1.4.1-cp36-cp36m-win32.whl", hash = "sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1"}, 915 | {file = "typed_ast-1.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa"}, 916 | {file = "typed_ast-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614"}, 917 | {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41"}, 918 | {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b"}, 919 | {file = "typed_ast-1.4.1-cp37-cp37m-win32.whl", hash = "sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe"}, 920 | {file = "typed_ast-1.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355"}, 921 | {file = "typed_ast-1.4.1-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6"}, 922 | {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907"}, 923 | {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d"}, 924 | {file = "typed_ast-1.4.1-cp38-cp38-win32.whl", hash = "sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c"}, 925 | {file = "typed_ast-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4"}, 926 | {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34"}, 927 | {file = "typed_ast-1.4.1.tar.gz", hash = "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b"}, 928 | ] 929 | typing-extensions = [ 930 | {file = "typing_extensions-3.7.4.3-py2-none-any.whl", hash = "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f"}, 931 | {file = "typing_extensions-3.7.4.3-py3-none-any.whl", hash = "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918"}, 932 | {file = "typing_extensions-3.7.4.3.tar.gz", hash = "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c"}, 933 | ] 934 | zipp = [ 935 | {file = "zipp-3.4.0-py3-none-any.whl", hash = "sha256:102c24ef8f171fd729d46599845e95c7ab894a4cf45f5de11a44cc7444fb1108"}, 936 | {file = "zipp-3.4.0.tar.gz", hash = "sha256:ed5eee1974372595f9e416cc7bbeeb12335201d8081ca8a0743c954d4446e5cb"}, 937 | ] 938 | -------------------------------------------------------------------------------- /prts/__init__.py: -------------------------------------------------------------------------------- 1 | from prts.time_series_metrics.fscore import TimeSeriesFScore 2 | from prts.time_series_metrics.precision import TimeSeriesPrecision 3 | from prts.time_series_metrics.recall import TimeSeriesRecall 4 | 5 | 6 | def ts_precision(real, pred, alpha=0.0, cardinality="one", bias="flat"): 7 | """Compute the time series precision. 8 | 9 | The time series precision is the average of "Precision_Ti", where "Precision_Ti" is 10 | the precision score of each predicted anomaly range. 11 | "Precision_Ti" for a single predicted anomaly range is calculated by the following formula. 12 | Precision_Ti = α x ExistenceReward + (1 - α) x OverlapReward , where 0 ≤ α ≤ 1 13 | α represents the relative importance of rewarding existence, whereas 14 | (1 − α) represents the relative importance of rewarding size, position, and cardinality. 15 | 16 | "ExistenceReward" is 1 if a real anomaly range has overlap with even a single point of 17 | the predicted anomaly range, 0 otherwise. 18 | Note: For prediction, there is no need for an existence reward, since precision by definition 19 | emphasizes prediction quality, and existence by itself is too low a bar for judging 20 | the quality of a prediction (i.e., α = 0). 21 | 22 | "OverlapReward" is calculated by the following formula. 23 | OverlapReward = CardinalityFactor x Sum of ω 24 | "CardinalityFactor" is 1 if the predicted anomaly range overlaps with only one real anomaly range. 25 | Otherwise it receives 0 ≤ γ() ≤ 1 defined by the application. 26 | "CardinalityFactor" serves as a scaling factor for the rewards "ω"s, which is earned from overlap 27 | size and position. 28 | In determing "ω", we consider the size of the correctly predicted portion of an predicted anomaly 29 | range and the relative position of the correctly predicted portion of an predicted anomaly range. 30 | 31 | Args: 32 | real: np.ndarray 33 | One-dimensional array of correct answers with values of 1 or 0. 34 | pred: np.ndarray 35 | One-dimensional array of predicted answers with values of 1 or 0. 36 | alpha: float, default=0.0 37 | Relative importance of existence reward. 0 ≤ alpha ≤ 1. 38 | cardinality: string, default="one" 39 | Cardinality type. This should be "one", "reciprocal" or "udf_gamma". 40 | bias: string, default="flat" 41 | Positional bias. This should be "flat", "front", "middle", or "back" 42 | 43 | Returns: 44 | float: precision.score 45 | """ 46 | precision = TimeSeriesPrecision(alpha, cardinality, bias) 47 | return precision.score(real, pred) 48 | 49 | 50 | def ts_recall(real, pred, alpha=0.0, cardinality="one", bias="flat"): 51 | """Compute the time series recall. 52 | 53 | The time series recall is the average of "Recall_Ti", where "Recall_Ti" is 54 | the recall score of each real anomaly range. 55 | "Recall_Ti" for a single real anomaly range is calculated by the following formula. 56 | Recall_Ti = α x ExistenceReward + (1 - α) x OverlapReward , where 0 ≤ α ≤ 1 57 | α represents the relative importance of rewarding existence, whereas 58 | (1 − α) represents the relative importance of rewarding size, position, and cardinality. 59 | 60 | "ExistenceReward" is 1 if a prediction captures even a single point of the real anomaly range, 0 otherwise. 61 | 62 | "OverlapReward" is calculated by the following formula. 63 | OverlapReward = CardinalityFactor x Sum of ω 64 | "CardinalityFactor" is 1 if the real anomaly range overlaps with only one predicted anomaly range. 65 | Otherwise it receives 0 ≤ γ() ≤ 1 defined by the application. 66 | "CardinalityFactor" serves as a scaling factor for the rewards "ω"s, which is earned from overlap 67 | size and position. 68 | In determing "ω", we consider the size of the correctly predicted portion of the real anomaly range 69 | and the relative 70 | position of the correctly predicted portion of the real anomaly range. 71 | 72 | Args: 73 | real: np.ndarray 74 | One-dimensional array of correct answers with values of 1 or 0. 75 | pred: np.ndarray 76 | One-dimensional array of predicted answers with values of 1 or 0. 77 | alpha: float, default=0.0 78 | Relative importance of existence reward. 0 ≤ alpha ≤ 1. 79 | cardinality: string, default="one" 80 | Cardinality type. This should be "one", "reciprocal" or "udf_gamma". 81 | bias: string, default="flat" 82 | Positional bias. This should be "flat", "front", "middle", or "back" 83 | 84 | Returns: 85 | float: recall.score 86 | """ 87 | recall = TimeSeriesRecall(alpha, cardinality, bias) 88 | return recall.score(real, pred) 89 | 90 | 91 | def ts_fscore(real, pred, beta=1.0, p_alpha=0.0, r_alpha=0.0, cardinality="one", p_bias="flat", r_bias="flat"): 92 | """Compute the time series f-score 93 | 94 | The F-beta score is the weighted harmonic mean of precision and recall, 95 | reaching its optimal value at 1 and its worst value at 0. 96 | The beta parameter determines the weight of recall in the combined score. 97 | beta < 1 lends more weight to precision, while beta > 1 favors recall 98 | (beta -> 0 considers only precision, beta -> +inf only recall). 99 | 100 | Args: 101 | real: np.ndarray 102 | One-dimensional array of correct answers with values of 1 or 0. 103 | pred: np.ndarray 104 | One-dimensional array of predicted answers with values of 1 or 0. 105 | p_alpha: float, default=0.0 106 | Relative importance of existence reward for precision. 0 ≤ alpha ≤ 1. 107 | r_alpha: float, default=0.0 108 | Relative importance of existence reward for recall. 0 ≤ alpha ≤ 1. 109 | cardinality: string, default="one" 110 | Cardinality type. This should be "one", "reciprocal" or "udf_gamma". 111 | p_bias: string, default="flat" 112 | Positional bias for precision. This should be "flat", "front", "middle", or "back" 113 | r_bias: string, default="flat" 114 | Positional bias for recall. This should be "flat", "front", "middle", or "back" 115 | 116 | Returns: 117 | float: f.score 118 | """ 119 | 120 | fscore = TimeSeriesFScore(beta, p_alpha, r_alpha, cardinality, p_bias, r_bias) 121 | return fscore.score(real, pred) 122 | -------------------------------------------------------------------------------- /prts/base/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompML/PRTS/66db2ac5f83ac9182ce29dcd7afc0f678a678eed/prts/base/__init__.py -------------------------------------------------------------------------------- /prts/base/time_series_metrics.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | import numpy as np 4 | 5 | 6 | class BaseTimeSeriesMetrics: 7 | """Base class for time series metrics """ 8 | 9 | def score(self, real: np.ndarray, pred: np.ndarray) -> Any: 10 | """ 11 | 12 | Args: 13 | real: 14 | pred: 15 | 16 | Returns: 17 | 18 | """ 19 | ... 20 | 21 | def _udf_gamma(self): 22 | """The function of the user-defined gamma. 23 | 24 | Returns: 25 | float: the value of the user-defined gamma 26 | """ 27 | 28 | return 1.0 29 | 30 | def _gamma_select(self, gamma: str, overlap: int) -> float: 31 | """The function of selecting the gamma value according to the parameters. 32 | 33 | Args: 34 | gamma: str 35 | - 'one': the value 1 36 | - 'reciprocal';: a reciprocal of the overlap 37 | - 'udf_gamma': user defined gamma 38 | overlap: int 39 | overlap between real and pred 40 | 41 | Returns: 42 | float: the selected gamma value 43 | """ 44 | assert type(overlap) == int, TypeError("") 45 | 46 | if gamma == "one": 47 | return 1.0 48 | elif gamma == "reciprocal": 49 | if overlap > 1: 50 | return 1.0 / overlap 51 | else: 52 | return 1.0 53 | elif gamma == "udf_gamma": 54 | if overlap > 1: 55 | return 1.0 / self._udf_gamma() 56 | else: 57 | return 1.0 58 | else: 59 | raise ValueError(f"Expected one of one, reciprocal, udf_gamma. gamma type string: {gamma}") 60 | 61 | def _gamma_function(self, overlap_count): 62 | overlap = overlap_count[0] 63 | return self._gamma_select(self.cardinality, overlap) 64 | 65 | def _compute_omega_reward(self, r1, r2, overlap_count): 66 | if r1[1] < r2[0] or r1[0] > r2[1]: 67 | return 0 68 | else: 69 | overlap_count[0] += 1 70 | overlap = np.zeros(r1.shape) 71 | overlap[0] = max(r1[0], r2[0]) 72 | overlap[1] = min(r1[1], r2[1]) 73 | return self._omega_function(r1, overlap) 74 | 75 | def _omega_function(self, rrange, overlap): 76 | anomaly_length = rrange[1] - rrange[0] + 1 77 | my_positional_bias = 0 78 | max_positional_bias = 0 79 | temp_bias = 0 80 | for i in range(1, anomaly_length + 1): 81 | temp_bias = self._delta_function(i, anomaly_length) 82 | max_positional_bias += temp_bias 83 | j = rrange[0] + i - 1 84 | if j >= overlap[0] and j <= overlap[1]: 85 | my_positional_bias += temp_bias 86 | if max_positional_bias > 0: 87 | res = my_positional_bias / max_positional_bias 88 | return res 89 | else: 90 | return 0 91 | 92 | def _delta_function(self, t, anomaly_length): 93 | return self._delta_select(self.bias, t, anomaly_length) 94 | 95 | def _delta_select(self, delta, t, anomaly_length): 96 | if delta == "flat": 97 | return 1.0 98 | elif delta == "front": 99 | return float(anomaly_length - t + 1.0) 100 | elif delta == "middle": 101 | if t <= anomaly_length / 2.0: 102 | return float(t) 103 | else: 104 | return float(anomaly_length - t + 1.0) 105 | elif delta == "back": 106 | return float(t) 107 | elif delta == "udf_delta": 108 | return self._udf_delta(t, anomaly_length) 109 | else: 110 | raise Exception("Invalid positional bias value") 111 | 112 | def _udf_delta(self): 113 | """ 114 | user defined delta function 115 | """ 116 | 117 | return 1.0 118 | 119 | def _shift(self, arr, num, fill_value=np.nan): 120 | arr = np.roll(arr, num) 121 | if num < 0: 122 | arr[num:] = fill_value 123 | elif num > 0: 124 | arr[:num] = fill_value 125 | return arr 126 | 127 | def _prepare_data(self, values_real, values_pred): 128 | 129 | assert len(values_real) == len(values_pred) 130 | assert np.allclose(np.unique(values_real), np.array([0, 1])) or np.allclose( 131 | np.unique(values_real), np.array([1]) 132 | ) 133 | assert np.allclose(np.unique(values_pred), np.array([0, 1])) or np.allclose( 134 | np.unique(values_pred), np.array([1]) 135 | ) 136 | 137 | predicted_anomalies_ = np.argwhere(values_pred == 1).ravel() 138 | predicted_anomalies_shift_forward = self._shift(predicted_anomalies_, 1, fill_value=predicted_anomalies_[0]) 139 | predicted_anomalies_shift_backward = self._shift(predicted_anomalies_, -1, fill_value=predicted_anomalies_[-1]) 140 | predicted_anomalies_start = np.argwhere( 141 | (predicted_anomalies_shift_forward - predicted_anomalies_) != -1 142 | ).ravel() 143 | predicted_anomalies_finish = np.argwhere( 144 | (predicted_anomalies_ - predicted_anomalies_shift_backward) != -1 145 | ).ravel() 146 | predicted_anomalies = np.hstack( 147 | [ 148 | predicted_anomalies_[predicted_anomalies_start].reshape(-1, 1), 149 | predicted_anomalies_[predicted_anomalies_finish].reshape(-1, 1), 150 | ] 151 | ) 152 | 153 | real_anomalies_ = np.argwhere(values_real == 1).ravel() 154 | real_anomalies_shift_forward = self._shift(real_anomalies_, 1, fill_value=real_anomalies_[0]) 155 | real_anomalies_shift_backward = self._shift(real_anomalies_, -1, fill_value=real_anomalies_[-1]) 156 | real_anomalies_start = np.argwhere((real_anomalies_shift_forward - real_anomalies_) != -1).ravel() 157 | real_anomalies_finish = np.argwhere((real_anomalies_ - real_anomalies_shift_backward) != -1).ravel() 158 | real_anomalies = np.hstack( 159 | [ 160 | real_anomalies_[real_anomalies_start].reshape(-1, 1), 161 | real_anomalies_[real_anomalies_finish].reshape(-1, 1), 162 | ] 163 | ) 164 | 165 | return real_anomalies, predicted_anomalies 166 | -------------------------------------------------------------------------------- /prts/time_series_metrics/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompML/PRTS/66db2ac5f83ac9182ce29dcd7afc0f678a678eed/prts/time_series_metrics/__init__.py -------------------------------------------------------------------------------- /prts/time_series_metrics/fscore.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from prts.base.time_series_metrics import BaseTimeSeriesMetrics 4 | from prts.time_series_metrics.precision import TimeSeriesPrecision 5 | from prts.time_series_metrics.recall import TimeSeriesRecall 6 | 7 | 8 | class TimeSeriesFScore(BaseTimeSeriesMetrics): 9 | """ This class calculates f-score for time series""" 10 | 11 | def __init__(self, beta=1.0, p_alpha=0.0, r_alpha=0.0, cardinality="one", p_bias="flat", r_bias="flat"): 12 | """Constructor 13 | 14 | Args: 15 | beta (float, optional): determines the weight of recall in the combined score.. Defaults to 1.0. 16 | p_alpha (float, optional): alpha of precision, 0<=alpha_p<=1. Defaults to 0.0. 17 | r_alpha (float, optional): alpha of recall, 0<=alpha<=1. Defaults to 0.0. 18 | cardinality (str, optional): ["one", "reciprocal", "udf_gamma"]. Defaults to "one". 19 | p_bias (str, optional): bias of precision, ["flat", "front", "middle", "back"]. Defaults to "flat". 20 | r_bias (str, optional): bias of recall, ["flat", "front", "middle", "back"]. Defaults to "flat". 21 | """ 22 | 23 | assert beta >= 0 24 | 25 | self.beta = beta 26 | self.p_alpha = p_alpha 27 | self.r_alpha = r_alpha 28 | self.cardinality = cardinality 29 | self.p_bias = p_bias 30 | self.r_bias = r_bias 31 | 32 | def score(self, real: np.ndarray, pred: np.ndarray) -> float: 33 | """Computing fbeta score 34 | 35 | Args: 36 | real (np.ndarray): 37 | One-dimensional array of correct answers with values of 1 or 0. 38 | pred (np.ndarray): 39 | One-dimensional array of predicted answers with values of 1 or 0. 40 | 41 | Returns: 42 | float: fbeta 43 | """ 44 | 45 | assert isinstance(real, np.ndarray) or isinstance(real, list) 46 | assert isinstance(pred, np.ndarray) or isinstance(pred, list) 47 | 48 | if not isinstance(real, np.ndarray): 49 | real = np.array(real) 50 | if not isinstance(pred, np.ndarray): 51 | pred = np.array(pred) 52 | 53 | precision = TimeSeriesPrecision(self.p_alpha, self.cardinality, self.p_bias).score(real, pred) 54 | recall = TimeSeriesRecall(self.r_alpha, self.cardinality, self.r_bias).score(real, pred) 55 | 56 | if precision + recall != 0: 57 | f_beta = (1 + self.beta ** 2) * precision * recall / (self.beta ** 2 * precision + recall) 58 | else: 59 | f_beta = 0 60 | 61 | return f_beta 62 | -------------------------------------------------------------------------------- /prts/time_series_metrics/precision.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | import numpy as np 4 | 5 | from prts.base.time_series_metrics import BaseTimeSeriesMetrics 6 | 7 | 8 | class TimeSeriesPrecision(BaseTimeSeriesMetrics): 9 | """ This class calculates precision for time series""" 10 | 11 | def __init__(self, alpha=0.0, cardinality="one", bias="flat"): 12 | """Constructor 13 | 14 | Args: 15 | alpha (float, optional): 0 <= alpha <= 1. Defaults to 0.0. 16 | cardinality (str, optional): ["one", "reciprocal", "udf_gamma"]. Defaults to "one". 17 | bias (str, optional): ["flat", "front", "middle", "back"]. Defaults to "flat". 18 | """ 19 | 20 | assert (alpha >= 0) & (alpha <= 1) 21 | assert cardinality in ["one", "reciprocal", "udf_gamma"] 22 | assert bias in ["flat", "front", "middle", "back"] 23 | 24 | self.alpha = alpha 25 | self.cardinality = cardinality 26 | self.bias = bias 27 | 28 | def score(self, real: Union[np.ndarray, list], pred: Union[np.ndarray, list]) -> float: 29 | """Computing precision score 30 | 31 | Args: 32 | real (np.ndarray or list): 33 | One-dimensional array of correct answers with values of 1 or 0. 34 | pred (np.ndarray or list): 35 | One-dimensional array of predicted answers with values of 1 or 0. 36 | 37 | Returns: 38 | float: precision 39 | """ 40 | 41 | assert isinstance(real, np.ndarray) or isinstance(real, list) 42 | assert isinstance(pred, np.ndarray) or isinstance(pred, list) 43 | 44 | if not isinstance(real, np.ndarray): 45 | real = np.array(real) 46 | if not isinstance(pred, np.ndarray): 47 | pred = np.array(pred) 48 | 49 | real_anomalies, predicted_anomalies = self._prepare_data(real, pred) 50 | precision = self._update_precision(real_anomalies, predicted_anomalies) 51 | 52 | return precision 53 | 54 | def _update_precision(self, real_anomalies: np.ndarray, predicted_anomalies: np.ndarray) -> float: 55 | """Update precision 56 | 57 | Args: 58 | real_anomalies (np.ndarray): 59 | 2-dimensional array of the first and last indexes of each real anomaly range. 60 | e.g. np.array([[1933, 1953],[1958, 2000], ...]) 61 | predicted_anomalies (np.ndarray): 62 | 2-dimensional array of the first and last indexes of each predicted anomaly range. 63 | e.g. np.array([[1933, 1953],[1958, 2000], ...]) 64 | 65 | Returns: 66 | float: precision 67 | """ 68 | precision = 0 69 | if len(predicted_anomalies) == 0: 70 | return 0 71 | for i in range(len(predicted_anomalies)): 72 | range_p = predicted_anomalies[i, :] 73 | omega_reward = 0 74 | overlap_count = [0] 75 | for j in range(len(real_anomalies)): 76 | range_r = real_anomalies[j, :] 77 | omega_reward += self._compute_omega_reward(range_p, range_r, overlap_count) 78 | overlap_reward = self._gamma_function(overlap_count) * omega_reward 79 | if overlap_count[0] > 0: 80 | existence_reward = 1 81 | else: 82 | existence_reward = 0 83 | 84 | precision += self.alpha * existence_reward + (1 - self.alpha) * overlap_reward 85 | precision /= len(predicted_anomalies) 86 | return precision 87 | -------------------------------------------------------------------------------- /prts/time_series_metrics/precision_recall.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | import numpy as np 4 | 5 | from prts.base.time_series_metrics import BaseTimeSeriesMetrics 6 | 7 | 8 | class TimeSeriesPrecisionRecall(BaseTimeSeriesMetrics): 9 | """ This class calculates precision and recall for time series """ 10 | 11 | def score(self, real: np.ndarray, pred: np.ndarray) -> Any: 12 | """ 13 | 14 | Args: 15 | real: 16 | pred: 17 | 18 | Returns: 19 | 20 | """ 21 | # TODO: impl 22 | -------------------------------------------------------------------------------- /prts/time_series_metrics/recall.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | import numpy as np 4 | 5 | from prts.base.time_series_metrics import BaseTimeSeriesMetrics 6 | 7 | 8 | class TimeSeriesRecall(BaseTimeSeriesMetrics): 9 | """ This class calculates recall for time series """ 10 | 11 | def __init__(self, alpha=0.0, cardinality="one", bias="flat"): 12 | """Constructor 13 | 14 | Args: 15 | alpha (float, optional): 0 <= alpha <= 1. Defaults to 0.0. 16 | cardinality (str, optional): ["one", "reciprocal", "udf_gamma"]. Defaults to "one". 17 | bias (str, optional): ["flat", "front", "middle", "back"]. Defaults to "flat". 18 | """ 19 | 20 | assert (alpha >= 0) & (alpha <= 1) 21 | assert cardinality in ["one", "reciprocal", "udf_gamma"] 22 | assert bias in ["flat", "front", "middle", "back"] 23 | 24 | self.alpha = alpha 25 | self.cardinality = cardinality 26 | self.bias = bias 27 | 28 | def score(self, real: Union[np.ndarray, list], pred: Union[np.ndarray, list]) -> float: 29 | """Computing recall score 30 | 31 | Args: 32 | real (np.ndarray or list): 33 | One-dimensional array of correct answers with values of 1 or 0. 34 | pred (np.ndarray or list): 35 | One-dimensional array of predicted answers with values of 1 or 0. 36 | Returns: 37 | float: recall 38 | """ 39 | 40 | assert isinstance(real, np.ndarray) or isinstance(real, list) 41 | assert isinstance(pred, np.ndarray) or isinstance(pred, list) 42 | 43 | if not isinstance(real, np.ndarray): 44 | real = np.array(real) 45 | if not isinstance(pred, np.ndarray): 46 | pred = np.array(pred) 47 | 48 | real_anomalies, predicted_anomalies = self._prepare_data(real, pred) 49 | recall = self._update_recall(real_anomalies, predicted_anomalies) 50 | 51 | return recall 52 | 53 | def _update_recall(self, real_anomalies: np.ndarray, predicted_anomalies: np.ndarray) -> float: 54 | """Update recall 55 | Args: 56 | real_anomalies (np.ndarray): 57 | 2-dimensional array of the first and last indexes of each real anomaly range. 58 | e.g. np.array([[1933, 1953],[1958, 2000], ...]) 59 | predicted_anomalies (np.ndarray): 60 | 2-dimensional array of the first and last indexes of each predicted anomaly range. 61 | e.g. np.array([[1933, 1953],[1958, 2000], ...]) 62 | Returns: 63 | float: recall 64 | """ 65 | 66 | recall = 0 67 | if len(real_anomalies) == 0: 68 | return 0 69 | for i in range(len(real_anomalies)): 70 | omega_reward = 0 71 | overlap_count = [0] 72 | range_r = real_anomalies[i, :] 73 | for j in range(len(predicted_anomalies)): 74 | range_p = predicted_anomalies[j, :] 75 | omega_reward += self._compute_omega_reward(range_r, range_p, overlap_count) 76 | overlap_reward = self._gamma_function(overlap_count) * omega_reward 77 | 78 | if overlap_count[0] > 0: 79 | existence_reward = 1 80 | else: 81 | existence_reward = 0 82 | 83 | recall += self.alpha * existence_reward + (1 - self.alpha) * overlap_reward 84 | recall /= len(real_anomalies) 85 | return recall 86 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "prts" 3 | version = "1.0.0.3" 4 | description="" 5 | readme = "README.md" 6 | license = "LICENSE" 7 | authors = ["Ryohei Izawa ", "Ryosuke Sato", "Masanari Kimura"] 8 | 9 | [tool.poetry.dependencies] 10 | python = "^3.6" 11 | numpy = "^1.19.4" 12 | 13 | [tool.poetry.dev-dependencies] 14 | sklearn = "^0.0" 15 | matplotlib = "^3.3.3" 16 | seaborn = "^0.11.1" 17 | flake8 = "^3.8.4" 18 | autoflake = "^1.4" 19 | isort = "^5.6.4" 20 | black = "^20.8b1" 21 | pytest = "^6.2.1" 22 | pytest-cov = "^2.10.1" 23 | 24 | [build-system] 25 | requires = ["poetry-core>=1.0.0"] 26 | build-backend = "poetry.core.masonry.api" 27 | -------------------------------------------------------------------------------- /tests/test_fscore.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import numpy as np 3 | 4 | from prts.base.time_series_metrics import BaseTimeSeriesMetrics 5 | from prts.time_series_metrics.fscore import TimeSeriesFScore 6 | from prts import ts_fscore 7 | 8 | 9 | class TestFScore(unittest.TestCase): 10 | def test_FScoreClass_inherited_BaseTimeSeriesMetrics(self): 11 | """ Check if it inherits BaseTimeSeriesMetrics 12 | """ 13 | obj = TimeSeriesFScore() 14 | self.assertTrue( 15 | isinstance(obj, BaseTimeSeriesMetrics) 16 | ) 17 | 18 | def test_FscoreClass_init(self): 19 | """ Test of init function 20 | """ 21 | 22 | test_case_1 = {'beta': 1.0, 'p_alpha': 0.0, 'r_alpha': 0.0} 23 | test_case_2 = {'beta': -1.0, 'p_alpha': 0.0, 'r_alpha': 0.0} 24 | 25 | # test of normal call 26 | obj = TimeSeriesFScore(**test_case_1) 27 | self.assertEqual(obj.beta, test_case_1['beta']) 28 | self.assertEqual(obj.p_alpha, test_case_1['p_alpha']) 29 | self.assertEqual(obj.r_alpha, test_case_1['r_alpha']) 30 | 31 | # test of the invalid beta 32 | with self.assertRaises(Exception): 33 | obj = TimeSeriesFScore(**test_case_2) 34 | 35 | def test_fscore_function(self): 36 | """Teest of ts_fscore function. 37 | """ 38 | 39 | real = np.array([1, 1, 1, 0, 0]) 40 | pred = np.array([0, 1, 0, 0, 0]) 41 | 42 | score = ts_fscore(real, pred) 43 | self.assertEqual(score, 0.5) 44 | 45 | def test_fscore_function_with_list(self): 46 | """Teest of ts_fscore function with list type arguments. 47 | """ 48 | 49 | real = [1, 1, 1, 0, 0] 50 | pred = [0, 1, 0, 0, 0] 51 | 52 | score = ts_fscore(real, pred) 53 | self.assertEqual(score, 0.5) 54 | -------------------------------------------------------------------------------- /tests/test_interfaces.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from prts.base.time_series_metrics import BaseTimeSeriesMetrics 4 | 5 | 6 | class TestPrecision(unittest.TestCase): 7 | def test_BaseTimeSeriesMetricsClass_udf_gamma(self): 8 | """ Check the value of udf_gamma. 9 | """ 10 | obj = BaseTimeSeriesMetrics() 11 | self.assertEqual(obj._udf_gamma(), 1.0) 12 | 13 | def test_BaseTimeSeriesMetricsClass_gamma_select(self): 14 | """ Check the value of gamma_select. 15 | """ 16 | obj = BaseTimeSeriesMetrics() 17 | self.assertEqual(obj._gamma_select("one", 1), 1.0) 18 | self.assertEqual(obj._gamma_select("reciprocal", 2), 0.5) 19 | self.assertEqual(obj._gamma_select("udf_gamma", 2), 1.0) 20 | self.assertEqual(obj._gamma_select("udf_gamma", 1), 1.0) 21 | with self.assertRaises(ValueError): 22 | _ = obj._gamma_select("two", 1) 23 | 24 | if __name__ == '__main__': 25 | unittest.main() 26 | -------------------------------------------------------------------------------- /tests/test_precision.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import numpy as np 3 | 4 | from prts.base.time_series_metrics import BaseTimeSeriesMetrics 5 | from prts.time_series_metrics.precision import TimeSeriesPrecision 6 | from prts import ts_precision 7 | 8 | 9 | class TestPrecision(unittest.TestCase): 10 | def test_PrecisionClass_inherited_BaseTimeSeriesMetrics(self): 11 | """ Check if it inherits BaseTimeSeriesMetircs. 12 | """ 13 | obj = TimeSeriesPrecision() 14 | self.assertTrue( 15 | isinstance(obj, BaseTimeSeriesMetrics) 16 | ) 17 | 18 | def test_PrecisionClass_init(self): 19 | """ Test of init function. 20 | """ 21 | 22 | test_case_1 = {'alpha': 0.0, 'cardinality': 'one', 'bias': 'flat'} 23 | test_case_2 = {'alpha': 0.0, 'cardinality': 'one', 'bias': None} 24 | test_case_3 = {'alpha': 10.0, 'cardinality': 'one', 'bias': 'flat'} 25 | 26 | # test of the normal call 27 | obj = TimeSeriesPrecision(**test_case_1) 28 | self.assertEqual(obj.alpha, test_case_1['alpha']) 29 | self.assertEqual(obj.cardinality, test_case_1['cardinality']) 30 | self.assertEqual(obj.bias, test_case_1['bias']) 31 | 32 | # test of the invalid bias 33 | with self.assertRaises(Exception): 34 | obj = TimeSeriesPrecision(**test_case_2) 35 | 36 | # test of the invalid alpha 37 | with self.assertRaises(Exception): 38 | obj = TimeSeriesPrecision(**test_case_3) 39 | 40 | def test_PrecisionClass_score(self): 41 | """Test of score function. 42 | """ 43 | 44 | # test normal case 45 | real = np.array([1, 1, 0, 0, 0]) 46 | pred = np.array([0, 1, 0, 0, 0]) 47 | 48 | obj = TimeSeriesPrecision() 49 | 50 | score = obj.score(real, pred) 51 | self.assertEqual(score, 1.0) 52 | 53 | # test invalid inputs 54 | real = None 55 | pred = np.array([0, 1, 0, 0, 0]) 56 | with self.assertRaises(Exception): 57 | score = obj.score(real, pred) 58 | 59 | real = np.array([1, 1, 0, 0, 0]) 60 | pred = None 61 | with self.assertRaises(Exception): 62 | score = obj.score(real, pred) 63 | 64 | def test_PrecisionClass_update_precision(self): 65 | """Test of _update_precision function. 66 | """ 67 | 68 | # test of the normal case 69 | real = np.array([1, 1, 0, 0, 0]) 70 | pred = np.array([0, 1, 0, 0, 0]) 71 | 72 | obj = TimeSeriesPrecision() 73 | real_anomalies, predicted_anomalies = obj._prepare_data(real, pred) 74 | 75 | score = obj._update_precision(real_anomalies, predicted_anomalies) 76 | self.assertEqual(score, 1.0) 77 | 78 | # test of the empty case 79 | empty_real = np.array([]) 80 | empty_pred = np.array([]) 81 | 82 | score = obj._update_precision(empty_real, empty_pred) 83 | self.assertEqual(score, 0.0) 84 | 85 | def test_precision_function(self): 86 | """Teest of ts_precision function. 87 | """ 88 | 89 | # test case1 90 | real = np.array([1, 1, 0, 0, 0]) 91 | pred = np.array([0, 1, 0, 0, 0]) 92 | 93 | score = ts_precision(real, pred) 94 | self.assertEqual(score, 1.0) 95 | 96 | # test case2 97 | real = np.array([1, 1, 0, 0, 0]) 98 | pred = np.array([0, 0, 1, 1, 1]) 99 | 100 | score = ts_precision(real, pred) 101 | self.assertEqual(score, 0.0) 102 | 103 | def test_precision_function_with_list(self): 104 | """Teet of ts_precision function with list type arguments. 105 | """ 106 | 107 | real = [1, 1, 0, 0, 0] 108 | pred = [0, 1, 0, 0, 0] 109 | 110 | score = ts_precision(real, pred) 111 | self.assertEqual(score, 1.0) 112 | 113 | def test_precision_function_with_invalid_alpha(self): 114 | """Test of ts_precision function with invalid alpha 115 | """ 116 | 117 | real = np.array([1, 1, 0, 0, 0]) 118 | pred = np.array([0, 1, 0, 0, 0]) 119 | 120 | with self.assertRaises(Exception): 121 | ts_precision(real, pred, alpha=10) 122 | 123 | with self.assertRaises(Exception): 124 | ts_precision(real, pred, alpha=-1) 125 | 126 | def test_precision_function_with_invalid_bias(self): 127 | """Test of ts_precision function with invalid bias 128 | """ 129 | 130 | real = np.array([1, 1, 0, 0, 0]) 131 | pred = np.array([0, 1, 0, 0, 0]) 132 | 133 | with self.assertRaises(Exception): 134 | ts_precision(real, pred, bias=None) 135 | 136 | with self.assertRaises(Exception): 137 | ts_precision(real, pred, bias="Invalid") 138 | 139 | def test_precision_function_with_all_zeros(self): 140 | """Test of ts_precision function with all zero values 141 | """ 142 | 143 | real = np.array([0, 0, 0, 0, 0]) 144 | pred = np.array([0, 0, 0, 0, 0]) 145 | 146 | with self.assertRaises(Exception): 147 | ts_precision(real, pred) 148 | 149 | def test_precision_function_with_all_ones(self): 150 | """Test of ts_precision function with all zero values 151 | """ 152 | 153 | real = np.array([1, 1, 1, 1, 1]) 154 | pred = np.array([1, 1, 1, 1, 1]) 155 | 156 | self.assertEqual(ts_precision(real, pred), 1.0) 157 | 158 | -------------------------------------------------------------------------------- /tests/test_precision_recall.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from prts.base.time_series_metrics import BaseTimeSeriesMetrics 4 | from prts.time_series_metrics.precision_recall import TimeSeriesPrecisionRecall 5 | 6 | 7 | class TestPrecision(unittest.TestCase): 8 | def test_PrecisionRecallClass_inherited_BaseTimeSeriesMetrics(self): 9 | """ BaseTimeSeriesMetircsを継承しているかチェック 10 | """ 11 | obj = TimeSeriesPrecisionRecall() 12 | self.assertTrue( 13 | isinstance(obj, BaseTimeSeriesMetrics) 14 | ) 15 | 16 | 17 | if __name__ == '__main__': 18 | unittest.main() 19 | -------------------------------------------------------------------------------- /tests/test_recall.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import numpy as np 3 | 4 | from prts.base.time_series_metrics import BaseTimeSeriesMetrics 5 | from prts.time_series_metrics.recall import TimeSeriesRecall 6 | from prts import ts_recall 7 | 8 | 9 | class TestRecall(unittest.TestCase): 10 | def test_recall_inherited_BaseTimeSeriesMetrics(self): 11 | """ BaseTimeSeriesMetircsを継承しているかチェック 12 | """ 13 | recall = TimeSeriesRecall() 14 | self.assertTrue( 15 | isinstance(recall, BaseTimeSeriesMetrics) 16 | ) 17 | 18 | def test_RecallClass_init(self): 19 | """ Test of init function. 20 | """ 21 | 22 | test_case_1 = {'alpha': 0.0, 'cardinality': 'one', 'bias': 'flat'} 23 | test_case_2 = {'alpha': 0.0, 'cardinality': 'one', 'bias': None} 24 | test_case_3 = {'alpha': 10.0, 'cardinality': 'one', 'bias': 'flat'} 25 | 26 | # test of the normal call 27 | obj = TimeSeriesRecall(**test_case_1) 28 | self.assertEqual(obj.alpha, test_case_1['alpha']) 29 | self.assertEqual(obj.cardinality, test_case_1['cardinality']) 30 | self.assertEqual(obj.bias, test_case_1['bias']) 31 | 32 | # test of the invalid bias 33 | with self.assertRaises(Exception): 34 | obj = TimeSeriesRecall(**test_case_2) 35 | 36 | # test of the invalid alpha 37 | with self.assertRaises(Exception): 38 | obj = TimeSeriesRecall(**test_case_3) 39 | 40 | def test_RecallClass_score(self): 41 | """Test of score function. 42 | """ 43 | 44 | # test normal case 45 | real = np.array([1, 1, 0, 0, 0]) 46 | pred = np.array([0, 1, 0, 0, 0]) 47 | 48 | obj = TimeSeriesRecall() 49 | 50 | score = obj.score(real, pred) 51 | self.assertEqual(score, 0.5) 52 | 53 | # test invalid inputs 54 | real = None 55 | pred = np.array([0, 1, 0, 0, 0]) 56 | with self.assertRaises(Exception): 57 | score = obj.score(real, pred) 58 | 59 | real = np.array([1, 1, 0, 0, 0]) 60 | pred = None 61 | with self.assertRaises(Exception): 62 | score = obj.score(real, pred) 63 | 64 | def test_RecallClass_update_recall(self): 65 | """Test of _update_recall function. 66 | """ 67 | 68 | # test of the normal case 69 | real = np.array([0, 1, 0, 0, 0]) 70 | pred = np.array([1, 1, 0, 0, 0]) 71 | 72 | obj = TimeSeriesRecall() 73 | real_anomalies, predicted_anomalies = obj._prepare_data(real, pred) 74 | 75 | score = obj._update_recall(real_anomalies, predicted_anomalies) 76 | self.assertEqual(score, 1.0) 77 | 78 | # test of the empty case 79 | empty_real = np.array([]) 80 | empty_pred = np.array([]) 81 | 82 | score = obj._update_recall(empty_real, empty_pred) 83 | self.assertEqual(score, 0.0) 84 | 85 | def test_recall_function(self): 86 | """Test of ts_recall function. 87 | """ 88 | 89 | # test case1 90 | real = np.array([1, 0, 0, 0, 0]) 91 | pred = np.array([1, 1, 0, 0, 0]) 92 | 93 | score = ts_recall(real, pred) 94 | self.assertEqual(score, 1.0) 95 | 96 | # test case2 97 | real = np.array([1, 1, 0, 0, 0]) 98 | pred = np.array([0, 0, 1, 1, 1]) 99 | 100 | score = ts_recall(real, pred) 101 | self.assertEqual(score, 0.0) 102 | 103 | def test_recall_function_with_list(self): 104 | """Teest of ts_recall function with list type arguments. 105 | """ 106 | 107 | real = [1, 1, 0, 0, 0] 108 | pred = [1, 1, 1, 1, 0] 109 | 110 | score = ts_recall(real, pred) 111 | self.assertEqual(score, 1.0) 112 | --------------------------------------------------------------------------------