A library aiding to create challenges for the AnoMed competition platform.
Project description
Challenge
A library aiding to create challenges for the AnoMed competition platform.
Usage Example
The following example will create a Falcon-based web app that serves the famous iris dataset and uses plain binary accuracy as an evaluation metric. In more detail, these routes are offered (some may have query parameters not mentioned here):
- [GET]
/(this displays an "alive message") - [GET]
/data/anonymizer/training(this will serveX_trainandy_train) - [GET]
/data/anonymizer/tuning(this will serveX_tune) - [GET]
/data/anonymizer/validation(this will serveX_val) - [GET]
/data/deanonymizer/members(this will serve a subset ofX_trainandy_train) - [GET]
/data/deanonymizer/non-members(this will serve a subset ofX_valandy_val) - [GET]
/data/attack-success-evaluation(this will serve data from the complement of members and also from the complement of non-members). - [POST]
/utility/anonymizer(this will evaluate the quality of an anonymizer's prediction compared toy_tuneory_val.) - [POST]
/utility/deanonymizer(this will evaluate the quality of a denanonymizer's prediction compared to attack-success-evaluation)
import anomed_challenge as anochal
from sklearn import datasets, model_selection
iris = datasets.load_iris()
X = iris.data # type: ignore
y = iris.target # type: ignore
X_train, X_other, y_train, y_other = model_selection.train_test_split(
X, y, test_size=0.3, random_state=42
)
X_tune, X_val, y_tune, y_val = model_selection.train_test_split(
X_other, y_other, test_size=0.5, random_state=21
)
example_challenge = anochal.SupervisedLearningMIAChallenge(
training_data=anochal.InMemoryNumpyArrays(X=X_train, y=y_train),
tuning_data=anochal.InMemoryNumpyArrays(X=X_tune, y=y_tune),
validation_data=anochal.InMemoryNumpyArrays(X=X_val, y=X_val),
anonymizer_evaluator=anochal.strict_binary_accuracy,
MIA_evaluator=anochal.evaluate_MIA,
)
# This is what GUnicorn expects
application = anochal.supervised_learning_MIA_challenge_server_factory(
example_challenge
)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anomed_challenge-0.0.8.tar.gz.
File metadata
- Download URL: anomed_challenge-0.0.8.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8f12c45e5e17b9131116a75ed52005f5c0f2fa2da792a6b26f55f5745c99efe
|
|
| MD5 |
7536529975b7f30765d041e86572ea16
|
|
| BLAKE2b-256 |
b3a72b955a1931112e6cb234b0ff037372bdcada571a6cbee42f0a1aebecfaef
|
File details
Details for the file anomed_challenge-0.0.8-py3-none-any.whl.
File metadata
- Download URL: anomed_challenge-0.0.8-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ab5f2f113ca1f6e525253be6fbfb8faeb092e63ecda6b2da582ade34ad0bd00
|
|
| MD5 |
c2201f836c8653f0ffe1bf33c35aa751
|
|
| BLAKE2b-256 |
efecee720287b044226a8c3cf9468f054ec9a6dd0dc706b73e7899459f480026
|