Skip to content

Attribute inference custom example#55

Open
itrajanovska wants to merge 4 commits intostatice:mainfrom
itrajanovska:attribute_inference_custom_example
Open

Attribute inference custom example#55
itrajanovska wants to merge 4 commits intostatice:mainfrom
itrajanovska:attribute_inference_custom_example

Conversation

@itrajanovska
Copy link
Copy Markdown
Contributor

Add an example with the custom model feature for the inference attacks;
Add an example for the group-wise attacks;
Update README.md.

itrajanovska and others added 3 commits March 23, 2026 17:27
Add an example for the group-wise attacks;
Update README.md.
Use pd.testing.assert_index_equal instead of list comparison.
Copy link
Copy Markdown
Member

@MatteoGiomi MatteoGiomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @itrajanovska, looks very good! I have just a few comments.

"\n",
"The synthetic version has been generated by `CTGAN` from [SDV](https://sdv.dev/SDV/user_guides/single_table/ctgan.html), as explained in the paper accompanying this code release. For details on the generation process, e.g. regarding hyperparameters, see Section 6.2.1 of [the accompanying paper](https://petsymposium.org/popets/2023/popets-2023-0055.php)).\n",
"\n",
"We pull these datasets from the [Statice](https://www.statice.ai/) public GC bucket:"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed, the data is distribted with the code now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"The requirements for the model are:\n",
"\n",
"1. It is trained on the synthetic data with the `secret` as a target. (It can be a classification or regression model)\n",
"2. The inference model must implement our protocol that defines a predict(x) method returning predictions whose index matches that of x (anonymeter.evaluators.inference_predictor::InferencePredictor)\n",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reference to the InferencePredictor does not render well.

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapped it in `` now

" inference_model = SklearnInferencePredictor(model)\n",
" \n",
" # Needed for anonymeter (is the target categorical or numerical variable?)\n",
" regression = True if syn[secret].dtype.kind in 'iuf' else False\n",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you leave it to the default (None) the code will decide depending or not the secret is numerical (see here) using a similar logic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I oversaw this. The parameter is removed now

Remove explicit regression parameter in InferenceEvaluator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants