Skip to main content

A logger wrapper for DiffPrivLib

Project description

DiffPrivLib Logger

License: MIT Python ci tests

Serialize and deserialize DiffPrivLib pipelines to and from JSON.

It is inspired from opendp-logger and a first version was made by Oblivious for the UN PET Lab Hackathon 2022.

Example

from sklearn.pipeline import Pipeline
from diffprivlib import models

pipeline = Pipeline(
    [
        (
            "scaler",
            models.StandardScaler(
                bounds=([17, 1, 0, 0, 1], [90, 160, 10000, 4356, 99])
            ),
        ),
        ("pca", models.PCA(2, data_norm=5, centered=True)),
        ("lr", models.LogisticRegression(data_norm=5)),
    ]
)

Serialise

from diffprivlib_logger import serialise_pipeline

serialised_pipeline = serialise_pipeline(pipeline)

Deserialise

from diffprivlib_logger import deserialise_pipeline

deserialised_pipeline = serialise_pipeline(serialised_pipeline)

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

diffprivlib_logger-0.0.3.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file diffprivlib_logger-0.0.3.tar.gz.

File metadata

  • Download URL: diffprivlib_logger-0.0.3.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for diffprivlib_logger-0.0.3.tar.gz
Algorithm Hash digest
SHA256 61a726c7a06815db9c070b0c910c5002f1fd98dfec7994211bdaa33ff9a36924
MD5 425eb90f4b8c9c5b60ef28d2a808277b
BLAKE2b-256 bab8b7f84e7820e81d4462940facc1a9ea488731cc46689e69c55e43ca1376bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page