Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

UAMLDA/poisoning

 
 

Repository files navigation

Dataset Poisoning

Poisoning datasets using gradient ascent, targeting feature selection.

Build Status Actions Status Actions Status Code style: black

Documentation


Examples

The following is an example of using xiao2018 to poison a gaussian distribution.

Poisoning Example

The following is an example of using frederickson2018 to poison a gaussian distribution.

Poisoning Example

Installation

You can install poisoning by cloning from this repository, and then installing with pip:

pip install poisoning

A shortcut is to run the following command:

pip install git+https://github.com/rpgolota/poisoning/

Get started

import pandas as pd
from poisoning import xiao2018

dataset = pd.read_csv('spect_test.csv', sep=",", header=None)

X = dataset.iloc[:,:-1].values
Y = dataset.iloc[:,-1].values

model = xiao2018(type='elastic')
# poison 10 percent of the dataset, with a boundary box of 0 to 2 for all features
poisoned, labels = model.autorun(X, Y, 0.1, (0,2))
Windows

If you are on windows, make sure to use a name guard if multiprocessing is enabled (default),

if __name__ == '__main__':
    model = xiao2018()
    ...

or disable multiprocessing altogether.

model = xiao2018(parallel=False)
...

About

Poisoning datasets using gradient ascent, targeting feature selection.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%