ctapipe is not stable yet, so expect large and rapid changes to structure and functionality as we explore various design choices before the 1.0 release.

TrainEnergyRegressor#

class ctapipe.tools.train_energy_regressor.TrainEnergyRegressor(**kwargs: Any)[source]#

Bases: Tool

Tool to train a EnergyRegressor on dl1b/dl2 data.

The tool first performs a cross validation to give an initial estimate on the quality of the estimation and then finally trains one model per telescope type on the full dataset.

Attributes Summary

aliases

chunk_size

How many subarray events to load at once before training on n_events.

classes

description

examples

n_events

Number of events for training the model.

n_jobs

Number of threads to use for the reconstruction.

name

output_path

Output path for the trained reconstructor.

random_seed

Random seed for sampling training events.

Methods Summary

finish()

Write-out trained models and cross-validation results.

setup()

Initialize components from config.

start()

Train models per telescope type.

Attributes Documentation

aliases: StrDict = {'chunk-size': 'TrainEnergyRegressor.chunk_size', 'cv-output': 'CrossValidator.output_path', 'n-events': 'TrainEnergyRegressor.n_events', 'n-jobs': 'EnergyRegressor.n_jobs', ('i', 'input'): 'TableLoader.input_url', ('o', 'output'): 'TrainEnergyRegressor.output_path'}#
chunk_size#

How many subarray events to load at once before training on n_events.

classes: ClassesType = [<class 'ctapipe.io.tableloader.TableLoader'>, <class 'ctapipe.reco.sklearn.EnergyRegressor'>, <class 'ctapipe.reco.sklearn.CrossValidator'>]#
description: str | Unicode[str, str | bytes] = '\n    Tool to train a `~ctapipe.reco.EnergyRegressor` on dl1b/dl2 data.\n\n    The tool first performs a cross validation to give an initial estimate\n    on the quality of the estimation and then finally trains one model\n    per telescope type on the full dataset.\n    '#
examples: str | Unicode[str, str | bytes] = '\n    ctapipe-train-energy-regressor \\\n        --config train_energy_regressor.yaml \\\n        --input gamma.dl2.h5 \\\n        --output energy_regressor.pkl\n    '#
n_events#

Number of events for training the model. If not given, all available events will be used.

n_jobs#

Number of threads to use for the reconstruction. This overwrites the values in the config of each reconstructor.

name: str | Unicode[str, str | bytes] = 'ctapipe-train-energy-regressor'#
output_path#

Output path for the trained reconstructor. At the moment, pickle is the only supported format.

random_seed#

Random seed for sampling training events.

Methods Documentation

finish()[source]#

Write-out trained models and cross-validation results.

setup()[source]#

Initialize components from config.

start()[source]#

Train models per telescope type.