-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example Notebook #29
Example Notebook #29
Changes from all commits
a431520
19c09bf
803b02a
56d25e9
7e45295
af260c4
cd0f0b5
3da5f0b
8c34f59
a6c9b62
da03326
28674cb
c34c025
446eea4
dc7ec1c
1d1d65f
8f6670a
0d4f6c5
e9df9e9
5823c13
3207b5c
213a99b
57efaa8
c92cb64
3734fd3
16389a2
c276ebe
968c046
a9f9d4a
de8562b
f98c22b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ build | |
dist | ||
__pycache__ | ||
.eggs | ||
gofevaluation_tutorial.py |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
v0.1.0 | ||
=================== | ||
* Release as a python package | ||
* Multiple GOF tests (binned and unbinned) can be performed (#1, #5, #10, #12, #13) | ||
* The p-value is calculated based on toy sampling from the reference or a permutation test (#2, #14) | ||
* A wrapper class makes it convenient to perform multiple GOF tests in parallel (#19) | ||
* An equiprobable binning algorithm is implemented. The binning can be applied upon initialisation of the GOF object and a few visualization tools are provided. (#25, #26) | ||
* CI workflow implemented (#7) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# GOFevaluation | ||
Evaluate the Goodness-of-Fit (GoF) for binned or unbinned data. | ||
![Test package](https://github.com/XENONnT/GOFevaluation/actions/workflows/python-package.yml/badge.svg) | ||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/XENONnT/GOFevaluation/HEAD) | ||
[![PyPI version shields.io](https://img.shields.io/pypi/v/GOFevaluation.svg)](https://pypi.python.org/pypi/GOFevaluation/) | ||
[![CodeFactor](https://www.codefactor.io/repository/github/xenonnt/gofevaluation/badge)](https://www.codefactor.io/repository/github/xenonnt/gofevaluation) | ||
[![Coverage Status](https://coveralls.io/repos/github/XENONnT/GOFevaluation/badge.svg?branch=master)](https://coveralls.io/github/XENONnT/GOFevaluation?branch=master) | ||
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5626909.svg)](https://doi.org/10.5281/zenodo.5626909) | ||
|
||
This GoF suite comprises the possibility to calculate different 1D / nD, binned / two-sample (unbinned) GoF measures and the corresponding p-value. A list of implemented measures is given below. | ||
|
@@ -19,6 +23,12 @@ This GoF suite comprises the possibility to calculate different 1D / nD, binned | |
|
||
## Installation and Set-Up | ||
|
||
### Regular installation: | ||
``` | ||
pip install GOFevaluation | ||
``` | ||
|
||
### Developer setup: | ||
Clone the repository: | ||
|
||
``` | ||
|
@@ -37,6 +47,7 @@ python setup.py install --user | |
You are now good to go! | ||
|
||
## Usage | ||
The best way to start with the `GOFevaluation` package is to have a look at the tutorial notebook. If you click on the [mybinder](https://mybinder.org/v2/gh/XENONnT/GOFevaluation/HEAD) badge, you can execute the interactive notebook and give it a try yourself without the need of a local installation. | ||
### Individual GoF Measures | ||
Depending on your data and reference input you can initialise a `gof_object` in one of the following ways: | ||
```python | ||
|
@@ -84,27 +95,38 @@ gof_object.get_gofs(d_min=d_min) | |
# OUTPUT: | ||
# OrderedDict([('ADTestTwoSampleGOF', 1.6301454042304904), | ||
# ('KSTestTwoSampleGOF', 0.14), | ||
# ('PointToPointGOF', 0.00048491049630050576)]) | ||
# ('PointToPointGOF', -0.7324060759792504)]) | ||
|
||
gof_object.get_pvalues(d_min=d_min) | ||
# OUTPUT: | ||
# OrderedDict([('ADTestTwoSampleGOF', 0.08699999999999997), | ||
# ('KSTestTwoSampleGOF', 0.10699999999999998), | ||
# ('PointToPointGOF', 0.14300000000000002)]) | ||
# ('PointToPointGOF', 0.31200000000000006)]) | ||
|
||
# Re-calculate p-value only for one measure: | ||
gof_object.get_pvalues(d_min=.3, gof_list=['PointToPointGOF']) | ||
gof_object.get_pvalues(d_min=.001, gof_list=['PointToPointGOF']) | ||
# OUTPUT: | ||
# OrderedDict([('ADTestTwoSampleGOF', 0.08699999999999997), | ||
# ('KSTestTwoSampleGOF', 0.10699999999999998), | ||
# ('PointToPointGOF', 0.03400000000000003)]) | ||
# ('PointToPointGOF', 0.128)]) | ||
|
||
print(gof_object) | ||
# OUTPUT: | ||
# GOFevaluation.gof_test | ||
# GoF measures: ADTestTwoSampleGOF, KSTestTwoSampleGOF, PointToPointGOF | ||
# gofs = 1.6301454042304904, 0.14, 0.00048491049630050576 | ||
# p-values = 0.08699999999999997, 0.10699999999999998, 0.03400000000000003 | ||
# GOF measures: ADTestTwoSampleGOF, KSTestTwoSampleGOF, PointToPointGOF | ||
|
||
|
||
# ADTestTwoSampleGOF | ||
# gof = 1.6301454042304904 | ||
# p-value = 0.08499999999999996 | ||
|
||
# KSTestTwoSampleGOF | ||
# gof = 0.13999999999999996 | ||
# p-value = 0.09799999999999998 | ||
|
||
# PointToPointGOF | ||
# gof = -0.7324060759792504 | ||
# p-value = 0.128 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New output is great! |
||
``` | ||
|
||
|
||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,3 @@ numpy | |
scipy | ||
sklearn | ||
matplotlib | ||
flake8 | ||
pytest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's nice to get rid of these dependencies as we only need them for CI checking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does only PointToPointGOF change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The definition of the test statistic was changed in #25 but I forgot to adapt the reader accordingly.