Skip to main content

Fast Grubbs' test implementation with C++ bindings.

Project description

GrubbsTest

High speed Grubbs Test used to calculate the the z-score data points in a data set. I created this to learn about c++ and python integration and have an fast alternate to the major python libaries. You can view the package on pypi here.

Implentation Specifics

  • The Grubbs test statistic determines what is an outlier. The final mean and standard deviation is calculated without including the outliers in the dataset. The data set is assumed to be normal.

  • This is a Linux only package.

Installing GrubbsTest

A valid c++ complier and cmake is needed to be installed to run the package.

sudo apt install cmake g++

You can install the package directly from PyPI:

pip install grubbstest

Usage

Functions

  • run_Grubbs(data, alpha, use_list_output=True, use_id_field=False)
    • Calcualtes z-score with removing outliers from mean and standard deviation calculation
    • Still outputs outliers z-scores however they are not included when calculating the mean or standard deviation values that are used to calcuate z-scores
  • run_NoOutlier(data, use_list_output=True, use_id_field=False)
    • Calculates z-scores without removing outliers in mean and standard deviation

Inputs

  • Grubbs

    • data: data in list or dict format
    • alpha: alpha value using in student's t distribution calculation
    • use_list_output: Return results as list (True) or dict (False)
    • use_id_field: Input data has ID fields (True) or not (False)
  • NoOutlier

    • data: data in list or dict format
    • use_list_output: Return results as list (True) or dict (False)
    • use_id_field: Input data has ID fields (True) or not (False)

Output Format

  • List

    • With ID (True): A list of lists where each inner list contains the ID, value, and its z-score
      [[ab, 85, 1.23], [cd, 4, -0.56], ...]
      
    • No ID (False): A list of lists where each inner list contains the value and its z-score
      [[85, 1.23], [4, -0.56], ...]
      
  • Dict

    • With ID (True): A dictionary where each key is the ID and the value is a list and its z-score
      {ab: [85, 1.23], cd: [4, -0.56], ...}
      
    • No ID (False): A dictionary where each key is the value input and the value is its z-score.
      • Warning: If you have equal data points and use this output you will lose data
      {85: 1.23, 4: -0.56, ...}
      

License

This project is licensed under the MIT License

Author

David Olejniczak

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grubbstest-0.0.1.tar.gz (1.7 MB view details)

Uploaded Source

File details

Details for the file grubbstest-0.0.1.tar.gz.

File metadata

  • Download URL: grubbstest-0.0.1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for grubbstest-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1e61423ef2a95ff28a286eed11f6eaed0a5cf2312cb8ac851763018a53b54575
MD5 b9395961eb76a1e69a05e6e6df3d59d5
BLAKE2b-256 8d39a728b015b87040c9c0a2405b11257c3bc4e0362ee620b117a0ea04ddd355

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page