Skip to main content

A package for analysis of rare particle decays with machine-learning algorithms

Project description

Code Health Build Status PyPI version Dependency Status

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:

from raredecay.data import HEPDataStorage
from raredecay.score import train_similar

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

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

Depending on which functionality you want to use, you may consider different installations.

Everything (reweighting incl. scoring, machine learning, ROOT bindings)

Follow the instructions for each dependency separately and then install raredecay via

pip install raredecay[all]

Machine learning, advanced scores

First install the following version of REP (the -U can be omitted, but is recommended to have the newest dependencies, on the other hand may crashes REPs reproducibility):

pip install -U https://github.com/yandex/rep/archive/stratifiedkfold.zip

Then install the package via

pip install -U raredecay[ml]

Reweighting (without scoring)

To install the newest version of hep_ml containing the loss-regularization (recommended, but optional).

pip install -U git+https://github.com/arogozhnikov/hep_ml.git

Then, install the raredecay package (without ROOT-support) via

pip install raredecay

To make sure you can convert ROOT-NTuples, use

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

As it is a young package still under developement, it may receive regular updates and improvements and it is probably a good idea to regularly download the newest package.

Project details


Download files

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

Source Distribution

raredecay-2.0.1.tar.gz (94.0 kB view details)

Uploaded Source

Built Distribution

raredecay-2.0.1-py3-none-any.whl (112.0 kB view details)

Uploaded Python 3

File details

Details for the file raredecay-2.0.1.tar.gz.

File metadata

  • Download URL: raredecay-2.0.1.tar.gz
  • Upload date:
  • Size: 94.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for raredecay-2.0.1.tar.gz
Algorithm Hash digest
SHA256 99ee5555e7a6feeb7e8b8428d25b4beb17ac684f6bbac16e04df96928204772d
MD5 e1822eef5802f506f3bcd00aea1236b2
BLAKE2b-256 4fd81335ac6ee4b25a26f61a27f62beab28804e9f9b12dfdd989899205822dfc

See more details on using hashes here.

File details

Details for the file raredecay-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for raredecay-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9432d5548f8fceca8c0a0cb844a54e462a63676b0831a1f64cd1e05a695c000e
MD5 b4bfa65f6e3eac3f2e2c6d7fb3adb531
BLAKE2b-256 9a05f73060a903e8bbe97f550b56b2d4ada75f13c2ae941065aaa38e625e3558

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page