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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffprivlib_fix-0.0.4-py3-none-any.whl (112.0 kB view details)

Uploaded Python 3

File details

Details for the file diffprivlib_fix-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: diffprivlib_fix-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 112.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for diffprivlib_fix-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1ba08f9e8b2ac6fc101db681de2e6e34ee03f2559c559cc402e807fa48050d12
MD5 66e35fa5b4115cb704bb6adb9144efe3
BLAKE2b-256 d1ef0279082f9ce14cab530ed3ccb2ea72f6fb70c09fabd8b1b66e2dcc28e733

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