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_logger-0.0.4a1-py3-none-any.whl (112.0 kB view details)

Uploaded Python 3

File details

Details for the file diffprivlib_logger-0.0.4a1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for diffprivlib_logger-0.0.4a1-py3-none-any.whl
Algorithm Hash digest
SHA256 8fa5681def91fa1340b53f71cc78944464dea4e7017fc3b9dfbe580da3ea7f89
MD5 e2775254fcd74d68cf6b616d915c76b7
BLAKE2b-256 6d889b0951bbfa897d29eb83c18948da498841e51d76e1a2cc6784c678112de3

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