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

Uploaded Python 3

File details

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

File metadata

  • Download URL: diffprivlib_fix-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.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.4a1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ece0a91bbd187ba24234adb76dd4b451977a522cc76437bea21aaeb24597a42
MD5 9c5489ec4e645179e8d305c317c16ec2
BLAKE2b-256 6b72c303e922567b7fc0c6105ca3d441324b65dc50c92aab7f6f666c0f763dcd

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