A logger wrapper for Smartnoise Synth Table Transformer
Project description
Smartnoise Synth Logger
Logger for Smartnoise Synth Transformers
Serialize and deserialize Smartnoise Synth constraints to and from JSON.
Installation
Install with pip:
pip install smartnoise-synth-logger
Example
from snsynth.transform import (
AnonymizationTransformer,
BinTransformer,
ChainTransformer,
ClampTransformer,
DropTransformer,
LabelTransformer,
LogTransformer,
MinMaxTransformer,
OneHotEncoder,
StandardScaler,
)
constraints = {
"id": AnonymizationTransformer("uuid4"),
"email": "email", # also possible
"income": ChainTransformer(
[
LogTransformer(),
BinTransformer(bins=20, lower=0, upper=50),
]
),
"height": ChainTransformer(
[
StandardScaler(lower=0, upper=1),
BinTransformer(bins=20, lower=0, upper=1),
]
),
"weight": ChainTransformer(
[ClampTransformer(lower=10, upper=200), BinTransformer(bins=20)]
),
"age": MinMaxTransformer(lower=0, upper=100),
"sex": ChainTransformer(
[LabelTransformer(nullable=True), OneHotEncoder()]
),
"rank": LabelTransformer(nullable=False),
"job": DropTransformer(),
}
Serialise
from smartnoise_synth_logger import serialise_constraints
serialised_constraints = serialise_constraints(constraints)
Deserialise
from smartnoise_synth_logger import deserialise_constraints
deserialised_constraints = deserialise_constraints(serialised_constraints)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file smartnoise_synth_logger-0.0.3.tar.gz
.
File metadata
- Download URL: smartnoise_synth_logger-0.0.3.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da67bacfb10c5381847dd6d9e52c3fc24b8128ca64ad423c17026744febfdddc |
|
MD5 | 480c9e63d48f1b7c74342fe32652d49a |
|
BLAKE2b-256 | f140506bcf69d5f0b8df64da87d6ec72608e4caa75d10c7a4e5b8e1bfcf28410 |