Automatic control chart calculation and plotting for the u'-chart.
Project description
uprime
A python implementation the u'-chart.
The u'-chart is a control chart for attributes data that can handle large and variable sample sizes by counteracting overdispersion as described in the following paper: David B. Laney (2002) Improved Control Charts for Attributes, Quality Engineering, 14:4, 531-537, DOI: 10.1081/QEN-120003555.
The u'-chart is used to evaluate an attribute statistic over a period of time to determine whether or not the variation in the statistic can be explained by random variation alone.
This module includes customizable options that facilitates its use as an alerting system.
Author: Robert Astel
TL;DR: Implementation of u'-prime control chart rules that can be used for creating alerts on statistics with high/variable sample sizes.
Get Started
Install
pip install uprime
Usage
from uprime import Uprime
# Four required arguments:
# 1. Pandas Dataframe
# 2. Name of the column by which the data can be chronologically sorted
# 3. Name of the column that contains the number of occurrences of the attribute of interest
# The number of occurrences should always be an integer. Non-integer values will be rounded.
# 4. Name of the column that contains the size of the subgroup (A.K.A. sample)
# The subgroup size should always be an integer. Non-integer values will be rounded.
up = Uprime(df, 'sort_column_name', 'occurrences_column_name', 'subgroup_size_column_name')
# Perform u'-chart calculations
# Return a Pandas DataFrame that contains all necessary data to plot a u'-chart or trigger alerts
up_df = up.frame()
Examples
method = rolling, periods = 30
This configuration performs u'-chart calculations using the previous rolling 30 periods for each subgroup.
This is different from the default method = 'all'
, which uses all subgroups in the DataFrame df to perform the calculations`.
up = Uprime(df, 'sort_column_name', 'occurrences_column_name', 'subgroup_size_column_name',
method = 'rolling', periods = 30)
More examples, including usage of other optional arguments and built in charting function.
Contributing
Read our CONTRIBUTING.md to learn about our development process.
License
uprime is licensed under the Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uprime-1.2.tar.gz
.
File metadata
- Download URL: uprime-1.2.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c93d3b55743ca17048eb11f56002f2be718eddf12e45fb35e13878338687d70c |
|
MD5 | f479f8db9b9bbc3a4f5d91a648199253 |
|
BLAKE2b-256 | a4b619d4c2e3adc156d4d64e681fc65b34f75814cbc0709304eb35604588b293 |
File details
Details for the file uprime-1.2-py3-none-any.whl
.
File metadata
- Download URL: uprime-1.2-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30fb549803bc3a361c9cacf4c54c8232379aface94e308041b7471a4ce46f3f6 |
|
MD5 | 5b9828f70c08a70faa98612630352e74 |
|
BLAKE2b-256 | 96b86c834c0f75a75f2016d33c0b79fe57ed9bf1753caec1ee4895753911099e |