Skip to main content

Fast C++ implementation of microaggregation algorithms for data privacy

Project description

Microaggregation

Fast C++ implementation of microaggregation algorithms for data privacy protection.

Features

  • High-performance C++ implementation of SSE dynamic programming
  • Python fallback when C++ extension is not available
  • Compatible with NumPy arrays
  • Timing utilities for performance measurement

Installation

bash pip install microaggregation

Usage

import numpy as np
from microaggregation import calculate_sse_dynamic, calculate_total_variance, get_timing

# Example usage:
my_data = np.random.rand(100, 5)
min_k = 3

sse_value = calculate_sse_dynamic(my_data, min_k)
# sse_value_py_only = calculate_sse_dynamic(my_data, min_k, use_cpp=False) # To force Python

total_var = calculate_total_variance(my_data)

timers = get_timing()
start_wall = timers['wall_time']()
# ... some operation ...
end_wall = timers['wall_time']()
print(f"Wall time: {end_wall - start_wall}")

print(f"SSE: {sse_value}, Total Variance: {total_var}")
print(f"IL: {sse_value / total_var * 100 if total_var != 0 else float('inf')}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microaggregation-0.1.9.tar.gz (19.7 kB view details)

Uploaded Source

Built Distributions

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

microaggregation-0.1.9-cp312-cp312-win_amd64.whl (63.8 kB view details)

Uploaded CPython 3.12Windows x86-64

microaggregation-0.1.9-cp311-cp311-win_amd64.whl (63.4 kB view details)

Uploaded CPython 3.11Windows x86-64

microaggregation-0.1.9-cp310-cp310-win_amd64.whl (62.3 kB view details)

Uploaded CPython 3.10Windows x86-64

microaggregation-0.1.9-cp39-cp39-win_amd64.whl (62.4 kB view details)

Uploaded CPython 3.9Windows x86-64

microaggregation-0.1.9-cp38-cp38-win_amd64.whl (62.3 kB view details)

Uploaded CPython 3.8Windows x86-64

microaggregation-0.1.9-cp37-cp37m-win_amd64.whl (62.9 kB view details)

Uploaded CPython 3.7mWindows x86-64

File details

Details for the file microaggregation-0.1.9.tar.gz.

File metadata

  • Download URL: microaggregation-0.1.9.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for microaggregation-0.1.9.tar.gz
Algorithm Hash digest
SHA256 eb1df2709d92e98891a37632aed95ca69fa65c5add034a52ada7ac388fd53327
MD5 2c378c2cd07bee916369b5109acaf4be
BLAKE2b-256 02f4c6b2e9ab9659a4aa73b7ab4a75d611631357e68d2d59b2d817b7bd0ce311

See more details on using hashes here.

File details

Details for the file microaggregation-0.1.9-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for microaggregation-0.1.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9fae5057b59d1369073317468003e12f8c671772ed39f1ac3a9e037e241f2f12
MD5 586fe4e2b22668d9e14d9792200f4f6d
BLAKE2b-256 cddc46a3cf50397ab976b60a0232ae89b5c2372cc88ba4f8147dc0cc0af962cf

See more details on using hashes here.

File details

Details for the file microaggregation-0.1.9-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for microaggregation-0.1.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 07092fb6654fd17038fb41b5a770ad575208dee3bb80ae76b444a24255b49393
MD5 915186f34e138e8ab03b99b7150b3afd
BLAKE2b-256 02f7e0dbc5b88aa08cf540fafd2f66f5633380614a756906eb16ba92692f64cc

See more details on using hashes here.

File details

Details for the file microaggregation-0.1.9-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for microaggregation-0.1.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 47f3e703c0eebbc3e2b71dcd1a8a7ffe20a56a58423619a2afda79f46552e8c6
MD5 1e13e2bff676dcae51d6ac4feb5b2486
BLAKE2b-256 28f14c9becc4b5a30b43054742ffe2852f23813f55d0cb92958f7195db8d90da

See more details on using hashes here.

File details

Details for the file microaggregation-0.1.9-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for microaggregation-0.1.9-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 105631e2127b3d1962004b2a41e9099319a5d7b75fe881188ed5776fc08b7eac
MD5 52b060379c73b61692bb8d54da421e71
BLAKE2b-256 c5f5d8d60f5231ad9ff5ef48b1caa1f3dcfa4c1237de79fb4ab00e0fa861a9a1

See more details on using hashes here.

File details

Details for the file microaggregation-0.1.9-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for microaggregation-0.1.9-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 cf44b3f56e7c65980ee7fd976206b73dc19c02d9b65b4478c3af053b93a010ea
MD5 7844b09d2e371122008b119a6465e737
BLAKE2b-256 a749c1325053d49760f275938784d9d26344f727661ce2255ffff3d70301fd0c

See more details on using hashes here.

File details

Details for the file microaggregation-0.1.9-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for microaggregation-0.1.9-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 389ed1e2fdb203309397273e5ed42d929a1775204e54ce4f59a475b2417a970d
MD5 c4f01ceedde87608d1cde9fdf94bb3de
BLAKE2b-256 609bca8e17d32414475c6366116daeec71c8d30295b300281f87cbc16e6901b1

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