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
How many subarray events to load at once before training on n_events.
Number of events for training the model.
Number of threads to use for the reconstruction.
Output path for the trained reconstructor.
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.
- 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