Y-Scramble
Y-Scramble is a simple python package to perform y-randomization validation
of machine learning models. It can be used for classification and regression tasks
and accepts models following the scikit-learninteface, and the user may use all scorers available at scikit-learn (accuracy, recall, precision).
Installing
Y-Scramble can be installed from PyPI using the following command:
$ pip install y-scamble
Usage
from y_scramble import Scrambler
from sklearn.tree import DecisionTreeClassifier
X, y = load_iris(return_X_y=True)
model = DecisionTreeClassifier()
scrambler = Scrambler(model=model, iterations=1000)
scores, zscores, pvalues, significances = scrambler.validate(
X, y,
scoring="accuracy",
cross_val_score_aggregator="mean",
pvalue_threshold=0.01
)
The scramble object returns the scores, z-scores, p-values and the significancy
information for the model trained (base_model) using the default dataset and for different randomized versions as well (scrambled_models). These results are stores in numpy arrays, where the position of index 0 represents the base_modeland the others the scrambled_models.
The score of the base_model is stored in scores[0], and i's p-values is stored in
pvalues[0]. If this p-value is significant, the value of significances[0] will be
True, indicating that base_model shows a significantly better result when comparing to the randomized models. Following the same logic, scores[1] to scores[1000], for example, will store the score values for the randomized model 1 and 1000, respectively.
Metadata
Release files for y-scramble 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| y_scramble-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for y_scramble-0.0.8-py3-none-any.whl |
Release files / y_scramble-0.0.8-py3-none-any.whl
| Download URL | y_scramble-0.0.8-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
048a7a59a44f21b3481bef7ad8faf876d5b4f2eeea002eab1271accb54adb436
|
|
BLAKE2b-256 checksum How to use checksums |
c5c9e826d8fec2377d2825dc09815b9feb13bb94dff4385a1b5ac74c4c380113
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/3.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
|
Security for y-scramble 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.