Categorisation of labeled data
Project description
===============================
binopt
===============================
.. image:: https://img.shields.io/pypi/v/binopt.svg
:target: https://pypi.python.org/pypi/binopt
.. image:: https://img.shields.io/travis/yhaddad/binopt.svg
:target: https://travis-ci.org/yhaddad/binopt
.. image:: https://readthedocs.org/projects/binopt/badge/?version=latest
:target: https://binopt.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/yhaddad/binopt/shield.svg
:target: https://pyup.io/repos/github/yhaddad/binopt/
:alt: Updates
.. image:: https://zenodo.org/badge/86721620.svg
:target: https://zenodo.org/badge/latestdoi/86721620
This package is aiming to categorize labeled data in terms of a global figure of merit. In high energy physics, categorization of collision data is done by maximizing the discovery significance. This package run on unbinned binary datasets.
installation
************
Install like any other python package::
pip install binopt --user
or::
git clone git@github.com:yhaddad/binopt.git
cd binopt/
pip install .
Getting started
***************
.. code-block:: python
sevent = 1000
bevent = 10000
X = np.concatenate((
expit(np.random.normal(+2.0, 2.0, sevent)),
expit(np.random.normal(-0.5, 2.0, bevent))
))
Y = np.concatenate((
np.ones(sevent),
np.zeros(bevent)
))
W = np.concatenate((np.ones(sevent), np.ones(bevent)))
binner = binopt.optimize_bin(
nbins=3, range=[0, 1],
drop_last_bin=True,
fix_upper=True,
fix_lower=False,
use_kde_density=True
)
opt = binner.fit(
X, Y, sample_weights=W,
method="Nelder-Mead",
breg=None, fom="AMS2"
)
print "bounds : ", opt.x
print "signif : ", binner.binned_score(opt.x)
print "Nsig : ", binner.binned_stats(opt.x)[0]
print "Nbkg : ", binner.binned_stats(opt.x)[1]
* Free software: GNU General Public License v3
* Documentation: https://binopt.readthedocs.io.
Features
--------
* TODO
Credits
---------
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
=======
History
=======
0.1.0 (2017-04-06)
------------------
* First release on PyPI.
binopt
===============================
.. image:: https://img.shields.io/pypi/v/binopt.svg
:target: https://pypi.python.org/pypi/binopt
.. image:: https://img.shields.io/travis/yhaddad/binopt.svg
:target: https://travis-ci.org/yhaddad/binopt
.. image:: https://readthedocs.org/projects/binopt/badge/?version=latest
:target: https://binopt.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/yhaddad/binopt/shield.svg
:target: https://pyup.io/repos/github/yhaddad/binopt/
:alt: Updates
.. image:: https://zenodo.org/badge/86721620.svg
:target: https://zenodo.org/badge/latestdoi/86721620
This package is aiming to categorize labeled data in terms of a global figure of merit. In high energy physics, categorization of collision data is done by maximizing the discovery significance. This package run on unbinned binary datasets.
installation
************
Install like any other python package::
pip install binopt --user
or::
git clone git@github.com:yhaddad/binopt.git
cd binopt/
pip install .
Getting started
***************
.. code-block:: python
sevent = 1000
bevent = 10000
X = np.concatenate((
expit(np.random.normal(+2.0, 2.0, sevent)),
expit(np.random.normal(-0.5, 2.0, bevent))
))
Y = np.concatenate((
np.ones(sevent),
np.zeros(bevent)
))
W = np.concatenate((np.ones(sevent), np.ones(bevent)))
binner = binopt.optimize_bin(
nbins=3, range=[0, 1],
drop_last_bin=True,
fix_upper=True,
fix_lower=False,
use_kde_density=True
)
opt = binner.fit(
X, Y, sample_weights=W,
method="Nelder-Mead",
breg=None, fom="AMS2"
)
print "bounds : ", opt.x
print "signif : ", binner.binned_score(opt.x)
print "Nsig : ", binner.binned_stats(opt.x)[0]
print "Nbkg : ", binner.binned_stats(opt.x)[1]
* Free software: GNU General Public License v3
* Documentation: https://binopt.readthedocs.io.
Features
--------
* TODO
Credits
---------
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
=======
History
=======
0.1.0 (2017-04-06)
------------------
* First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
binopt-0.2.0.tar.gz
(28.9 kB
view hashes)
Built Distribution
binopt-0.2.0-py2.py3-none-any.whl
(18.5 kB
view hashes)
Close
Hashes for binopt-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79acda3da33381ecb95e7e3b8c53e5d290608d7302afdd8d7cb5a17a505c5cd3 |
|
MD5 | 6319d8f5030aa66651878e4fdad66da1 |
|
BLAKE2b-256 | 4efabed52c106f22f19e44b7e1e93b9cefbf3f0bbf43c0af32f53250d1b356dc |