Coder Social home page Coder Social logo

nunesgh / bvm-library Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 458 KB

Bayes Vulnerability for Microdata Library.

License: GNU Lesser General Public License v3.0

Python 100.00%
microdata python qif quantitative-information-flow bayes-vulnerability

bvm-library's Issues

Bug: wrong result for deterministic leakage wrt attribute inference (dCA)

In the particular case where the secret is a function of the QIDs, the deterministic leakage is being computed as zero. This bug is due to a wrong condition that should be triggered only when prior is 1:

variables['CA'][attribute].update(d = variables['CA'][attribute]['d']/dataset_size)
if variables['CA'][attribute]['d'] == 1:
    variables['CA'][attribute].update(d = variables['CA'][attribute]['d'] - 1)

Before the first line, variables['CA'][attribute]['d'] corresponds to the sum of the cardinalities of the partitions induced by the QIDs in which all secret values are the same. This count is going to be equal to the size of the dataset when prior is 1 (i.e., when there is only one possible value for the secret in the whole dataset), but also, more generally in the case of a secret that is a function of the QIDs, since then all partitions have a unique secret value and the sum of their cardinalities is the size of the dataset.

Bug: untreated NA and NaN values

The library does not support NA or NaN values and those must be manually filled using the pandas .fillna() method before calling the BVM() class, e.g. when creating the pandas DataFrame.

Histograms: Fix rounding and improve format

Problem: The histogram provided by the package (for all attacks) is rounding probabilities with <0.5% to 0%, but for any attack the probability can never be 0. The probabilities should not be rounded.

Improvement: Each probability is being rounding before generating the histogram. The histogram could be given without any rounding in the following way:

  1. Set a histogram with 100 bins: (0,1], (1,2], ..., (99,100]
  2. Each probability could be placed in the corresponding bin. For instance, 0.4375 would be placed in the 43th bin, (43,44].

As the histogram is already a dictionary, it could be given with the interval of bins as the labels. For example:

{
"(0,1]": probability_1,
"(1,2]": probability_2,
...
"(99,100]": probability_100,
}

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.