Package: aict-tools
aict-toolsExecutables to perform machine learning tasks on FACT and CTA eventlist data.
Possibly also able to handle input of other experiments if in the same file format.All you ever wanted to do  with your IACT data in one package. This project is mainly targeted at using machine-learning for the following tasks:Energy RegressionGamma/Hadron SeparationReconstruction of origin (Mono for now)CitingIf you use theaict-tools, please cite us like this using the doi provided by
zenodo, e.g. like this if using bibtex files:@misc{aict-tools,author={Nöthe, Maximilian and Brügge, Kai Arno and Buß, Jens Björn},title={aict-tools},subtitle={Reproducible Artificial Intelligence for Cherenkov Telescopes},doi={10.5281/zenodo.3338081},url={https://github.com/fact-project/aict-tools},}InstallationThen you can install the aict-tools by:pip install aict-toolsBy default, this does not install optional dependencies for writing out
models inonnxorpmmlformat.
If you want to serialize models to these formats, install this using:$ pip install aict-tools[pmml] # for pmml support
$ pip install aict-tools[onnx] # for onnx supportIn the case of working with CTA data, you will also need to have ctapipe installed.
If this is not already the case, you can install it using:$ pip install aict-tools[cta] # for DISP use on CTA dataTo install all optional dependencies, use:$ pip install aict-tools[all]  # for allAlternatively you can clone the repo,cdinto the folder and do the usualpip install .dance.UsageFor each task, there are two executables, installed to yourPATH.
Each takeyamlconfiguration files andh5pystyle hdf5 files as input.
The models are saved aspickleusingjobliband/orpmmlusingsklearn2pmml.aict_train_<...>This script is used to train a model on events with known truth
values for the target variable, usually monte carlo simulations.aict_apply_<...>This script applies a given model, previously trained withaict_train_<...>and applies it to data, either a test data set or data with unknown truth values for the target variable.The apply scripts can iterate through the data files in chunks using
the--chunksize=<N>option, this can be handy for very large files (> 1 million events).Energy RegressionEnergy regression for gamma-rays require ayamlconfiguration file
and simulated gamma-rays in the event list format.The two scripts to perform energy regression are calledaict_train_energy_regressoraict_apply_energy_regressorAn example configuration can be found inexamples/config_energy.yaml.To apply a model, useaict_apply_energy_regressor.SeparationBinary classification or Separation requires ayamlconfiguration file,
one data file for the signal class and one data file for the background class.The two scripts to perform separation are calledaict_train_separation_modelaict_apply_separation_model.An example configuration can be found inexamples/config_separator.yaml.Reconstruction of gamma-ray origin using the disp methodTo estimate the origin of the gamma-rays in camera coordinates, thedisp-method can be used.Here it is implemented as a two step regression/classification task.
One regression model is trained to estimateabs(disp)and a
classification model is trained to estimatesgn(disp).Training requires simulated diffuse gamma-ray events.aict_train_disp_regressoraict_apply_disp_regressorAn example configuration can be found inexamples/config_source.yaml.
Currently supported experiments:FACTCTANote: By applying the disp regressor,Thetawil be deleted from the feature set.Theta has to be calculated from the source prediction e.g. by usingfact_calculate_thetafrom pyfact.Utility scriptsApplying straight cutsFor data selection, e.g. to get rid of not well reconstructable events,
it is customary to apply so called pre- or quality cuts before applying machine learning models.This can be done withaict_apply_cutsand ayamlconfiguration file of the cuts to apply. Seeexamples/quality_cuts.yamlfor an example configuration file.Split data into training/test setsUsingaict_split_data, a dataset can be randomly split into sets,
e.g. to split a monte carlo simulation dataset into train and test set.