diffprivlib-logger


Namediffprivlib-logger JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/dscc-admin/lomas/
SummaryA logger wrapper for DiffPrivLib
upload_time2024-07-02 09:19:40
maintainerNone
docs_urlNone
authorData Science Competence Center, Swiss Federal Statistical Office
requires_python<4,>=3.10
licenseMIT
keywords diffprivliv logger serialiser deserialiser
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DiffPrivLib Logger

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python](https://img.shields.io/badge/python-3.11-blue)](https://www.python.org/)
[![ci tests](https://github.com/dscc-admin-ch/diffprivlib-logger/actions/workflows/tests.yml/badge.svg)](https://github.com/dscc-admin-ch/diffprivlib-logger/actions/workflows/tests.yml?query=branch%3Amain)

Serialize and deserialize DiffPrivLib pipelines to and from JSON.

It is inspired from [opendp-logger](https://github.com/opendp/opendp-logger/tree/main) and a first version was made by [Oblivious](https://www.oblivious.com/) for the [UN PET Lab Hackathon 2022](https://petlab.officialstatistics.org/).

## Example

```python
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
```python
from diffprivlib_logger import serialise_pipeline

serialised_pipeline = serialise_pipeline(pipeline)
```

## Deserialise
```python
from diffprivlib_logger import deserialise_pipeline

deserialised_pipeline = serialise_pipeline(serialised_pipeline)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dscc-admin/lomas/",
    "name": "diffprivlib-logger",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.10",
    "maintainer_email": null,
    "keywords": "diffprivliv, logger, serialiser, deserialiser",
    "author": "Data Science Competence Center, Swiss Federal Statistical Office",
    "author_email": "dscc@bfs.admin.ch",
    "download_url": "https://files.pythonhosted.org/packages/ba/b8/b7f84e7820e81d4462940facc1a9ea488731cc46689e69c55e43ca1376bc/diffprivlib_logger-0.0.3.tar.gz",
    "platform": null,
    "description": "# DiffPrivLib Logger\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python](https://img.shields.io/badge/python-3.11-blue)](https://www.python.org/)\n[![ci tests](https://github.com/dscc-admin-ch/diffprivlib-logger/actions/workflows/tests.yml/badge.svg)](https://github.com/dscc-admin-ch/diffprivlib-logger/actions/workflows/tests.yml?query=branch%3Amain)\n\nSerialize and deserialize DiffPrivLib pipelines to and from JSON.\n\nIt is inspired from [opendp-logger](https://github.com/opendp/opendp-logger/tree/main) and a first version was made by [Oblivious](https://www.oblivious.com/) for the [UN PET Lab Hackathon 2022](https://petlab.officialstatistics.org/).\n\n## Example\n\n```python\nfrom sklearn.pipeline import Pipeline\nfrom diffprivlib import models\n\npipeline = Pipeline(\n    [\n        (\n            \"scaler\",\n            models.StandardScaler(\n                bounds=([17, 1, 0, 0, 1], [90, 160, 10000, 4356, 99])\n            ),\n        ),\n        (\"pca\", models.PCA(2, data_norm=5, centered=True)),\n        (\"lr\", models.LogisticRegression(data_norm=5)),\n    ]\n)\n```\n\n## Serialise\n```python\nfrom diffprivlib_logger import serialise_pipeline\n\nserialised_pipeline = serialise_pipeline(pipeline)\n```\n\n## Deserialise\n```python\nfrom diffprivlib_logger import deserialise_pipeline\n\ndeserialised_pipeline = serialise_pipeline(serialised_pipeline)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A logger wrapper for DiffPrivLib",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/dscc-admin/lomas/"
    },
    "split_keywords": [
        "diffprivliv",
        " logger",
        " serialiser",
        " deserialiser"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bab8b7f84e7820e81d4462940facc1a9ea488731cc46689e69c55e43ca1376bc",
                "md5": "425eb90f4b8c9c5b60ef28d2a808277b",
                "sha256": "61a726c7a06815db9c070b0c910c5002f1fd98dfec7994211bdaa33ff9a36924"
            },
            "downloads": -1,
            "filename": "diffprivlib_logger-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "425eb90f4b8c9c5b60ef28d2a808277b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.10",
            "size": 5173,
            "upload_time": "2024-07-02T09:19:40",
            "upload_time_iso_8601": "2024-07-02T09:19:40.054369Z",
            "url": "https://files.pythonhosted.org/packages/ba/b8/b7f84e7820e81d4462940facc1a9ea488731cc46689e69c55e43ca1376bc/diffprivlib_logger-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-02 09:19:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dscc-admin",
    "github_project": "lomas",
    "github_not_found": true,
    "lcname": "diffprivlib-logger"
}
        
Elapsed time: 0.50047s