Code Monkey home page Code Monkey logo

mondrian-multidimensional-k-anonymity's Introduction

Mondrian-Multidimensional-K-Anonymity

made-with-python Code style: black Imports: isort

An application of the "Mondrian Multidimensional K-Anonymity" article in Python.

It provides a robust anonymization technique for protecting user privacy which prevents table joining attacks on datasets while preserving data utility.

Installation

Clone the repository and set up a virtual environment:

cd Mondrian-Multidimensional-K-Anonymity
python3 -m venv venv
. venv/bin/activate

Install the requirements:

pip install -r requirements.txt

Usage

To run the Mondrian anonymization process on your data:

python3 mondrian.py --input data/adult.csv --sensitive-data class

You can also get an illustration of c-avg metric for different k values using data/adult.csv file:

python3 mondrian.py --test

image

Note that this is only an illustration of algorithm quality and will be generated using predefined data and the generated figure is always the same.

To see the full list of commands run:

python3 mondrian.py --help
usage: mondrian.py [-h] [--ei Explicit Identifier [Explicit Identifier ...]]
                   [--sensitive-data Sensitive Data [Sensitive Data ...]] [--k K] [--input INPUT] [--test]

An application of 'Mondrian Multidimensional K-Anonymity' article in Python

options:
  -h, --help            show this help message and exit
  --ei Explicit Identifier [Explicit Identifier ...]
                        Explicit Identifiers to be removed from dataset (example: --ei id name)
  --sensitive-data Sensitive Data [Sensitive Data ...]
                        Sensitive Data you don't want to anonymize to maintain utility (example: --sensitive-
                        data salary)
  --k K                 The k value for k-anonymity (default: 2)
  --input INPUT         Input csv file path (default: data/adult.csv)
  --test                Draws an illustration of c-avg metric for different k values using data/adult.csv file.

Resources

Article

Dataset

Contribution

Feel free to contribute in any way possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.