Skip to main content

Raise red flags on machine learning datasets.

Project description

Redflag

Build and test PyPI version PyPI versions PyPI license

🚩 redflag aims to be an automatic safety net for machine learning datasets. The vision is to accept input of a Pandas DataFrame or NumPy ndarray (one for each of the input X and target y in a machine learning task). redflag will provide an analysis of each feature, and of the target, including aspects such as class imbalance, outliers, anomalous data patterns, threats to the IID assumption, and so on. The goal is to complement other projects like pandas-profiling and greatexpectations.

This project is very rough and does not do much yet. The API will very likely change without warning. Please consider contributing!

Installation

You can install this package with pip:

pip install redflag

For developers, there are pip options for installing tests, docs and dev dependencies, e.g. pip install redflag[dev] to install all testing and documentation packages.

Example

redflag is currently just a collection of functions. Most of the useful ones take a single column of data (e.g. a 1D NumPy array) and run a single test. For example, we can do some outlier detection. The get_outliers() function returns the indices of data points that are considered outliers:

>>> import redflag as rf
>>> data = [-3, -2, -2, -1, 0, 0, 0, 1, 2, 2, 3]
>>> rf.get_outliers(data)
array([], dtype=int64)
>>> rf.get_outliers(3 * data + [100])
array([33])

See the documentation, and specifically the notebook Basic_usage.ipynb for several other basic examples.

Documentation

The documentation is online.

Contributing

Please see CONTRIBUTING.md. There is also a section in the documentation about Development.

Testing

You can run the tests (requires pytest and pytest-cov) with

pytest

Most of the tests are doctests, but pytest will run them using the settings in setup.cfg.

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

redflag-0.1.9rc3.tar.gz (241.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redflag-0.1.9rc3-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file redflag-0.1.9rc3.tar.gz.

File metadata

  • Download URL: redflag-0.1.9rc3.tar.gz
  • Upload date:
  • Size: 241.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for redflag-0.1.9rc3.tar.gz
Algorithm Hash digest
SHA256 63b8e62ad56e945f7f67e0d9e4cc5833914679edd58d562a5bec32e49ecd4ff0
MD5 f5ef034cb0e94272d4419df8b7154273
BLAKE2b-256 73f48ca20b0145187c39ee5b48b7154868cada492716957053c09362bef15595

See more details on using hashes here.

File details

Details for the file redflag-0.1.9rc3-py3-none-any.whl.

File metadata

  • Download URL: redflag-0.1.9rc3-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for redflag-0.1.9rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 9f0efb2273e0540b5d6f56bc63e30e145c9b8b5872563dda5ef3441e9a747540
MD5 8836fdcbdaeaadcd81f8545b07ae58da
BLAKE2b-256 9a3fc7101b067b22e48f01c5b80d2c72060d0bf150700bc7b69fc010a0923099

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