Skip to content

Commit

Permalink
rename aisdc to sacroml
Browse files Browse the repository at this point in the history
  • Loading branch information
rpreen committed Jul 29, 2024
1 parent 6bb2c87 commit 37a0992
Show file tree
Hide file tree
Showing 73 changed files with 124 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
- name: pylint
run: |
pylint -v --recursive=True aisdc tests --fail-under 10
pylint -v --recursive=True sacroml tests --fail-under 10
...
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Changelog

## Version 1.2.1 (TBC)

Changes:
* Rename repository from AI-SDC to SACRO-ML ([#298](https://github.com/AI-SDC/SACRO-ML/pull/298))
* Rename package from aisdc sacroml ([#298](https://github.com/AI-SDC/SACRO-ML/pull/299))

## Version 1.2.0 (Jul 11, 2024)

Expand Down
32 changes: 16 additions & 16 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cff-version: 1.2.0
title: AI-SDC
version: 1.2.0
doi: 10.5281/zenodo.12725798
date-released: 2024-07-11
title: SACRO-ML
version: 1.2.1
doi:
date-released:
license: MIT
repository-code: https://github.com/AI-SDC/SACRO-ML
languages:
Expand Down Expand Up @@ -55,37 +55,37 @@ identifiers:
description: This DOI represents all versions, and will always resolve to the latest one.
- type: doi
value: 10.5281/zenodo.7080280
description: This is the archived snapshot of AI-SDC v.1.0.0.
description: This is the archived snapshot of SACRO-ML v.1.0.0.
- type: doi
value: 10.5281/zenodo.7327390
description: This is the archived snapshot of AI-SDC v.1.0.1.
description: This is the archived snapshot of SACRO-ML v.1.0.1.
- type: doi
value: 10.5281/zenodo.7681783
description: This is the archived snapshot of AI-SDC v.1.0.2.
description: This is the archived snapshot of SACRO-ML v.1.0.2.
- type: doi
value: 10.5281/zenodo.7886945
description: This is the archived snapshot of AI-SDC v.1.0.3.
description: This is the archived snapshot of SACRO-ML v.1.0.3.
- type: doi
value: 10.5281/zenodo.7900410
description: This is the archived snapshot of AI-SDC v.1.0.4.
description: This is the archived snapshot of SACRO-ML v.1.0.4.
- type: doi
value: 10.5281/zenodo.8007939
description: This is the archived snapshot of AI-SDC v.1.0.5.
description: This is the archived snapshot of SACRO-ML v.1.0.5.
- type: doi
value: 10.5281/zenodo.8172371
description: This is the archived snapshot of AI-SDC v.1.0.6.
description: This is the archived snapshot of SACRO-ML v.1.0.6.
- type: doi
value: 10.5281/zenodo.8430143
description: This is the archived snapshot of AI-SDC v.1.1.0.
description: This is the archived snapshot of SACRO-ML v.1.1.0.
- type: doi
value: 10.5281/zenodo.10021954
description: This is the archived snapshot of AI-SDC v.1.1.1.
description: This is the archived snapshot of SACRO-ML v.1.1.1.
- type: doi
value: 10.5281/zenodo.10055182
description: This is the archived snapshot of AI-SDC v.1.1.2.
description: This is the archived snapshot of SACRO-ML v.1.1.2.
- type: doi
value: 10.5281/zenodo.11077535
description: This is the archived snapshot of AI-SDC v.1.1.3.
description: This is the archived snapshot of SACRO-ML v.1.1.3.
- type: doi
value: 10.5281/zenodo.12725798
description: This is the archived snapshot of AI-SDC v.1.2.0.
description: This is the archived snapshot of SACRO-ML v.1.2.0.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ pytest .

## Directory Structure

* `aisdc` Contains the aisdc source code.
* `sacroml` Contains the sacroml source code.
- `attacks` Contains a variety of privacy attacks on machine learning models.
- `preprocessing` Contains preprocessing modules for test datasets.
- `safemodel` The safemodel wrappers for common machine learning models.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
[![Latest Version](https://img.shields.io/github/v/release/AI-SDC/SACRO-ML?style=flat)](https://github.com/AI-SDC/SACRO-ML/releases)
[![DOI](https://zenodo.org/badge/518801511.svg)](https://zenodo.org/badge/latestdoi/518801511)
[![codecov](https://codecov.io/gh/AI-SDC/SACRO-ML/branch/main/graph/badge.svg?token=AXX2XCXUNU)](https://codecov.io/gh/AI-SDC/SACRO-ML)
[![Python versions](https://img.shields.io/pypi/pyversions/aisdc.svg)](https://pypi.org/project/aisdc)
[![Python versions](https://img.shields.io/pypi/pyversions/sacroml.svg)](https://pypi.org/project/sacroml)

# SACRO-ML

A collection of tools and resources for managing the [statistical disclosure control](https://en.wikipedia.org/wiki/Statistical_disclosure_control) of trained [machine learning](https://en.wikipedia.org/wiki/Machine_learning) models. For a brief introduction, see [Smith et al. (2022)](https://doi.org/10.48550/arXiv.2212.01233).

The `aisdc` package provides:
The `sacroml` package provides:
* A variety of privacy attacks for assessing machine learning models.
* The safemodel package: a suite of open source wrappers for common machine learning frameworks, including [scikit-learn](https://scikit-learn.org) and [Keras](https://keras.io). It is designed for use by researchers in Trusted Research Environments (TREs) where disclosure control methods must be implemented. Safemodel aims to give researchers greater confidence that their models are more compliant with disclosure control.

## Installation

[![PyPI package](https://img.shields.io/pypi/v/aisdc.svg)](https://pypi.org/project/aisdc)
[![PyPI package](https://img.shields.io/pypi/v/sacroml.svg)](https://pypi.org/project/sacroml)

Install `aisdc` and manually copy the [`examples`](examples/).
Install `sacroml` and manually copy the [`examples`](examples/).

To install only the base package, which includes the attacks used for assessing privacy:

```
$ pip install aisdc
$ pip install sacroml
```

To additionally install the safemodel package:

```
$ pip install aisdc[safemodel]
$ pip install sacroml[safemodel]
```

Note: macOS users may need to install libomp due to a dependency on XGBoost:
Expand Down
6 changes: 3 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ $ python -m examples.attack_lira
For example:
```
$ python -m examples.train_rf_nursery
$ aisdc gen-attack
$ aisdc run target_rf_nursery attack.yaml
$ sacroml gen-attack
$ sacroml run target_rf_nursery attack.yaml
```

If you are unable to use the Python `Target` class to generate the `target_dir/` containing the `target.yaml` you can generate one using the CLI tool:

```
$ aisdc gen-target
$ sacroml gen-target
```

## User Stories
Expand Down
4 changes: 2 additions & 2 deletions examples/attack_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import logging

from aisdc.attacks import attribute_attack
from aisdc.attacks.target import Target
from sacroml.attacks import attribute_attack
from sacroml.attacks.target import Target

output_dir = "outputs_aia"
target_dir = "target_rf_nursery"
Expand Down
4 changes: 2 additions & 2 deletions examples/attack_lira.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import logging

from aisdc.attacks.likelihood_attack import LIRAAttack
from aisdc.attacks.target import Target
from sacroml.attacks.likelihood_attack import LIRAAttack
from sacroml.attacks.target import Target

output_dir = "outputs_lira"
target_dir = "target_rf_breast_cancer"
Expand Down
4 changes: 2 additions & 2 deletions examples/attack_worstcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

import logging

from aisdc.attacks import worst_case_attack
from aisdc.attacks.target import Target
from sacroml.attacks import worst_case_attack
from sacroml.attacks.target import Target

output_dir = "outputs_worstcase"
target_dir = "target_rf_breast_cancer"
Expand Down
4 changes: 2 additions & 2 deletions examples/safemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, OneHotEncoder

from aisdc.attacks.target import Target
from aisdc.safemodel.classifiers import SafeDecisionTreeClassifier
from sacroml.attacks.target import Target
from sacroml.safemodel.classifiers import SafeDecisionTreeClassifier

output_dir = "outputs_safemodel"

Expand Down
2 changes: 1 addition & 1 deletion examples/train_rf_breast_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split

from aisdc.attacks.target import Target
from sacroml.attacks.target import Target

output_dir = "target_rf_breast_cancer"

Expand Down
2 changes: 1 addition & 1 deletion examples/train_rf_nursery.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, OneHotEncoder

from aisdc.attacks.target import Target
from sacroml.attacks.target import Target

output_dir = "target_rf_nursery"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@

import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, OneHotEncoder

from aisdc.attacks.target import Target
from aisdc.safemodel.classifiers import SafeDecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, OneHotEncoder


def main():
Expand Down
1 change: 0 additions & 1 deletion examples/user_stories/user_story_1/user_story_1_tre.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import os

import yaml

from aisdc.attacks.attack_report_formatter import GenerateTextReport


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@

import numpy as np
import pandas as pd
from data_processing_researcher import process_dataset

from aisdc.attacks.target import Target
from aisdc.safemodel.classifiers import SafeDecisionTreeClassifier
from data_processing_researcher import process_dataset


def run_user_story():
Expand Down
1 change: 0 additions & 1 deletion examples/user_stories/user_story_2/user_story_2_tre.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import numpy as np
import pandas as pd
import yaml

from aisdc.attacks.attack_report_formatter import GenerateTextReport
from aisdc.attacks.target import Target

Expand Down
1 change: 0 additions & 1 deletion examples/user_stories/user_story_3/user_story_3_tre.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import numpy as np
import yaml

from aisdc.attacks.attack_report_formatter import GenerateTextReport
from aisdc.attacks.likelihood_attack import LIRAAttack
from aisdc.attacks.target import Target
Expand Down
1 change: 0 additions & 1 deletion examples/user_stories/user_story_4/user_story_4_tre.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import numpy as np
import pandas as pd
import yaml

from aisdc.attacks.attack_report_formatter import GenerateTextReport
from aisdc.attacks.worst_case_attack import WorstCaseAttack

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@

import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, OneHotEncoder

from aisdc.attacks.target import Target
from aisdc.safemodel.classifiers import SafeDecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, OneHotEncoder


def run_user_story():
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ docstring-code-line-length = 80
[tool.ruff.lint.extend-per-file-ignores]
"user_stories/**/*" = ["ANN"]
"tests/**/*" = ["S101", "PLR2004", "ANN"]
"aisdc/attacks/structural_attack.py" = ["PLR2004"]
"sacroml/attacks/structural_attack.py" = ["PLR2004"]
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions aisdc/attacks/attack.py → sacroml/attacks/attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

from fpdf import FPDF

from aisdc.attacks import report
from aisdc.attacks.target import Target
from sacroml.attacks import report
from sacroml.attacks.target import Target

logger = logging.getLogger(__name__)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from sklearn.base import BaseEstimator
from sklearn.preprocessing import OneHotEncoder

from aisdc.attacks import report
from aisdc.attacks.attack import Attack
from aisdc.attacks.target import Target
from sacroml.attacks import report
from sacroml.attacks.attack import Attack
from sacroml.attacks.target import Target

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
Expand Down
10 changes: 5 additions & 5 deletions aisdc/attacks/factory.py → sacroml/attacks/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

import yaml

from aisdc.attacks.attribute_attack import AttributeAttack
from aisdc.attacks.likelihood_attack import LIRAAttack
from aisdc.attacks.structural_attack import StructuralAttack
from aisdc.attacks.target import Target
from aisdc.attacks.worst_case_attack import WorstCaseAttack
from sacroml.attacks.attribute_attack import AttributeAttack
from sacroml.attacks.likelihood_attack import LIRAAttack
from sacroml.attacks.structural_attack import StructuralAttack
from sacroml.attacks.target import Target
from sacroml.attacks.worst_case_attack import WorstCaseAttack

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from fpdf import FPDF
from scipy.stats import norm, shapiro

from aisdc import metrics
from aisdc.attacks import report
from aisdc.attacks.attack import Attack
from aisdc.attacks.target import Target
from sacroml import metrics
from sacroml.attacks import report
from sacroml.attacks.attack import Attack
from sacroml.attacks.target import Target

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion aisdc/attacks/report.py → sacroml/attacks/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from fpdf import FPDF
from pypdf import PdfWriter

from aisdc.attacks.attack_report_formatter import GenerateJSONModule
from sacroml.attacks.attack_report_formatter import GenerateJSONModule

# Adds a border to all pdf cells of set to 1 -- useful for debugging
BORDER = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from sklearn.tree import DecisionTreeClassifier
from xgboost.sklearn import XGBClassifier

from aisdc.attacks.attack import Attack
from aisdc.attacks.target import Target
from sacroml.attacks.attack import Attack
from sacroml.attacks.target import Target

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split

from aisdc import metrics
from aisdc.attacks import report
from aisdc.attacks.attack import Attack, get_class_by_name
from aisdc.attacks.target import Target
from sacroml import metrics
from sacroml.attacks import report
from sacroml.attacks.attack import Attack, get_class_by_name
from sacroml.attacks.target import Target

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions aisdc/config/attack.py → sacroml/config/attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import yaml

from aisdc.attacks import factory
from aisdc.config import utils
from sacroml.attacks import factory
from sacroml.config import utils


def _get_defaults(name: str) -> dict:
Expand Down
4 changes: 2 additions & 2 deletions aisdc/config/target.py → sacroml/config/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import os
import sys

from aisdc.attacks.target import Target
from aisdc.config import utils
from sacroml.attacks.target import Target
from sacroml.config import utils

arrays_pro = ["X_train", "y_train", "X_test", "y_test"]
arrays_raw = ["X", "y", "X_train_orig", "y_train_orig", "X_test_orig", "y_test_orig"]
Expand Down
File renamed without changes.
Loading

0 comments on commit 37a0992

Please sign in to comment.