Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Bayesian Assessment of Hypotheses

Project description

Bayesian Hypothesis Assessment

A Bayesian hypothesis assessment framework, tailored to comparing pairs of experiments. This package is preliminary implementation statistical analyses described in this paper. This can also be seen as a complimentary to
testSignificanceNLP package which contains popular Frequentist tests.

We focus on the setup where the performances of two algorithms, applied on a certain dataset, are provided based on an evaluation measure. The comparison is done by studying the posterior probabilities (rather than binary commonly-used binary decisions in other tests.)

For further discussion of the approaches implemented here (and their comparison to other techniques), refer to the paper or the extended manual.

Getting started

Installation

For running this code, you will need Python (version >=3.6). You have two options for installation:

  • If you don't want to modify any code, you can just install the package and use it in commandline:
 > pip install HyBayes
  • Alternatively, if you'd like to make modifications to the code (e.g., the underlying model) you can clone this project. Before running the code, make sure that you have all the requirements by running the following line to install all the necessary dependencies:
 > pip install -r requirements.txt

If you're using MacOS, install GraphViz via brew command:

 > brew install graphviz

Preparing configuration file

To analyze your data, you need to prepare the a configuration file that specifies the information needed for the analysis (e.g., the address to your observation files, the type of plots and files you want to be stored).

You can find more details on this in the extended manual. Additionally, there are examples of complete configurations in configs folder, after running make_configs.py.

Running the Analysis

Let's assume that you have followed the above instructions and:

  • (1) you have included the performances observations in two separate files,
  • (2) and you have prepared a config file.

To run the analysis, you pass the name of the config file as argument:

 > python -m HyBayes --config my_config_file.ini --verbose

When the flag --verbose is on, the details of the analysis will be printed in standard output. This flag does not affect the log file that is stored along side other outputs.

And here is the general usage template which can be accessed using --help flag at any time:

 > python -m HyBayes --help
usage: __main__.py [-h] [-c CONFIG] [-v] [--make_configs] [--make_data]

Run Bayesian Statistics Tailored towardsanalysing the experiment results
specially in NLP area.Email esamath@gmail.com for comments.

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        address of Config file
  -v, --verbose         prints the report of the steps
  --make_configs        if on, example configuration files will be made.
  --make_data           if on, example data files will be made.

Examples

To demonstrate everything with a quick example, run the following command to generate toy data:

 > python -m HyBayes --make_data

You can see the some artificial data made in directory artificial_data. Moreover either use the config files provided in the repository [], or run:

 > python -m HyBayes --make_configs

And then execute the analysis on any of the newly made config files. For example:

 > python -m HyBayes --config configs/config_metric.ini --verbose

Further Reading

If you want to learn more about this package, please refer to the extended manual. If you want to learn about the concepts discusssed here, refer to the paper below.

License

This code is published under Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.

Citation

If you used this package in your research feel free to cite the following paper:

@misc{hypothesisAssessment19,
  title={Not All Claims are Created Equal: Choosing the Right Approach to Assess Your Hypotheses},
  author={{Sadeqi Azer}, Erfan and Khashabi, Daniel and Sabharwal, Ashish and Roth, Dan},
  howpublished={arxiv},
  year={2019}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hybayes, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size hybayes-0.0.2.tar.gz (18.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page