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

Installing scikit-learn allows you to access some extra options for outlier detection.

pip install redflag[sklearn]

For developers, there are also options for installing tests, docs and dev dependencies.

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:

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

See the notebook Using_redflag.ipynb for several other 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

python run_tests.py

Most of the tests are run with doctest.

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.8rc3.tar.gz (219.2 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.8rc3-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: redflag-0.1.8rc3.tar.gz
  • Upload date:
  • Size: 219.2 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.8rc3.tar.gz
Algorithm Hash digest
SHA256 3491607984f054affb5c4e336af841fd2a876129d957155d34a448a2d60f308c
MD5 54861edba758add6fbf344dbf38229a9
BLAKE2b-256 3f96756a682b293ced5a2437243d1e1cca6b9aae36d05d9435f87073515f8f50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: redflag-0.1.8rc3-py3-none-any.whl
  • Upload date:
  • Size: 25.6 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.8rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 a0bc9d6ceae4db143aeea54090cc99426767753b25a0b49ca3dc4570dcf6618d
MD5 5b9c8aa206a0f54c27a958b43c0497a7
BLAKE2b-256 65e655a349acd8549086f4096b625ff024abd632c6d2f67b8713754aaea9f4dd

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