Skip to main content

Antigranular is a community-driven, open-source platform that merges confidential computing and differential privacy. This creates a secure environment for handling and unlocking the full potential of unseen data..

Project description

Privacy Unleashed: Working with Antigranular

Antigranular is a community-led, open-source platform that combines confidential computing with differential privacy. This integration fosters a secure 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 Enclave Server, use your client credentials and either a dataset or competition ID:

ag.login(user_id: "<user_id>", user_secret: "<user_secret>",  competition="<competition_id>")

or

ag.login(user_id: "<user_id>", user_secret: "<user_secret>", dataset="<dataset_id>")

A succesful 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 can be used to obtain a dictionary of private objects. The response dictionary's structure, 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.

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

antigranular-0.2.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

antigranular-0.2.2-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file antigranular-0.2.2.tar.gz.

File metadata

  • Download URL: antigranular-0.2.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for antigranular-0.2.2.tar.gz
Algorithm Hash digest
SHA256 be6ddfd8f5356caea611181c48747b20ba22cb1e581247d11d638e7c7658c0bb
MD5 1aa0293f10bafe16b97e82823d4eb17e
BLAKE2b-256 f954f62e554469e81c3b7dcd095179ba4edf1efc61056ea6211fc7d3b553510f

See more details on using hashes here.

File details

Details for the file antigranular-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: antigranular-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for antigranular-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7f98e0411e86f4022f35adee80c8b6399363eb7bc98cb53408cd799fd244c6e6
MD5 2f87ffe9ba11c708c794578a12d7858b
BLAKE2b-256 e318a686469ce82c1a0041d84e480650939f86b78152f449e3a998ea8956eec1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page