{ "info": { "author": "Alex Walker", "author_email": "alex.walker@phc.ox.ac.uk", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License" ], "description": "# Change detection in prescribing data\n\nDetects changes in time series with a python wrapper around the R package gets (https://cran.r-project.org/web/packages/gets/index.html). Uses a combination of Google BigQuery and Python to query data, which is then fed to the R change detection code. Outputs a table containing results.\n\n## Installation\n`pip install change_detection`\n\nAnaconda users may have to `conda install rpy2` and `conda install geopandas` if not already installed.\n\n## Usage\nSee https://github.com/ebmdatalab/change_detection/blob/master/examples/examples.ipynb for examples of use.\n\n## Data flow\n1. Get data, by:\n - using a csv in `data/`, which must have only the fields `code`, `month`, `numerator` and `denominator`\n - creating a BigQuery SQL query in the same folder as the notebook that you're using, query must produce a table with only the fields `code`, `month`, `numerator` and `denominator`\n - querying any number of the OpenPrescribing measures in BigQuery\n2. Reshapes data with Pandas\n3. Splits data into chunks and passes each chunk to the R change detection code\n4. The resulting output is then extracted with further R code\n5. The R outputs are then concatenated\n\n\n## Output table\n\n### Timing Measures\n`is.tfirst` First negative break\n`is.tfirst.pknown` First negative break after a known intervention date\n`is.tfirst.pknown.offs` First negative break after a known intervention date not offset by a XX% increase\n`is.tfirst.offs` First negative break not offset by a XX% increase\n`is.tfirst.big` Steepest break as identified by `is.slope.ma`\n\n### Slope Measures\n`is.slope.ma` Average slope over steepest segment contributing at least XX% of total drop\n`is.slope.ma.prop` Average slope as proportion to prior level\n`is.slope.ma.prop.lev` Percentage of the total drop the segment used to evaluate the slope makes up\n\n### Level Measures\n`is.intlev.initlev` Pre-drop level\n`is.intlev.finallev` End level\n`is.intlev.levd` Difference between pre and end level\n`is.intlev.levdprop` Proportion of drop\n\n\n## Requirements\n\nPython with an associated install of R. Python dependencies should be dealt with on installation (though for my install, I had to install rpy2 separately. R packages should be installed with the package is first loaded.\n\n### Python installation requires:\n- ebmdatalab library https://github.com/ebmdatalab/datalab-pandas\n- rpy2 (to install R and the below libraries)\n- pandas\n- pandas-gbq\n- numpy\n\n### R installation requires:\n- zoo\n- caTools\n- gets\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ebmdatalab/change_detection", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "change_detection", "package_url": "https://pypi.org/project/change_detection/", "platform": "", "project_url": "https://pypi.org/project/change_detection/", "project_urls": { "Homepage": "https://github.com/ebmdatalab/change_detection" }, "release_url": "https://pypi.org/project/change_detection/0.2.1/", "requires_dist": [ "pandas >= 0.24", "pandas-gbq >= 0.8.0", "numpy", "rpy2", "ebmdatalab >=0.0.20" ], "requires_python": "", "summary": "package for detecting change in time-series data", "version": "0.2.1" }, "last_serial": 5742856, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "de9ef1d5687b5a29548ad0dc1f681184", "sha256": "1086ef199a5175512cc313644995730d88cfe73c45d9abcaba2d87596bcb8545" }, "downloads": -1, "filename": "change_detection-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "de9ef1d5687b5a29548ad0dc1f681184", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 36129, "upload_time": "2019-08-15T16:55:30", "url": "https://files.pythonhosted.org/packages/56/df/4bc0e3125bc37e8eef276aff4d75b18944131b84de6059bfa8054925beae/change_detection-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fdf8063f4a0bae4321bb89fea421b0b9", "sha256": "8c9fb7e83e58494c7f9405e3bcf980114bf14c695e7544a5dced2d583c179ff6" }, "downloads": -1, "filename": "change_detection-0.2.tar.gz", "has_sig": false, "md5_digest": "fdf8063f4a0bae4321bb89fea421b0b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 524004, "upload_time": "2019-08-15T16:55:34", "url": "https://files.pythonhosted.org/packages/2c/75/ade6268a0e89a39e6d83c765c110344ae311a326755d18def0b24db3b72a/change_detection-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "c36ef912449be1cf3273ae2b1a8bf653", "sha256": "4c1b79fa65f06a00fcb856f7feda2a4400f5aabac16b7234ac6f52ffbeaa87c4" }, "downloads": -1, "filename": "change_detection-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c36ef912449be1cf3273ae2b1a8bf653", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 36371, "upload_time": "2019-08-28T14:09:59", "url": "https://files.pythonhosted.org/packages/90/f5/8e99bb81e7de1fdbad1716f213d8e01997cd343ae21e6144e697bd034b19/change_detection-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d1b2b191ea7a171f51d7c90c8b9b2c3", "sha256": "7c68eee6974fdcf658f8b37c4ef28b32e9a02274604fd5e64485fd57041a423b" }, "downloads": -1, "filename": "change_detection-0.2.1.tar.gz", "has_sig": false, "md5_digest": "2d1b2b191ea7a171f51d7c90c8b9b2c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 524068, "upload_time": "2019-08-28T14:10:02", "url": "https://files.pythonhosted.org/packages/b5/c6/72f7bcfdcae55038706059b6fd5dfe4c8d9e909e12e91139ab40b9ff3de7/change_detection-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c36ef912449be1cf3273ae2b1a8bf653", "sha256": "4c1b79fa65f06a00fcb856f7feda2a4400f5aabac16b7234ac6f52ffbeaa87c4" }, "downloads": -1, "filename": "change_detection-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c36ef912449be1cf3273ae2b1a8bf653", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 36371, "upload_time": "2019-08-28T14:09:59", "url": "https://files.pythonhosted.org/packages/90/f5/8e99bb81e7de1fdbad1716f213d8e01997cd343ae21e6144e697bd034b19/change_detection-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d1b2b191ea7a171f51d7c90c8b9b2c3", "sha256": "7c68eee6974fdcf658f8b37c4ef28b32e9a02274604fd5e64485fd57041a423b" }, "downloads": -1, "filename": "change_detection-0.2.1.tar.gz", "has_sig": false, "md5_digest": "2d1b2b191ea7a171f51d7c90c8b9b2c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 524068, "upload_time": "2019-08-28T14:10:02", "url": "https://files.pythonhosted.org/packages/b5/c6/72f7bcfdcae55038706059b6fd5dfe4c8d9e909e12e91139ab40b9ff3de7/change_detection-0.2.1.tar.gz" } ] }