Testing for models confirming to the scikit-learn api
Project description
ML Testing
The goal of this module is to create a flexible and easy to use module for testing machine learning models, specifically those in scikit-learn.
The tests will be readable enough that anyone can extend them to other frameworks and APIs with the major notions kept the same, but more or less the ideas will be extended, no work will be taken in this library to extend passed the scikit-learn API.
You can read the docs for a more detailed explaination.
Tests Covered
- Testing Against Metrics
- Classification Tests
- Rule Based Testing:
- precision lower boundary
- recall lower boundary
- f1 score lower boundary
- AUC lower boundary
- precision lower boundary per class
- recall lower boundary per class
- f1 score lower boundary per class
- AUC lower boundary per class
- Decision Based Testing:
- precision fold below average
- recall fold below average
- f1 fold below average
- AUC fold below average
- precision fold below average per class
- recall fold below average per class
- f1 fold below average per class
- AUC fold below average per class
- Against New Predictions
- proportion of predictions per class
- class imbalance tests
- probability distribution similarity tests
- calibration tests
- environmental impact tests
- energyusage upper bound test
- Rule Based Testing:
- Regression Tests
- Rule Based Testing:
- Mean Squared Error upper boundary
- Median Absolute Error upper boundary
- Decision Based Testing:
- Mean Squared Error fold above average
- Median Absolute Error fold above average
- Rule Based Testing:
- Classification Tests
- Testing Against Run Time Performance
- prediction run time for simulated samples of size X
- Testing Against Input Data
- percentage of correct imputes for any columns requiring imputation
- dataset testing - http://www.vldb.org/pvldb/vol11/p1781-schelter.pdf
- Memoryful Tests
- cluster testing - this is about the overall structure of the data If the number of clusters increases or decreases substantially that should be an indicator that the data has changed enough that things should possibly be rerun
- correlation testing - this is about ensuring that the correlation for a given column with previous data collected in the past does not change very much. If the data does change then the model should possibly be rerun.
- shape testing - this is about ensuring the general shape of for the given column does not change much over time. The idea here is the same as the correlation tests.
Possible Issues
Some known issues with this, any machine learning tests are going to require human interaction because of type 1 and type 2 error for statistical tests. Additionally, one simply needs to interrogate models from a lot of angles. It can't be from just one angle. So please use with care!
Future Features
- cross validation score testing
- add custom loss function
- add custom accuracy function
- add these tests: https://www.datasciencecentral.com/profiles/blogs/a-plethora-of-original-underused-statistical-tests
- clustering for classification
- Unsupervised and semi supervised tests
- verify similarity in clusters to similarity in labels
- generate a small representative set of labels and then propagate other labels
References
- https://dzone.com/articles/quality-assurancetesting-the-machine-learning-mode
- https://medium.com/datadriveninvestor/how-to-perform-quality-assurance-for-ml-models-cef77bbbcfb
- Explaination of UAT: https://www.techopedia.com/definition/3887/user-acceptance-testing-uat
- https://mice.cs.columbia.edu/getTechreport.php?techreportID=419&format=pdf
- https://www.xenonstack.com/blog/unit-testing-tdd-bdd-deep-machine-learning/
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 drifter_ml-0.25.tar.gz
.
File metadata
- Download URL: drifter_ml-0.25.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f57b04b7f9074dabbd772885d536678fc2cc96071862f6fa1d6086afc7eeac13 |
|
MD5 | 4d53f455cb6fdca1c4c83925b7297517 |
|
BLAKE2b-256 | 0836335e44943f5f2056cf8dbb698efaf056bdccdf46b0fa005035e29e7c9611 |
File details
Details for the file drifter_ml-0.25-py3-none-any.whl
.
File metadata
- Download URL: drifter_ml-0.25-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3317be3bc3dc982db3c3068dd5d08bf1003ee5703a88130be6c6e02472665a7 |
|
MD5 | 0b474d9cdd25b7aaacbbbc316a07c6f8 |
|
BLAKE2b-256 | 3d14ffc491952a27283a4d242b390c25562eff5cdf343d8784f35110307f5fde |