Skip to main content

Privacy Unleashed: Working with Antigranular

Antigranular is a community-led, open-source platform that combines remote data science with differential privacy. This integration fosters a protected environment to handle and fully utilize unseen data.

Connect to Antigranular

You can activate Antigranular using the magic command %%ag. Any code that follows %%ag will run on our remote server. This server operates under restricted conditions, allowing only methods that guarantee differential privacy.

Install the Antigranular package using pip:

!pip install antigranular

Import the Antigranular library:

import antigranular as ag

To connect to the AG Server, use your client credentials and either a dataset or competition ID:

ag_client = ag.login(user_id="<user_id>", user_secret="<user_secret>",  competition="<competition_name>")

or

ag_client = ag.login(user_id="<user_id>", user_secret="<user_secret>", dataset="<dataset_name>")

A successful login will register the cell magic %%ag.

Loading Private Datasets

Private datasets can be loaded as PrivateDataFrames and PrivateSeries using the ag_utils library. ag_utils is a package locally installed on the remote server, which eliminates the need to install anything other than the antigranular package.

The load_dataset() method allows for obtaining a dictionary of private objects. The structure of the response dictionary, along with the dataset path and private object names, will be specified during the competition.

%%ag
from op_pandas import PrivateDataFrame, PrivateSeries
from ag_utils import load_dataset 
"""
Sample response structure
{
    train_x : priv_train_x,
    train_y : priv_train_y,
    test_x : priv_test_x
}
"""
# Obtaining the dictionary containing private objects
response = load_dataset("<path_to_dataset>")

# Unpacking the response dictionary
train_x = response["train_x"]
train_y = response["train_y"]
test_x = response["test_x"]

Exporting Objects

Since the code following %%ag runs in a highly restricted environment, it's necessary to export differentially private objects to the local environment for further analysis. The export method in ag_utils allows data objects to be exported.

API info: export(obj, variable_name:str)

This command exports the remote object to the local environment and assigns it to the specified variable name. Note that PrivateSeries and PrivateDataFrame objects cannot be exported and will raise an error if you attempt to do so.

%%ag
from ag_utils import export
train_info = train_x.describe(eps=1)
export(train_info , 'variable_name')

Once exported, you can perform any kind of data analysis on the differentially private object.

# Local code block
print(variable_name)
--------------------------------------
                    Age         Salary
    count  99987.000000   99987.000000
    mean      38.435953  120009.334336
    std       12.167379   46255.486093
    min       18.257448   40048.259037
    25%       27.185189   80057.639960
    50%       38.210860  120380.291216
    75%       49.147724  159835.637091
    max       59.282932  199920.664706

Libraries Supported

  • pandas: An adaptable data manipulation library offering efficient data structures and tools for data analysis and manipulation.

  • op_pandas: A wrapped library specifically designed for differentially private data manipulation within the Pandas framework. It enhances privacy-preserving techniques and enables privacy-aware data processing.

  • op_diffprivlib: A differentially private library that provides various privacy-preserving algorithms and mechanisms for machine learning and data analysis tasks.

  • op_smartnoise: A library focused on privacy-preserving analysis using the SmartNoise framework. It provides tools for differential privacy and secure computation.

  • op_opendp: A library that offers differentially private data analysis and algorithms based on the OpenDP project. It provides privacy-preserving methods and tools for statistical analysis.

Metadata

Release files for antigranular 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for antigranular 1.0.2
File Size Uploaded Provenance Actions
antigranular-1.0.2.tar.gz 14.4 kB Without provenance Details for antigranular-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for antigranular 1.0.2
File Interpreter ABI Platform Actions
antigranular-1.0.2-py3-none-any.whl Python 3 none any Details for antigranular-1.0.2-py3-none-any.whl

Total release size: 32.4 kB

Release files / antigranular-1.0.2.tar.gz

Download URL antigranular-1.0.2.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
15702201bee99d2440187b11ea0fa8fa9c0c877f75d2befad27ee0bbed510cfa
BLAKE2b-256 checksum
How to use checksums
1a33e97cdfdc3cff20cf236165563136faa2595534da8d64284f108025aec774
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.0

Release files / antigranular-1.0.2-py3-none-any.whl

Download URL antigranular-1.0.2-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43e07e1c5306bf79d91ff73469f93cc7458328847b921b5c969a5bb93775f576
BLAKE2b-256 checksum
How to use checksums
99aa1c29ebf60ab6ce81271b812209f194e1e00359dc5ec63d0afe822f4ede37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.0

Security for antigranular 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page