Skip to main content

Code Health Build Status PyPI version

raredecay

This package consists of several tools for the event selection of particle decays, mostly built on machine learning techniques. It contains:

  • a data-container holding data, weights, labels and more and implemented root-to-python data conversion as well as plots and KFold-data splitting

  • reweighting tools from the hep_ml-repository wrapped in a KFolding structure and with metrics to evaluate the reweighting quality

  • classifier optimization tools for hyper-parameters as well as feature selection involving a backward-elimination

  • an output handler which makes it easy to add text as well as figures into your code and automatically save them to a file

  • … and more

HowTo examples

To get an idea of the package, have a look at the howto notebooks: HTML version or the IPython Notebooks

Minimal example

Want to test whether your reweighting did overfit? Use train_similar:

import raredecay as rd

mc_data = rd.data.HEPDataStorage(df, weights=*pd.Series weights*, target=0)
real_data = rd.data.HEPDataStorage(df, weights=*pd.Series weights*, target=1)

score = rd.score.train_similar(mc_data, real_data, old_mc_weights=1 *or whatever weights the mc had before*)

Getting started right now

If you want it the easy, fast way, have a look at the Ready-to-use scripts. All you need to do is to have a look at every “TODO” task and probably change them. Then you can run the script without the need of coding at all.

Documentation and API

The API as well as the documentation: Documentation

Setup and installation

PyPI

The package with all extras requires root_numpy as well as rootpy (and therefore a ROOT installation with python-bindings) to be installed on your system. If that is not the case, some functions won’t work.

Recommended installation (requires ROOT):

pip install raredecay[all] --process-dependency-links

Anaconda

Easiest way: use conda to install everything (except of the rep, which has to be upgraded with pip for some functionalities)

conda install raredecay -c mayou36

To make sure you can convert ROOT-NTuples, use

pip install raredecay[root]  # *use raredecay\[root\] in a zsh-console*

or, instead of root/additionally (comma separated) reweight or reweight for the specific functionalities.

Release files for raredecay 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for raredecay 2.1.0
File Size Uploaded
raredecay-2.1.0.tar.gz 92.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for raredecay 2.1.0
File Interpreter ABI Platform
raredecay-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 206.9 kB

Release files / raredecay-2.1.0.tar.gz

Download URL raredecay-2.1.0.tar.gz
Size 92.7 kB
Tags Source
SHA-256 checksum
How to use checksums
89cc6b4bda86b3aa64ce526f3cdcc4f756f8fc713c7d1273a19434ee49bbb475
BLAKE2b-256 checksum
How to use checksums
93dbbc4ce274e850ba8c38c296fc14e78a7e9d2248ead60cea2fbf2aaf56d0f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.4.5

Release files / raredecay-2.1.0-py3-none-any.whl

Download URL raredecay-2.1.0-py3-none-any.whl
Size 114.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf8aecbe23174812774e3bb399c145f7579f1a4c1893c3fca095e69675e936f6
BLAKE2b-256 checksum
How to use checksums
c33658ebf85434d10959a51ddf549d7953ebf4da36df97a9d3c23572442740c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.4.5

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page