TrainEnergyRegressor

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

Bases: ctapipe.core.tool.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

classes

description

examples

n_events

Number of events for training the model.

name

output_path

Output path for the trained reconstructor.

random_seed

Random seed for sampling and cross validation

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: Dict[Union[str, Tuple[str, ]], Union[str, Tuple[str, str]]] = {('i', 'input'): 'TableLoader.input_url', ('o', 'output'): 'TrainEnergyRegressor.output_path', 'n-events': 'TrainEnergyRegressor.n_events', 'cv-output': 'CrossValidator.output_path'}
classes: List[Type[Any]] = [<class 'ctapipe.io.tableloader.TableLoader'>, <class 'ctapipe.reco.sklearn.EnergyRegressor'>, <class 'ctapipe.reco.sklearn.CrossValidator'>]
description: Union[str, ctapipe.core.traits.Unicode] = '\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: Union[str, ctapipe.core.traits.Unicode] = '\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.

name: Union[str, ctapipe.core.traits.Unicode] = '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 and cross validation

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.